Release 1.1.8.
[wine/multimedia.git] / dlls / msi / tests / package.c
blob47ffa350a0ce135c63e291da0e798624e350d8ca
1 /*
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
22 #define COBJMACROS
24 #include <stdio.h>
25 #include <windows.h>
26 #include <msidefs.h>
27 #include <msi.h>
28 #include <msiquery.h>
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)
37 HANDLE token;
38 BYTE buf[1024];
39 DWORD size;
40 PTOKEN_USER user;
41 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
42 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
44 *usersid = NULL;
45 pConvertSidToStringSidA = (void *)GetProcAddress(hadvapi32, "ConvertSidToStringSidA");
46 if (!pConvertSidToStringSidA)
47 return;
49 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
50 size = sizeof(buf);
51 GetTokenInformation(token, TokenUser, (void *)buf, size, &size);
52 user = (PTOKEN_USER)buf;
53 pConvertSidToStringSidA(user->User.Sid, usersid);
56 /* RegDeleteTreeW from dlls/advapi32/registry.c */
57 LSTATUS WINAPI package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
59 LONG ret;
60 DWORD dwMaxSubkeyLen, dwMaxValueLen;
61 DWORD dwMaxLen, dwSize;
62 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
63 HKEY hSubKey = hKey;
65 if(lpszSubKey)
67 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
68 if (ret) return ret;
71 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
72 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
73 if (ret) goto cleanup;
75 dwMaxSubkeyLen++;
76 dwMaxValueLen++;
77 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
78 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
80 /* Name too big: alloc a buffer for it */
81 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
83 ret = ERROR_NOT_ENOUGH_MEMORY;
84 goto cleanup;
88 /* Recursively delete all the subkeys */
89 while (TRUE)
91 dwSize = dwMaxLen;
92 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
93 NULL, NULL, NULL)) break;
95 ret = package_RegDeleteTreeW(hSubKey, lpszName);
96 if (ret) goto cleanup;
99 if (lpszSubKey)
100 ret = RegDeleteKeyW(hKey, lpszSubKey);
101 else
102 while (TRUE)
104 dwSize = dwMaxLen;
105 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
106 NULL, NULL, NULL, NULL)) break;
108 ret = RegDeleteValueW(hKey, lpszName);
109 if (ret) goto cleanup;
112 cleanup:
113 if (lpszName != szNameBuf)
114 HeapFree(GetProcessHeap(), 0, lpszName);
115 if(lpszSubKey)
116 RegCloseKey(hSubKey);
117 return ret;
120 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
122 DWORD i,n=1;
123 GUID guid;
125 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
126 return FALSE;
128 for(i=0; i<8; i++)
129 out[7-i] = in[n++];
130 n++;
131 for(i=0; i<4; i++)
132 out[11-i] = in[n++];
133 n++;
134 for(i=0; i<4; i++)
135 out[15-i] = in[n++];
136 n++;
137 for(i=0; i<2; i++)
139 out[17+i*2] = in[n++];
140 out[16+i*2] = in[n++];
142 n++;
143 for( ; i<8; i++)
145 out[17+i*2] = in[n++];
146 out[16+i*2] = in[n++];
148 out[32]=0;
149 return TRUE;
152 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
153 LPCSTR guid, LPSTR usersid, BOOL dir)
155 WCHAR guidW[MAX_PATH];
156 WCHAR squashedW[MAX_PATH];
157 CHAR squashed[MAX_PATH];
158 CHAR comppath[MAX_PATH];
159 CHAR prodpath[MAX_PATH];
160 CHAR path[MAX_PATH];
161 LPCSTR prod = NULL;
162 HKEY hkey;
164 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
165 squash_guid(guidW, squashedW);
166 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
168 if (context == MSIINSTALLCONTEXT_MACHINE)
170 prod = "3D0DAE300FACA1300AD792060BCDAA92";
171 sprintf(comppath,
172 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
173 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
174 lstrcpyA(prodpath,
175 "SOFTWARE\\Classes\\Installer\\"
176 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
178 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
180 prod = "7D2F387510109040002000060BECB6AB";
181 sprintf(comppath,
182 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
183 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
184 sprintf(prodpath,
185 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
186 "Installer\\%s\\Installer\\Products\\"
187 "7D2F387510109040002000060BECB6AB", usersid);
189 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
191 prod = "7D2F387510109040002000060BECB6AB";
192 sprintf(comppath,
193 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
194 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
195 sprintf(prodpath,
196 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
197 "Installer\\Managed\\%s\\Installer\\Products\\"
198 "7D2F387510109040002000060BECB6AB", usersid);
201 RegCreateKeyA(HKEY_LOCAL_MACHINE, comppath, &hkey);
203 lstrcpyA(path, CURR_DIR);
204 lstrcatA(path, "\\");
205 if (!dir) lstrcatA(path, filename);
207 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
208 RegCloseKey(hkey);
210 RegCreateKeyA(HKEY_LOCAL_MACHINE, prodpath, &hkey);
211 RegCloseKey(hkey);
214 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
216 WCHAR guidW[MAX_PATH];
217 WCHAR squashedW[MAX_PATH];
218 WCHAR substrW[MAX_PATH];
219 CHAR squashed[MAX_PATH];
220 CHAR comppath[MAX_PATH];
221 CHAR prodpath[MAX_PATH];
223 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
224 squash_guid(guidW, squashedW);
225 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
227 if (context == MSIINSTALLCONTEXT_MACHINE)
229 sprintf(comppath,
230 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
231 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
232 lstrcpyA(prodpath,
233 "SOFTWARE\\Classes\\Installer\\"
234 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
236 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
238 sprintf(comppath,
239 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
240 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
241 sprintf(prodpath,
242 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
243 "Installer\\%s\\Installer\\Products\\"
244 "7D2F387510109040002000060BECB6AB", usersid);
246 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
248 sprintf(comppath,
249 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
250 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
251 sprintf(prodpath,
252 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
253 "Installer\\Managed\\%s\\Installer\\Products\\"
254 "7D2F387510109040002000060BECB6AB", usersid);
257 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
258 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
260 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
261 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
264 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
266 MSIHANDLE hview = 0;
267 UINT r, ret;
269 /* open a select query */
270 r = MsiDatabaseOpenView(hdb, query, &hview);
271 if (r != ERROR_SUCCESS)
272 return r;
273 r = MsiViewExecute(hview, 0);
274 if (r != ERROR_SUCCESS)
275 return r;
276 ret = MsiViewFetch(hview, phrec);
277 r = MsiViewClose(hview);
278 if (r != ERROR_SUCCESS)
279 return r;
280 r = MsiCloseHandle(hview);
281 if (r != ERROR_SUCCESS)
282 return r;
283 return ret;
286 static UINT run_query( MSIHANDLE hdb, const char *query )
288 MSIHANDLE hview = 0;
289 UINT r;
291 r = MsiDatabaseOpenView(hdb, query, &hview);
292 if( r != ERROR_SUCCESS )
293 return r;
295 r = MsiViewExecute(hview, 0);
296 if( r == ERROR_SUCCESS )
297 r = MsiViewClose(hview);
298 MsiCloseHandle(hview);
299 return r;
302 static UINT create_component_table( MSIHANDLE hdb )
304 return run_query( hdb,
305 "CREATE TABLE `Component` ( "
306 "`Component` CHAR(72) NOT NULL, "
307 "`ComponentId` CHAR(38), "
308 "`Directory_` CHAR(72) NOT NULL, "
309 "`Attributes` SHORT NOT NULL, "
310 "`Condition` CHAR(255), "
311 "`KeyPath` CHAR(72) "
312 "PRIMARY KEY `Component`)" );
315 static UINT create_feature_table( MSIHANDLE hdb )
317 return run_query( hdb,
318 "CREATE TABLE `Feature` ( "
319 "`Feature` CHAR(38) NOT NULL, "
320 "`Feature_Parent` CHAR(38), "
321 "`Title` CHAR(64), "
322 "`Description` CHAR(255), "
323 "`Display` SHORT NOT NULL, "
324 "`Level` SHORT NOT NULL, "
325 "`Directory_` CHAR(72), "
326 "`Attributes` SHORT NOT NULL "
327 "PRIMARY KEY `Feature`)" );
330 static UINT create_feature_components_table( MSIHANDLE hdb )
332 return run_query( hdb,
333 "CREATE TABLE `FeatureComponents` ( "
334 "`Feature_` CHAR(38) NOT NULL, "
335 "`Component_` CHAR(72) NOT NULL "
336 "PRIMARY KEY `Feature_`, `Component_` )" );
339 static UINT create_file_table( MSIHANDLE hdb )
341 return run_query( hdb,
342 "CREATE TABLE `File` ("
343 "`File` CHAR(72) NOT NULL, "
344 "`Component_` CHAR(72) NOT NULL, "
345 "`FileName` CHAR(255) NOT NULL, "
346 "`FileSize` LONG NOT NULL, "
347 "`Version` CHAR(72), "
348 "`Language` CHAR(20), "
349 "`Attributes` SHORT, "
350 "`Sequence` SHORT NOT NULL "
351 "PRIMARY KEY `File`)" );
354 static UINT create_remove_file_table( MSIHANDLE hdb )
356 return run_query( hdb,
357 "CREATE TABLE `RemoveFile` ("
358 "`FileKey` CHAR(72) NOT NULL, "
359 "`Component_` CHAR(72) NOT NULL, "
360 "`FileName` CHAR(255) LOCALIZABLE, "
361 "`DirProperty` CHAR(72) NOT NULL, "
362 "`InstallMode` SHORT NOT NULL "
363 "PRIMARY KEY `FileKey`)" );
366 static UINT create_appsearch_table( MSIHANDLE hdb )
368 return run_query( hdb,
369 "CREATE TABLE `AppSearch` ("
370 "`Property` CHAR(72) NOT NULL, "
371 "`Signature_` CHAR(72) NOT NULL "
372 "PRIMARY KEY `Property`, `Signature_`)" );
375 static UINT create_reglocator_table( MSIHANDLE hdb )
377 return run_query( hdb,
378 "CREATE TABLE `RegLocator` ("
379 "`Signature_` CHAR(72) NOT NULL, "
380 "`Root` SHORT NOT NULL, "
381 "`Key` CHAR(255) NOT NULL, "
382 "`Name` CHAR(255), "
383 "`Type` SHORT "
384 "PRIMARY KEY `Signature_`)" );
387 static UINT create_signature_table( MSIHANDLE hdb )
389 return run_query( hdb,
390 "CREATE TABLE `Signature` ("
391 "`Signature` CHAR(72) NOT NULL, "
392 "`FileName` CHAR(255) NOT NULL, "
393 "`MinVersion` CHAR(20), "
394 "`MaxVersion` CHAR(20), "
395 "`MinSize` LONG, "
396 "`MaxSize` LONG, "
397 "`MinDate` LONG, "
398 "`MaxDate` LONG, "
399 "`Languages` CHAR(255) "
400 "PRIMARY KEY `Signature`)" );
403 static UINT create_launchcondition_table( MSIHANDLE hdb )
405 return run_query( hdb,
406 "CREATE TABLE `LaunchCondition` ("
407 "`Condition` CHAR(255) NOT NULL, "
408 "`Description` CHAR(255) NOT NULL "
409 "PRIMARY KEY `Condition`)" );
412 static UINT create_property_table( MSIHANDLE hdb )
414 return run_query( hdb,
415 "CREATE TABLE `Property` ("
416 "`Property` CHAR(72) NOT NULL, "
417 "`Value` CHAR(0) "
418 "PRIMARY KEY `Property`)" );
421 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
423 return run_query( hdb,
424 "CREATE TABLE `InstallExecuteSequence` ("
425 "`Action` CHAR(72) NOT NULL, "
426 "`Condition` CHAR(255), "
427 "`Sequence` SHORT "
428 "PRIMARY KEY `Action`)" );
431 static UINT create_media_table( MSIHANDLE hdb )
433 return run_query( hdb,
434 "CREATE TABLE `Media` ("
435 "`DiskId` SHORT NOT NULL, "
436 "`LastSequence` SHORT NOT NULL, "
437 "`DiskPrompt` CHAR(64), "
438 "`Cabinet` CHAR(255), "
439 "`VolumeLabel` CHAR(32), "
440 "`Source` CHAR(72) "
441 "PRIMARY KEY `DiskId`)" );
444 static UINT create_ccpsearch_table( MSIHANDLE hdb )
446 return run_query( hdb,
447 "CREATE TABLE `CCPSearch` ("
448 "`Signature_` CHAR(72) NOT NULL "
449 "PRIMARY KEY `Signature_`)" );
452 static UINT create_drlocator_table( MSIHANDLE hdb )
454 return run_query( hdb,
455 "CREATE TABLE `DrLocator` ("
456 "`Signature_` CHAR(72) NOT NULL, "
457 "`Parent` CHAR(72), "
458 "`Path` CHAR(255), "
459 "`Depth` SHORT "
460 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
463 static UINT create_complocator_table( MSIHANDLE hdb )
465 return run_query( hdb,
466 "CREATE TABLE `CompLocator` ("
467 "`Signature_` CHAR(72) NOT NULL, "
468 "`ComponentId` CHAR(38) NOT NULL, "
469 "`Type` SHORT "
470 "PRIMARY KEY `Signature_`)" );
473 static UINT create_inilocator_table( MSIHANDLE hdb )
475 return run_query( hdb,
476 "CREATE TABLE `IniLocator` ("
477 "`Signature_` CHAR(72) NOT NULL, "
478 "`FileName` CHAR(255) NOT NULL, "
479 "`Section` CHAR(96)NOT NULL, "
480 "`Key` CHAR(128)NOT NULL, "
481 "`Field` SHORT, "
482 "`Type` SHORT "
483 "PRIMARY KEY `Signature_`)" );
486 #define make_add_entry(type, qtext) \
487 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
489 char insert[] = qtext; \
490 char *query; \
491 UINT sz, r; \
492 sz = strlen(values) + sizeof insert; \
493 query = HeapAlloc(GetProcessHeap(),0,sz); \
494 sprintf(query,insert,values); \
495 r = run_query( hdb, query ); \
496 HeapFree(GetProcessHeap(), 0, query); \
497 return r; \
500 make_add_entry(component,
501 "INSERT INTO `Component` "
502 "(`Component`, `ComponentId`, `Directory_`, "
503 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
505 make_add_entry(directory,
506 "INSERT INTO `Directory` "
507 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
509 make_add_entry(feature,
510 "INSERT INTO `Feature` "
511 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
512 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
514 make_add_entry(feature_components,
515 "INSERT INTO `FeatureComponents` "
516 "(`Feature_`, `Component_`) VALUES( %s )")
518 make_add_entry(file,
519 "INSERT INTO `File` "
520 "(`File`, `Component_`, `FileName`, `FileSize`, "
521 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
523 make_add_entry(appsearch,
524 "INSERT INTO `AppSearch` "
525 "(`Property`, `Signature_`) VALUES( %s )")
527 make_add_entry(reglocator,
528 "INSERT INTO `RegLocator` "
529 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
531 make_add_entry(signature,
532 "INSERT INTO `Signature` "
533 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
534 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
535 "VALUES( %s )")
537 make_add_entry(launchcondition,
538 "INSERT INTO `LaunchCondition` "
539 "(`Condition`, `Description`) VALUES( %s )")
541 make_add_entry(property,
542 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
544 make_add_entry(install_execute_sequence,
545 "INSERT INTO `InstallExecuteSequence` "
546 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
548 make_add_entry(media,
549 "INSERT INTO `Media` "
550 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
551 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
553 make_add_entry(ccpsearch,
554 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
556 make_add_entry(drlocator,
557 "INSERT INTO `DrLocator` "
558 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
560 make_add_entry(complocator,
561 "INSERT INTO `CompLocator` "
562 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
564 make_add_entry(inilocator,
565 "INSERT INTO `IniLocator` "
566 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
567 "VALUES( %s )")
569 static UINT set_summary_info(MSIHANDLE hdb)
571 UINT res;
572 MSIHANDLE suminfo;
574 /* build summary info */
575 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
576 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
578 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
579 "Installation Database");
580 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
582 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
583 "Installation Database");
584 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
586 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
587 "Wine Hackers");
588 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
590 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
591 ";1033");
592 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
594 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
595 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
596 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
598 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
599 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
601 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
602 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
604 res = MsiSummaryInfoPersist(suminfo);
605 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
607 res = MsiCloseHandle( suminfo);
608 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
610 return res;
614 static MSIHANDLE create_package_db(void)
616 MSIHANDLE hdb = 0;
617 UINT res;
619 DeleteFile(msifile);
621 /* create an empty database */
622 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
623 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
624 if( res != ERROR_SUCCESS )
625 return hdb;
627 res = MsiDatabaseCommit( hdb );
628 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
630 res = set_summary_info(hdb);
632 res = run_query( hdb,
633 "CREATE TABLE `Directory` ( "
634 "`Directory` CHAR(255) NOT NULL, "
635 "`Directory_Parent` CHAR(255), "
636 "`DefaultDir` CHAR(255) NOT NULL "
637 "PRIMARY KEY `Directory`)" );
638 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
640 return hdb;
643 static MSIHANDLE package_from_db(MSIHANDLE hdb)
645 UINT res;
646 CHAR szPackage[10];
647 MSIHANDLE hPackage;
649 sprintf(szPackage,"#%li",hdb);
650 res = MsiOpenPackage(szPackage,&hPackage);
651 if (res != ERROR_SUCCESS)
652 return 0;
654 res = MsiCloseHandle(hdb);
655 if (res != ERROR_SUCCESS)
656 return 0;
658 return hPackage;
661 static void create_test_file(const CHAR *name)
663 HANDLE file;
664 DWORD written;
666 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
667 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
668 WriteFile(file, name, strlen(name), &written, NULL);
669 WriteFile(file, "\n", strlen("\n"), &written, NULL);
670 CloseHandle(file);
673 typedef struct _tagVS_VERSIONINFO
675 WORD wLength;
676 WORD wValueLength;
677 WORD wType;
678 WCHAR szKey[1];
679 WORD wPadding1[1];
680 VS_FIXEDFILEINFO Value;
681 WORD wPadding2[1];
682 WORD wChildren[1];
683 } VS_VERSIONINFO;
685 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
686 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
688 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
690 VS_VERSIONINFO *pVerInfo;
691 VS_FIXEDFILEINFO *pFixedInfo;
692 LPBYTE buffer, ofs;
693 CHAR path[MAX_PATH];
694 DWORD handle, size;
695 HANDLE resource;
696 BOOL ret = FALSE;
698 GetSystemDirectory(path, MAX_PATH);
699 lstrcatA(path, "\\kernel32.dll");
701 CopyFileA(path, name, FALSE);
703 size = GetFileVersionInfoSize(path, &handle);
704 buffer = HeapAlloc(GetProcessHeap(), 0, size);
706 GetFileVersionInfoA(path, 0, size, buffer);
708 pVerInfo = (VS_VERSIONINFO *)buffer;
709 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
710 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
712 pFixedInfo->dwFileVersionMS = ms;
713 pFixedInfo->dwFileVersionLS = ls;
714 pFixedInfo->dwProductVersionMS = ms;
715 pFixedInfo->dwProductVersionLS = ls;
717 resource = BeginUpdateResource(name, FALSE);
718 if (!resource)
719 goto done;
721 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
722 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
723 goto done;
725 if (!EndUpdateResource(resource, FALSE))
726 goto done;
728 ret = TRUE;
730 done:
731 HeapFree(GetProcessHeap(), 0, buffer);
732 return ret;
735 static void test_createpackage(void)
737 MSIHANDLE hPackage = 0;
738 UINT res;
740 hPackage = package_from_db(create_package_db());
741 ok( hPackage != 0, " Failed to create package\n");
743 res = MsiCloseHandle( hPackage);
744 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
745 DeleteFile(msifile);
748 static void test_doaction( void )
750 MSIHANDLE hpkg;
751 UINT r;
753 r = MsiDoAction( -1, NULL );
754 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
756 hpkg = package_from_db(create_package_db());
757 ok( hpkg, "failed to create package\n");
759 r = MsiDoAction(hpkg, NULL);
760 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
762 r = MsiDoAction(0, "boo");
763 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
765 r = MsiDoAction(hpkg, "boo");
766 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
768 MsiCloseHandle( hpkg );
769 DeleteFile(msifile);
772 static void test_gettargetpath_bad(void)
774 char buffer[0x80];
775 MSIHANDLE hpkg;
776 DWORD sz;
777 UINT r;
779 hpkg = package_from_db(create_package_db());
780 ok( hpkg, "failed to create package\n");
782 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
783 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
785 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
786 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
788 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
789 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
791 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
792 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
794 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
795 ok( r == ERROR_DIRECTORY, "wrong return val\n");
797 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
798 ok( r == ERROR_DIRECTORY, "wrong return val\n");
800 MsiCloseHandle( hpkg );
801 DeleteFile(msifile);
804 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
806 UINT r;
807 DWORD size;
808 MSIHANDLE rec;
810 rec = MsiCreateRecord( 1 );
811 ok(rec, "MsiCreate record failed\n");
813 r = MsiRecordSetString( rec, 0, file );
814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
816 size = MAX_PATH;
817 r = MsiFormatRecord( hpkg, rec, buff, &size );
818 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
820 MsiCloseHandle( rec );
823 static void test_settargetpath(void)
825 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
826 DWORD sz;
827 MSIHANDLE hpkg;
828 UINT r;
829 MSIHANDLE hdb;
831 hdb = create_package_db();
832 ok ( hdb, "failed to create package database\n" );
834 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
835 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
837 r = create_component_table( hdb );
838 ok( r == S_OK, "cannot create Component table: %d\n", r );
840 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
841 ok( r == S_OK, "cannot add dummy component: %d\n", r );
843 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
844 ok( r == S_OK, "cannot add test component: %d\n", r );
846 r = create_feature_table( hdb );
847 ok( r == S_OK, "cannot create Feature table: %d\n", r );
849 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
850 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
852 r = create_feature_components_table( hdb );
853 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
855 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
856 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
858 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
859 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
861 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
862 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
864 r = create_file_table( hdb );
865 ok( r == S_OK, "cannot create File table: %d\n", r );
867 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
868 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
870 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
871 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
873 hpkg = package_from_db( hdb );
874 ok( hpkg, "failed to create package\n");
876 r = MsiDoAction( hpkg, "CostInitialize");
877 ok( r == ERROR_SUCCESS, "cost init failed\n");
879 r = MsiDoAction( hpkg, "FileCost");
880 ok( r == ERROR_SUCCESS, "file cost failed\n");
882 r = MsiDoAction( hpkg, "CostFinalize");
883 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
885 r = MsiSetTargetPath( 0, NULL, NULL );
886 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
888 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
889 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
891 r = MsiSetTargetPath( hpkg, "boo", NULL );
892 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
894 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
895 ok( r == ERROR_DIRECTORY, "wrong return val\n");
897 sz = sizeof tempdir - 1;
898 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
899 sprintf( file, "%srootfile.txt", tempdir );
900 query_file_path( hpkg, "[#RootFile]", buffer );
901 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
902 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
904 GetTempFileName( tempdir, "_wt", 0, buffer );
905 sprintf( tempdir, "%s\\subdir", buffer );
907 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
908 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
909 "MsiSetTargetPath on file returned %d\n", r );
911 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
912 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
913 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
915 DeleteFile( buffer );
917 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
918 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
920 r = GetFileAttributes( buffer );
921 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
923 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
924 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
926 sz = sizeof buffer - 1;
927 lstrcat( tempdir, "\\" );
928 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
929 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
930 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
932 sprintf( file, "%srootfile.txt", tempdir );
933 query_file_path( hpkg, "[#RootFile]", buffer );
934 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
936 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
937 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
939 query_file_path( hpkg, "[#TestFile]", buffer );
940 ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
941 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
943 sz = sizeof buffer - 1;
944 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
945 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
946 ok( !lstrcmp(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
948 MsiCloseHandle( hpkg );
951 static void test_condition(void)
953 MSICONDITION r;
954 MSIHANDLE hpkg;
956 hpkg = package_from_db(create_package_db());
957 ok( hpkg, "failed to create package\n");
959 r = MsiEvaluateCondition(0, NULL);
960 ok( r == MSICONDITION_ERROR, "wrong return val\n");
962 r = MsiEvaluateCondition(hpkg, NULL);
963 ok( r == MSICONDITION_NONE, "wrong return val\n");
965 r = MsiEvaluateCondition(hpkg, "");
966 ok( r == MSICONDITION_NONE, "wrong return val\n");
968 r = MsiEvaluateCondition(hpkg, "1");
969 ok( r == MSICONDITION_TRUE, "wrong return val\n");
971 r = MsiEvaluateCondition(hpkg, "0");
972 ok( r == MSICONDITION_FALSE, "wrong return val\n");
974 r = MsiEvaluateCondition(hpkg, "-1");
975 ok( r == MSICONDITION_TRUE, "wrong return val\n");
977 r = MsiEvaluateCondition(hpkg, "0 = 0");
978 ok( r == MSICONDITION_TRUE, "wrong return val\n");
980 r = MsiEvaluateCondition(hpkg, "0 <> 0");
981 ok( r == MSICONDITION_FALSE, "wrong return val\n");
983 r = MsiEvaluateCondition(hpkg, "0 = 1");
984 ok( r == MSICONDITION_FALSE, "wrong return val\n");
986 r = MsiEvaluateCondition(hpkg, "0 > 1");
987 ok( r == MSICONDITION_FALSE, "wrong return val\n");
989 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
990 ok( r == MSICONDITION_FALSE, "wrong return val\n");
992 r = MsiEvaluateCondition(hpkg, "1 > 1");
993 ok( r == MSICONDITION_FALSE, "wrong return val\n");
995 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
996 ok( r == MSICONDITION_FALSE, "wrong return val\n");
998 r = MsiEvaluateCondition(hpkg, "0 >= 1");
999 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1001 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1002 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1004 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1005 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1007 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1008 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1010 r = MsiEvaluateCondition(hpkg, "0 < 1");
1011 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1013 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1014 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1016 r = MsiEvaluateCondition(hpkg, "1 < 1");
1017 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1019 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1020 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1022 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1023 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1025 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1026 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1028 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1029 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1031 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1032 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1034 r = MsiEvaluateCondition(hpkg, "0 >=");
1035 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1037 r = MsiEvaluateCondition(hpkg, " ");
1038 ok( r == MSICONDITION_NONE, "wrong return val\n");
1040 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1041 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1043 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1044 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1046 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1047 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1049 r = MsiEvaluateCondition(hpkg, "not 0");
1050 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1052 r = MsiEvaluateCondition(hpkg, "not LicView");
1053 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1055 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1056 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1058 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1059 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1061 r = MsiEvaluateCondition(hpkg, "\"0\"");
1062 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1064 r = MsiEvaluateCondition(hpkg, "1 and 2");
1065 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1067 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1068 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1070 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1071 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1073 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1074 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1076 r = MsiEvaluateCondition(hpkg, "(0)");
1077 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1079 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1080 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1082 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1083 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1085 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1086 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1088 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1089 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1091 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1092 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1094 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1095 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1097 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1098 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1100 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1101 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1103 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1104 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1106 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1107 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1109 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1110 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1112 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1113 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1115 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1116 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1118 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1119 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1121 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1122 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1124 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1125 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1127 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1128 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1130 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1131 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1133 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1134 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1136 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1137 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1139 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1140 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1142 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1143 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1145 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1146 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1148 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1149 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1151 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1152 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1154 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1155 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1157 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1158 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1160 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1161 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1163 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1164 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1166 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1167 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1169 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1170 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1172 MsiSetProperty(hpkg, "mm", "5" );
1174 r = MsiEvaluateCondition(hpkg, "mm = 5");
1175 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "mm < 6");
1178 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1180 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1181 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1183 r = MsiEvaluateCondition(hpkg, "mm > 4");
1184 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1186 r = MsiEvaluateCondition(hpkg, "mm < 12");
1187 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1189 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1190 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1192 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1193 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1195 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1196 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1198 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1199 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1201 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1202 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1204 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1205 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1207 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1208 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1210 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1211 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1213 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1214 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1216 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1217 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1219 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1220 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1222 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1223 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1225 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1226 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1228 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1229 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1231 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1232 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1234 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1235 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1237 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1238 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1240 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1241 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1243 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1244 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1246 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1247 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1249 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1250 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1252 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1253 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1255 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1256 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1258 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1259 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1261 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1262 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1264 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1265 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1267 MsiSetProperty(hpkg, "bandalmael", "0" );
1268 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1269 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1271 MsiSetProperty(hpkg, "bandalmael", "" );
1272 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1273 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1275 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1276 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1277 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1279 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1280 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1281 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1283 MsiSetProperty(hpkg, "bandalmael", "0 " );
1284 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1285 ok( r == MSICONDITION_FALSE, "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", "0000000000000" );
1292 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1293 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1295 MsiSetProperty(hpkg, "bandalmael", "--0" );
1296 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1297 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1299 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1300 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1301 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1303 MsiSetProperty(hpkg, "bandalmael", "-" );
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_FALSE, "wrong return val\n");
1311 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1312 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1313 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1314 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1315 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1317 MsiSetProperty(hpkg, "one", "hi");
1318 MsiSetProperty(hpkg, "two", "hithere");
1319 r = MsiEvaluateCondition(hpkg, "one >< two");
1320 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1322 MsiSetProperty(hpkg, "one", "hithere");
1323 MsiSetProperty(hpkg, "two", "hi");
1324 r = MsiEvaluateCondition(hpkg, "one >< two");
1325 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1327 MsiSetProperty(hpkg, "one", "hello");
1328 MsiSetProperty(hpkg, "two", "hi");
1329 r = MsiEvaluateCondition(hpkg, "one >< two");
1330 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1332 MsiSetProperty(hpkg, "one", "hellohithere");
1333 MsiSetProperty(hpkg, "two", "hi");
1334 r = MsiEvaluateCondition(hpkg, "one >< two");
1335 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1337 MsiSetProperty(hpkg, "one", "");
1338 MsiSetProperty(hpkg, "two", "hi");
1339 r = MsiEvaluateCondition(hpkg, "one >< two");
1340 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1342 MsiSetProperty(hpkg, "one", "hi");
1343 MsiSetProperty(hpkg, "two", "");
1344 r = MsiEvaluateCondition(hpkg, "one >< two");
1345 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1347 MsiSetProperty(hpkg, "one", "");
1348 MsiSetProperty(hpkg, "two", "");
1349 r = MsiEvaluateCondition(hpkg, "one >< two");
1350 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1352 MsiSetProperty(hpkg, "one", "1234");
1353 MsiSetProperty(hpkg, "two", "1");
1354 r = MsiEvaluateCondition(hpkg, "one >< two");
1355 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1357 MsiSetProperty(hpkg, "one", "one 1234");
1358 MsiSetProperty(hpkg, "two", "1");
1359 r = MsiEvaluateCondition(hpkg, "one >< two");
1360 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1362 MsiSetProperty(hpkg, "one", "hithere");
1363 MsiSetProperty(hpkg, "two", "hi");
1364 r = MsiEvaluateCondition(hpkg, "one << two");
1365 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1367 MsiSetProperty(hpkg, "one", "hi");
1368 MsiSetProperty(hpkg, "two", "hithere");
1369 r = MsiEvaluateCondition(hpkg, "one << two");
1370 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1372 MsiSetProperty(hpkg, "one", "hi");
1373 MsiSetProperty(hpkg, "two", "hi");
1374 r = MsiEvaluateCondition(hpkg, "one << two");
1375 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1377 MsiSetProperty(hpkg, "one", "abcdhithere");
1378 MsiSetProperty(hpkg, "two", "hi");
1379 r = MsiEvaluateCondition(hpkg, "one << two");
1380 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1382 MsiSetProperty(hpkg, "one", "");
1383 MsiSetProperty(hpkg, "two", "hi");
1384 r = MsiEvaluateCondition(hpkg, "one << two");
1385 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1387 MsiSetProperty(hpkg, "one", "hithere");
1388 MsiSetProperty(hpkg, "two", "");
1389 r = MsiEvaluateCondition(hpkg, "one << two");
1390 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1392 MsiSetProperty(hpkg, "one", "");
1393 MsiSetProperty(hpkg, "two", "");
1394 r = MsiEvaluateCondition(hpkg, "one << two");
1395 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1397 MsiSetProperty(hpkg, "one", "1234");
1398 MsiSetProperty(hpkg, "two", "1");
1399 r = MsiEvaluateCondition(hpkg, "one << two");
1400 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1402 MsiSetProperty(hpkg, "one", "1234 one");
1403 MsiSetProperty(hpkg, "two", "1");
1404 r = MsiEvaluateCondition(hpkg, "one << two");
1405 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1407 MsiSetProperty(hpkg, "one", "hithere");
1408 MsiSetProperty(hpkg, "two", "there");
1409 r = MsiEvaluateCondition(hpkg, "one >> two");
1410 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1412 MsiSetProperty(hpkg, "one", "hithere");
1413 MsiSetProperty(hpkg, "two", "hi");
1414 r = MsiEvaluateCondition(hpkg, "one >> two");
1415 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1417 MsiSetProperty(hpkg, "one", "there");
1418 MsiSetProperty(hpkg, "two", "hithere");
1419 r = MsiEvaluateCondition(hpkg, "one >> two");
1420 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1422 MsiSetProperty(hpkg, "one", "there");
1423 MsiSetProperty(hpkg, "two", "there");
1424 r = MsiEvaluateCondition(hpkg, "one >> two");
1425 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1427 MsiSetProperty(hpkg, "one", "abcdhithere");
1428 MsiSetProperty(hpkg, "two", "hi");
1429 r = MsiEvaluateCondition(hpkg, "one >> two");
1430 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1432 MsiSetProperty(hpkg, "one", "");
1433 MsiSetProperty(hpkg, "two", "there");
1434 r = MsiEvaluateCondition(hpkg, "one >> two");
1435 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1437 MsiSetProperty(hpkg, "one", "there");
1438 MsiSetProperty(hpkg, "two", "");
1439 r = MsiEvaluateCondition(hpkg, "one >> two");
1440 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1442 MsiSetProperty(hpkg, "one", "");
1443 MsiSetProperty(hpkg, "two", "");
1444 r = MsiEvaluateCondition(hpkg, "one >> two");
1445 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1447 MsiSetProperty(hpkg, "one", "1234");
1448 MsiSetProperty(hpkg, "two", "4");
1449 r = MsiEvaluateCondition(hpkg, "one >> two");
1450 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1452 MsiSetProperty(hpkg, "one", "one 1234");
1453 MsiSetProperty(hpkg, "two", "4");
1454 r = MsiEvaluateCondition(hpkg, "one >> two");
1455 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1457 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1459 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1460 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1462 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1463 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1465 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1466 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1468 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1469 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1471 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1472 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1474 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1475 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1477 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1478 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1480 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1481 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1483 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1484 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1486 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1487 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1489 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1490 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1492 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1493 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1495 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1496 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1498 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1499 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1501 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1502 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1504 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1505 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1507 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1508 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1510 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1511 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1513 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1514 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1516 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1517 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1519 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1520 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1522 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1523 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1525 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1526 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1528 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1529 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1531 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1532 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1534 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1535 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1537 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1538 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1540 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1541 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1543 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1544 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1546 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1547 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1549 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1550 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1552 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1553 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1555 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1556 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1558 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1559 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1561 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1562 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1564 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1565 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1567 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1568 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1570 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1571 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1572 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1574 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1575 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1577 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1578 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1580 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1581 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1583 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1584 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1586 MsiSetProperty(hpkg, "one", "1");
1587 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1588 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1590 MsiSetProperty(hpkg, "X", "5.0");
1592 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1593 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1595 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1596 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1598 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1599 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1601 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1602 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1604 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1605 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1607 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1608 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1610 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1611 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1613 /* feature doesn't exist */
1614 r = MsiEvaluateCondition(hpkg, "&nofeature");
1615 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1617 MsiSetProperty(hpkg, "A", "2");
1618 MsiSetProperty(hpkg, "X", "50");
1620 r = MsiEvaluateCondition(hpkg, "2 <= X");
1621 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1623 r = MsiEvaluateCondition(hpkg, "A <= X");
1624 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1626 r = MsiEvaluateCondition(hpkg, "A <= 50");
1627 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1629 MsiSetProperty(hpkg, "X", "50val");
1631 r = MsiEvaluateCondition(hpkg, "2 <= X");
1632 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1634 r = MsiEvaluateCondition(hpkg, "A <= X");
1635 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1637 MsiSetProperty(hpkg, "A", "7");
1638 MsiSetProperty(hpkg, "X", "50");
1640 r = MsiEvaluateCondition(hpkg, "7 <= 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_FALSE, "wrong return val (%d)\n", r);
1657 MsiCloseHandle( hpkg );
1658 DeleteFile(msifile);
1661 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1663 UINT r;
1664 DWORD sz;
1665 char buffer[2];
1667 sz = sizeof buffer;
1668 strcpy(buffer,"x");
1669 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1670 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1673 static void test_props(void)
1675 MSIHANDLE hpkg, hdb;
1676 UINT r;
1677 DWORD sz;
1678 char buffer[0x100];
1680 hdb = create_package_db();
1681 r = run_query( hdb,
1682 "CREATE TABLE `Property` ( "
1683 "`Property` CHAR(255) NOT NULL, "
1684 "`Value` CHAR(255) "
1685 "PRIMARY KEY `Property`)" );
1686 ok( r == ERROR_SUCCESS , "Failed\n" );
1688 r = run_query(hdb,
1689 "INSERT INTO `Property` "
1690 "(`Property`, `Value`) "
1691 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1692 ok( r == ERROR_SUCCESS , "Failed\n" );
1694 hpkg = package_from_db( hdb );
1695 ok( hpkg, "failed to create package\n");
1697 /* test invalid values */
1698 r = MsiGetProperty( 0, NULL, NULL, NULL );
1699 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1701 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1702 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1704 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1705 ok( r == ERROR_SUCCESS, "wrong return val\n");
1707 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1708 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1710 /* test retrieving an empty/nonexistent property */
1711 sz = sizeof buffer;
1712 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1713 ok( r == ERROR_SUCCESS, "wrong return val\n");
1714 ok( sz == 0, "wrong size returned\n");
1716 check_prop_empty( hpkg, "boo");
1717 sz = 0;
1718 strcpy(buffer,"x");
1719 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1720 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1721 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1722 ok( sz == 0, "wrong size returned\n");
1724 sz = 1;
1725 strcpy(buffer,"x");
1726 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1727 ok( r == ERROR_SUCCESS, "wrong return val\n");
1728 ok( buffer[0] == 0, "buffer was not changed\n");
1729 ok( sz == 0, "wrong size returned\n");
1731 /* set the property to something */
1732 r = MsiSetProperty( 0, NULL, NULL );
1733 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1735 r = MsiSetProperty( hpkg, NULL, NULL );
1736 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1738 r = MsiSetProperty( hpkg, "", NULL );
1739 ok( r == ERROR_SUCCESS, "wrong return val\n");
1741 /* try set and get some illegal property identifiers */
1742 r = MsiSetProperty( hpkg, "", "asdf" );
1743 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1745 r = MsiSetProperty( hpkg, "=", "asdf" );
1746 ok( r == ERROR_SUCCESS, "wrong return val\n");
1748 r = MsiSetProperty( hpkg, " ", "asdf" );
1749 ok( r == ERROR_SUCCESS, "wrong return val\n");
1751 r = MsiSetProperty( hpkg, "'", "asdf" );
1752 ok( r == ERROR_SUCCESS, "wrong return val\n");
1754 sz = sizeof buffer;
1755 buffer[0]=0;
1756 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1757 ok( r == ERROR_SUCCESS, "wrong return val\n");
1758 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1760 /* set empty values */
1761 r = MsiSetProperty( hpkg, "boo", NULL );
1762 ok( r == ERROR_SUCCESS, "wrong return val\n");
1763 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1765 r = MsiSetProperty( hpkg, "boo", "" );
1766 ok( r == ERROR_SUCCESS, "wrong return val\n");
1767 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1769 /* set a non-empty value */
1770 r = MsiSetProperty( hpkg, "boo", "xyz" );
1771 ok( r == ERROR_SUCCESS, "wrong return val\n");
1773 sz = 1;
1774 strcpy(buffer,"x");
1775 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1776 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1777 ok( buffer[0] == 0, "buffer was not changed\n");
1778 ok( sz == 3, "wrong size returned\n");
1780 sz = 4;
1781 strcpy(buffer,"x");
1782 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1783 ok( r == ERROR_SUCCESS, "wrong return val\n");
1784 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1785 ok( sz == 3, "wrong size returned\n");
1787 sz = 3;
1788 strcpy(buffer,"x");
1789 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1790 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1791 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1792 ok( sz == 3, "wrong size returned\n");
1794 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1795 ok( r == ERROR_SUCCESS, "wrong return val\n");
1797 sz = 4;
1798 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1799 ok( r == ERROR_SUCCESS, "wrong return val\n");
1800 ok( !strcmp(buffer,""), "buffer wrong\n");
1801 ok( sz == 0, "wrong size returned\n");
1803 sz = 4;
1804 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1805 ok( r == ERROR_SUCCESS, "wrong return val\n");
1806 ok( !strcmp(buffer,""), "buffer wrong\n");
1807 ok( sz == 0, "wrong size returned\n");
1809 sz = 4;
1810 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1811 ok( r == ERROR_SUCCESS, "wrong return val\n");
1812 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1813 ok( sz == 3, "wrong size returned\n");
1815 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1816 ok( r == ERROR_SUCCESS, "wrong return val\n");
1818 sz = 0;
1819 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1820 ok( r == ERROR_SUCCESS, "return wrong\n");
1821 ok( sz == 13, "size wrong (%d)\n", sz);
1823 sz = 13;
1824 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1825 ok( r == ERROR_MORE_DATA, "return wrong\n");
1826 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1828 r = MsiSetProperty(hpkg, "property", "value");
1829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1831 sz = 6;
1832 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1833 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1834 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1836 r = MsiSetProperty(hpkg, "property", NULL);
1837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1839 sz = 6;
1840 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1842 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1844 MsiCloseHandle( hpkg );
1845 DeleteFile(msifile);
1848 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1850 MSIHANDLE hview, hrec;
1851 BOOL found;
1852 CHAR buffer[MAX_PATH];
1853 DWORD sz;
1854 UINT r;
1856 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1857 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1858 r = MsiViewExecute(hview, 0);
1859 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1861 found = FALSE;
1862 while (r == ERROR_SUCCESS && !found)
1864 r = MsiViewFetch(hview, &hrec);
1865 if (r != ERROR_SUCCESS) break;
1867 sz = MAX_PATH;
1868 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1869 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1871 sz = MAX_PATH;
1872 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1873 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1874 found = TRUE;
1877 MsiCloseHandle(hrec);
1880 MsiViewClose(hview);
1881 MsiCloseHandle(hview);
1883 return found;
1886 static void test_property_table(void)
1888 const char *query;
1889 UINT r;
1890 MSIHANDLE hpkg, hdb, hrec;
1891 char buffer[MAX_PATH];
1892 DWORD sz;
1893 BOOL found;
1895 hdb = create_package_db();
1896 ok( hdb, "failed to create package\n");
1898 hpkg = package_from_db(hdb);
1899 ok( hpkg, "failed to create package\n");
1901 MsiCloseHandle(hdb);
1903 hdb = MsiGetActiveDatabase(hpkg);
1905 query = "CREATE TABLE `_Property` ( "
1906 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1907 r = run_query(hdb, query);
1908 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1910 MsiCloseHandle(hdb);
1911 MsiCloseHandle(hpkg);
1912 DeleteFile(msifile);
1914 hdb = create_package_db();
1915 ok( hdb, "failed to create package\n");
1917 query = "CREATE TABLE `_Property` ( "
1918 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1919 r = run_query(hdb, query);
1920 ok(r == ERROR_SUCCESS, "failed to create table\n");
1922 query = "ALTER `_Property` ADD `foo` INTEGER";
1923 r = run_query(hdb, query);
1924 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1926 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1927 r = run_query(hdb, query);
1928 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1930 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1931 r = run_query(hdb, query);
1932 ok(r == ERROR_SUCCESS, "failed to add column\n");
1934 hpkg = package_from_db(hdb);
1935 todo_wine
1937 ok(!hpkg, "package should not be created\n");
1940 MsiCloseHandle(hdb);
1941 MsiCloseHandle(hpkg);
1942 DeleteFile(msifile);
1944 hdb = create_package_db();
1945 ok (hdb, "failed to create package database\n");
1947 r = create_property_table(hdb);
1948 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
1950 r = add_property_entry(hdb, "'prop', 'val'");
1951 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1953 hpkg = package_from_db(hdb);
1954 ok(hpkg, "failed to create package\n");
1956 MsiCloseHandle(hdb);
1958 sz = MAX_PATH;
1959 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
1960 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1961 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
1963 hdb = MsiGetActiveDatabase(hpkg);
1965 found = find_prop_in_property(hdb, "prop", "val");
1966 ok(found, "prop should be in the _Property table\n");
1968 r = add_property_entry(hdb, "'dantes', 'mercedes'");
1969 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1971 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1972 r = do_query(hdb, query, &hrec);
1973 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1975 found = find_prop_in_property(hdb, "dantes", "mercedes");
1976 ok(found == FALSE, "dantes should not be in the _Property table\n");
1978 sz = MAX_PATH;
1979 lstrcpy(buffer, "aaa");
1980 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
1981 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1982 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
1984 r = MsiSetProperty(hpkg, "dantes", "mercedes");
1985 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1987 found = find_prop_in_property(hdb, "dantes", "mercedes");
1988 ok(found == TRUE, "dantes should be in the _Property table\n");
1990 MsiCloseHandle(hdb);
1991 MsiCloseHandle(hpkg);
1992 DeleteFile(msifile);
1995 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
1997 MSIHANDLE htab = 0;
1998 UINT res;
2000 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2001 if( res == ERROR_SUCCESS )
2003 UINT r;
2005 r = MsiViewExecute( htab, hrec );
2006 if( r != ERROR_SUCCESS )
2008 res = r;
2009 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2012 r = MsiViewClose( htab );
2013 if( r != ERROR_SUCCESS )
2014 res = r;
2016 r = MsiCloseHandle( htab );
2017 if( r != ERROR_SUCCESS )
2018 res = r;
2020 return res;
2023 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2025 return try_query_param( hdb, szQuery, 0 );
2028 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2030 MSIHANDLE summary;
2031 UINT r;
2033 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2034 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2036 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2039 r = MsiSummaryInfoPersist(summary);
2040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2042 MsiCloseHandle(summary);
2045 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2047 MSIHANDLE summary;
2048 UINT r;
2050 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2053 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2056 r = MsiSummaryInfoPersist(summary);
2057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2059 MsiCloseHandle(summary);
2062 static void test_msipackage(void)
2064 MSIHANDLE hdb = 0, hpack = 100;
2065 UINT r;
2066 const char *query;
2067 char name[10];
2069 /* NULL szPackagePath */
2070 r = MsiOpenPackage(NULL, &hpack);
2071 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2073 /* empty szPackagePath */
2074 r = MsiOpenPackage("", &hpack);
2075 todo_wine
2077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2080 if (r == ERROR_SUCCESS)
2081 MsiCloseHandle(hpack);
2083 /* nonexistent szPackagePath */
2084 r = MsiOpenPackage("nonexistent", &hpack);
2085 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2087 /* NULL hProduct */
2088 r = MsiOpenPackage(msifile, NULL);
2089 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2091 name[0]='#';
2092 name[1]=0;
2093 r = MsiOpenPackage(name, &hpack);
2094 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2096 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2099 /* database exists, but is emtpy */
2100 sprintf(name, "#%ld", hdb);
2101 r = MsiOpenPackage(name, &hpack);
2102 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2103 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2105 query = "CREATE TABLE `Property` ( "
2106 "`Property` CHAR(72), `Value` CHAR(0) "
2107 "PRIMARY KEY `Property`)";
2108 r = try_query(hdb, query);
2109 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2111 query = "CREATE TABLE `InstallExecuteSequence` ("
2112 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2113 "PRIMARY KEY `Action`)";
2114 r = try_query(hdb, query);
2115 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2117 /* a few key tables exist */
2118 sprintf(name, "#%ld", hdb);
2119 r = MsiOpenPackage(name, &hpack);
2120 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2121 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2123 MsiCloseHandle(hdb);
2124 DeleteFile(msifile);
2126 /* start with a clean database to show what constitutes a valid package */
2127 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2128 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2130 sprintf(name, "#%ld", hdb);
2132 /* The following summary information props must exist:
2133 * - PID_REVNUMBER
2134 * - PID_PAGECOUNT
2137 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2138 r = MsiOpenPackage(name, &hpack);
2139 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2140 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2142 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2143 r = MsiOpenPackage(name, &hpack);
2144 ok(r == ERROR_SUCCESS,
2145 "Expected ERROR_SUCCESS, got %d\n", r);
2147 MsiCloseHandle(hpack);
2148 MsiCloseHandle(hdb);
2149 DeleteFile(msifile);
2152 static void test_formatrecord2(void)
2154 MSIHANDLE hpkg, hrec ;
2155 char buffer[0x100];
2156 DWORD sz;
2157 UINT r;
2159 hpkg = package_from_db(create_package_db());
2160 ok( hpkg, "failed to create package\n");
2162 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2163 ok( r == ERROR_SUCCESS, "set property failed\n");
2165 hrec = MsiCreateRecord(2);
2166 ok(hrec, "create record failed\n");
2168 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2169 ok( r == ERROR_SUCCESS, "format record failed\n");
2171 buffer[0] = 0;
2172 sz = sizeof buffer;
2173 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2175 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2176 r = MsiRecordSetString(hrec, 1, "hoo");
2177 sz = sizeof buffer;
2178 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2179 ok( sz == 3, "size wrong\n");
2180 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2181 ok( r == ERROR_SUCCESS, "format failed\n");
2183 r = MsiRecordSetString(hrec, 0, "x[~]x");
2184 sz = sizeof buffer;
2185 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2186 ok( sz == 3, "size wrong\n");
2187 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2188 ok( r == ERROR_SUCCESS, "format failed\n");
2190 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2191 r = MsiRecordSetString(hrec, 1, "hoo");
2192 sz = sizeof buffer;
2193 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2194 ok( sz == 3, "size wrong\n");
2195 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2196 ok( r == ERROR_SUCCESS, "format failed\n");
2198 r = MsiRecordSetString(hrec, 0, "[\\[]");
2199 sz = sizeof buffer;
2200 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2201 ok( sz == 1, "size wrong\n");
2202 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2203 ok( r == ERROR_SUCCESS, "format failed\n");
2205 SetEnvironmentVariable("FOO", "BAR");
2206 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2207 sz = sizeof buffer;
2208 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2209 ok( sz == 3, "size wrong\n");
2210 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2211 ok( r == ERROR_SUCCESS, "format failed\n");
2213 r = MsiRecordSetString(hrec, 0, "[[1]]");
2214 r = MsiRecordSetString(hrec, 1, "%FOO");
2215 sz = sizeof buffer;
2216 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2217 ok( sz == 3, "size wrong\n");
2218 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2219 ok( r == ERROR_SUCCESS, "format failed\n");
2221 MsiCloseHandle( hrec );
2222 MsiCloseHandle( hpkg );
2223 DeleteFile(msifile);
2226 static void test_states(void)
2228 MSIHANDLE hpkg;
2229 UINT r;
2230 MSIHANDLE hdb;
2231 INSTALLSTATE state, action;
2233 static const CHAR msifile2[] = "winetest2.msi";
2234 static const CHAR msifile3[] = "winetest3.msi";
2236 hdb = create_package_db();
2237 ok ( hdb, "failed to create package database\n" );
2239 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2240 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2242 r = create_property_table( hdb );
2243 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2245 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2246 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2248 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2249 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2251 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2252 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2254 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2255 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2257 r = create_install_execute_sequence_table( hdb );
2258 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2260 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2261 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2263 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2264 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2266 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2267 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2269 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2270 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2272 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2273 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2275 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2276 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2278 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2279 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2281 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2282 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2284 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2285 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2287 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2288 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2290 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2291 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2293 r = create_media_table( hdb );
2294 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2296 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2297 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2299 r = create_feature_table( hdb );
2300 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2302 r = create_component_table( hdb );
2303 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2305 /* msidbFeatureAttributesFavorLocal */
2306 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2307 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2309 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2310 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2311 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2313 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2314 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2315 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2317 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2318 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2319 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2321 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2322 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2323 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2325 /* msidbFeatureAttributesFavorSource */
2326 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2327 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2329 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2330 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2331 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2333 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2334 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2335 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2337 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2338 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2339 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2341 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2342 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2343 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2345 /* msidbFeatureAttributesFavorSource */
2346 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2347 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2349 /* msidbFeatureAttributesFavorLocal */
2350 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2351 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2353 /* disabled */
2354 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2355 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2357 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2358 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2359 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2361 /* no feature parent:msidbComponentAttributesLocalOnly */
2362 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2363 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2365 /* msidbFeatureAttributesFavorLocal:removed */
2366 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2367 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2369 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2370 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2371 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2373 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2374 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2375 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2377 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2378 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2379 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2381 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2382 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2383 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2385 /* msidbFeatureAttributesFavorSource:removed */
2386 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2387 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2389 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2390 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2391 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2393 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2394 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2395 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2397 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2398 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2399 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2401 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2402 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2403 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2405 r = create_feature_components_table( hdb );
2406 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2408 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2409 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2411 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2412 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2414 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2415 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2417 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2418 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2420 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2421 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2423 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2424 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2426 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2427 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2429 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2430 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2432 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2433 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2435 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2436 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2438 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2439 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2441 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2442 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2444 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2445 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2447 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2448 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2450 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2451 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2453 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2454 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2456 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2457 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2459 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2460 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2462 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2463 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2465 r = create_file_table( hdb );
2466 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2468 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2469 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2471 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2472 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2474 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2475 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2477 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2478 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2480 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2481 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2483 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2484 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2486 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2487 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2489 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2490 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2492 /* compressed file */
2493 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2494 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2496 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2497 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2499 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2500 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2502 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2503 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2505 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2506 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2508 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2509 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2511 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2512 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2514 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2515 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2517 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2518 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2520 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2521 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2523 MsiDatabaseCommit(hdb);
2525 /* these properties must not be in the saved msi file */
2526 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2527 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2529 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2530 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2532 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2533 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2535 hpkg = package_from_db( hdb );
2536 ok( hpkg, "failed to create package\n");
2538 MsiCloseHandle(hdb);
2540 CopyFileA(msifile, msifile2, FALSE);
2541 CopyFileA(msifile, msifile3, FALSE);
2543 state = 0xdeadbee;
2544 action = 0xdeadbee;
2545 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2546 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2547 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2548 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2550 state = 0xdeadbee;
2551 action = 0xdeadbee;
2552 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2553 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2554 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2555 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2557 state = 0xdeadbee;
2558 action = 0xdeadbee;
2559 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2560 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2561 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2562 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2564 state = 0xdeadbee;
2565 action = 0xdeadbee;
2566 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2567 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2568 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2569 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2571 state = 0xdeadbee;
2572 action = 0xdeadbee;
2573 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2574 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2575 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2576 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2578 state = 0xdeadbee;
2579 action = 0xdeadbee;
2580 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2581 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2582 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2583 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2585 state = 0xdeadbee;
2586 action = 0xdeadbee;
2587 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2588 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2589 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2590 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2592 state = 0xdeadbee;
2593 action = 0xdeadbee;
2594 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2595 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2596 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2597 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2599 state = 0xdeadbee;
2600 action = 0xdeadbee;
2601 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2602 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2603 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2604 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2606 state = 0xdeadbee;
2607 action = 0xdeadbee;
2608 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2609 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2610 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2611 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2613 state = 0xdeadbee;
2614 action = 0xdeadbee;
2615 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2616 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2617 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2618 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2620 state = 0xdeadbee;
2621 action = 0xdeadbee;
2622 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2623 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2624 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2625 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2627 state = 0xdeadbee;
2628 action = 0xdeadbee;
2629 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2630 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2631 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2632 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2634 state = 0xdeadbee;
2635 action = 0xdeadbee;
2636 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2637 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2638 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2639 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2641 state = 0xdeadbee;
2642 action = 0xdeadbee;
2643 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2644 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2645 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2646 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2648 state = 0xdeadbee;
2649 action = 0xdeadbee;
2650 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2651 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2652 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2653 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2655 state = 0xdeadbee;
2656 action = 0xdeadbee;
2657 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2658 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2659 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2660 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2662 state = 0xdeadbee;
2663 action = 0xdeadbee;
2664 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2665 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2666 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2667 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2669 state = 0xdeadbee;
2670 action = 0xdeadbee;
2671 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2672 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2673 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2674 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2676 state = 0xdeadbee;
2677 action = 0xdeadbee;
2678 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2679 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2680 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2681 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2683 state = 0xdeadbee;
2684 action = 0xdeadbee;
2685 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2686 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2687 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2688 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2690 state = 0xdeadbee;
2691 action = 0xdeadbee;
2692 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2693 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2694 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2695 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2697 state = 0xdeadbee;
2698 action = 0xdeadbee;
2699 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2700 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2701 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2702 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2704 state = 0xdeadbee;
2705 action = 0xdeadbee;
2706 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2707 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2708 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2709 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2711 state = 0xdeadbee;
2712 action = 0xdeadbee;
2713 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2714 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2715 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2716 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2718 r = MsiDoAction( hpkg, "CostInitialize");
2719 ok( r == ERROR_SUCCESS, "cost init failed\n");
2721 state = 0xdeadbee;
2722 action = 0xdeadbee;
2723 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2724 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2725 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2726 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2728 state = 0xdeadbee;
2729 action = 0xdeadbee;
2730 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2732 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2733 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2735 state = 0xdeadbee;
2736 action = 0xdeadbee;
2737 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2738 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2739 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2740 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2742 state = 0xdeadbee;
2743 action = 0xdeadbee;
2744 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2745 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2746 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2747 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2749 state = 0xdeadbee;
2750 action = 0xdeadbee;
2751 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2752 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2753 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2754 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2756 state = 0xdeadbee;
2757 action = 0xdeadbee;
2758 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2759 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2760 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2761 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2763 state = 0xdeadbee;
2764 action = 0xdeadbee;
2765 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2766 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2767 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2768 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2770 state = 0xdeadbee;
2771 action = 0xdeadbee;
2772 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2773 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2774 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2775 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2777 state = 0xdeadbee;
2778 action = 0xdeadbee;
2779 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2780 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2781 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2782 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2784 state = 0xdeadbee;
2785 action = 0xdeadbee;
2786 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2787 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2788 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2789 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2791 state = 0xdeadbee;
2792 action = 0xdeadbee;
2793 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2794 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2795 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2796 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2798 state = 0xdeadbee;
2799 action = 0xdeadbee;
2800 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2801 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2802 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2803 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2805 state = 0xdeadbee;
2806 action = 0xdeadbee;
2807 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2808 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2809 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2810 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2812 state = 0xdeadbee;
2813 action = 0xdeadbee;
2814 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2816 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2817 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2819 state = 0xdeadbee;
2820 action = 0xdeadbee;
2821 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2822 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2823 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2824 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2826 state = 0xdeadbee;
2827 action = 0xdeadbee;
2828 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2830 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2831 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2833 state = 0xdeadbee;
2834 action = 0xdeadbee;
2835 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2836 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2837 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2838 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2840 state = 0xdeadbee;
2841 action = 0xdeadbee;
2842 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2847 state = 0xdeadbee;
2848 action = 0xdeadbee;
2849 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2854 state = 0xdeadbee;
2855 action = 0xdeadbee;
2856 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2858 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2859 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2861 state = 0xdeadbee;
2862 action = 0xdeadbee;
2863 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2868 state = 0xdeadbee;
2869 action = 0xdeadbee;
2870 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2875 state = 0xdeadbee;
2876 action = 0xdeadbee;
2877 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2882 state = 0xdeadbee;
2883 action = 0xdeadbee;
2884 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2889 state = 0xdeadbee;
2890 action = 0xdeadbee;
2891 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2896 r = MsiDoAction( hpkg, "FileCost");
2897 ok( r == ERROR_SUCCESS, "file cost failed\n");
2899 state = 0xdeadbee;
2900 action = 0xdeadbee;
2901 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2903 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2904 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2906 state = 0xdeadbee;
2907 action = 0xdeadbee;
2908 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2910 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2911 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2913 state = 0xdeadbee;
2914 action = 0xdeadbee;
2915 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2917 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2920 state = 0xdeadbee;
2921 action = 0xdeadbee;
2922 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2924 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2925 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2927 state = 0xdeadbee;
2928 action = 0xdeadbee;
2929 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2930 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2931 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2932 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2934 state = 0xdeadbee;
2935 action = 0xdeadbee;
2936 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2937 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2938 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2939 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2941 state = 0xdeadbee;
2942 action = 0xdeadbee;
2943 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2945 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2946 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2948 state = 0xdeadbee;
2949 action = 0xdeadbee;
2950 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2951 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2952 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2953 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2955 state = 0xdeadbee;
2956 action = 0xdeadbee;
2957 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2958 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2959 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2960 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2962 state = 0xdeadbee;
2963 action = 0xdeadbee;
2964 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2965 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2966 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2967 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2969 state = 0xdeadbee;
2970 action = 0xdeadbee;
2971 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2972 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2973 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2974 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2976 state = 0xdeadbee;
2977 action = 0xdeadbee;
2978 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2979 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2980 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2981 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2983 state = 0xdeadbee;
2984 action = 0xdeadbee;
2985 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2986 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2987 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2988 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2990 state = 0xdeadbee;
2991 action = 0xdeadbee;
2992 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2994 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2995 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2997 state = 0xdeadbee;
2998 action = 0xdeadbee;
2999 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3001 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3002 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3004 state = 0xdeadbee;
3005 action = 0xdeadbee;
3006 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3008 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3009 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3011 state = 0xdeadbee;
3012 action = 0xdeadbee;
3013 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3015 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3016 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3018 state = 0xdeadbee;
3019 action = 0xdeadbee;
3020 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3022 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3025 state = 0xdeadbee;
3026 action = 0xdeadbee;
3027 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3029 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3030 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3032 state = 0xdeadbee;
3033 action = 0xdeadbee;
3034 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3036 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3037 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3039 state = 0xdeadbee;
3040 action = 0xdeadbee;
3041 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3042 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3043 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3044 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3046 state = 0xdeadbee;
3047 action = 0xdeadbee;
3048 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3049 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3050 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3051 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3053 state = 0xdeadbee;
3054 action = 0xdeadbee;
3055 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3057 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3058 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3060 state = 0xdeadbee;
3061 action = 0xdeadbee;
3062 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3064 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3065 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3067 state = 0xdeadbee;
3068 action = 0xdeadbee;
3069 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3071 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3072 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3074 r = MsiDoAction( hpkg, "CostFinalize");
3075 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3077 state = 0xdeadbee;
3078 action = 0xdeadbee;
3079 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3081 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3082 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3084 state = 0xdeadbee;
3085 action = 0xdeadbee;
3086 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3088 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3089 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3091 state = 0xdeadbee;
3092 action = 0xdeadbee;
3093 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3095 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3096 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3098 state = 0xdeadbee;
3099 action = 0xdeadbee;
3100 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3102 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3103 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3105 state = 0xdeadbee;
3106 action = 0xdeadbee;
3107 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3109 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3112 state = 0xdeadbee;
3113 action = 0xdeadbee;
3114 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3116 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3119 state = 0xdeadbee;
3120 action = 0xdeadbee;
3121 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3123 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3126 state = 0xdeadbee;
3127 action = 0xdeadbee;
3128 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3130 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3131 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3133 state = 0xdeadbee;
3134 action = 0xdeadbee;
3135 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3137 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3138 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3140 state = 0xdeadbee;
3141 action = 0xdeadbee;
3142 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3144 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3145 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3147 state = 0xdeadbee;
3148 action = 0xdeadbee;
3149 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3151 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3152 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3154 state = 0xdeadbee;
3155 action = 0xdeadbee;
3156 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3158 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3159 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3161 state = 0xdeadbee;
3162 action = 0xdeadbee;
3163 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3165 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3166 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3168 state = 0xdeadbee;
3169 action = 0xdeadbee;
3170 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3172 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3173 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3175 state = 0xdeadbee;
3176 action = 0xdeadbee;
3177 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3179 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3180 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3182 state = 0xdeadbee;
3183 action = 0xdeadbee;
3184 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3186 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3187 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3189 state = 0xdeadbee;
3190 action = 0xdeadbee;
3191 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3193 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3196 state = 0xdeadbee;
3197 action = 0xdeadbee;
3198 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3200 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3203 state = 0xdeadbee;
3204 action = 0xdeadbee;
3205 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3207 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3210 state = 0xdeadbee;
3211 action = 0xdeadbee;
3212 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3214 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3217 state = 0xdeadbee;
3218 action = 0xdeadbee;
3219 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3221 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3222 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3224 state = 0xdeadbee;
3225 action = 0xdeadbee;
3226 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3228 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3229 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3231 state = 0xdeadbee;
3232 action = 0xdeadbee;
3233 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3235 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3236 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3238 state = 0xdeadbee;
3239 action = 0xdeadbee;
3240 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3242 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3243 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3245 state = 0xdeadbee;
3246 action = 0xdeadbee;
3247 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3249 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3250 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3252 MsiCloseHandle( hpkg );
3254 /* publish the features and components */
3255 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3258 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3259 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3261 /* these properties must not be in the saved msi file */
3262 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3263 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3265 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3266 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3268 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3269 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3271 hpkg = package_from_db( hdb );
3272 ok( hpkg, "failed to create package\n");
3274 MsiCloseHandle(hdb);
3276 state = 0xdeadbee;
3277 action = 0xdeadbee;
3278 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3279 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3280 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3281 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3283 state = 0xdeadbee;
3284 action = 0xdeadbee;
3285 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3286 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3287 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3288 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3290 state = 0xdeadbee;
3291 action = 0xdeadbee;
3292 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3293 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3294 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3295 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3297 state = 0xdeadbee;
3298 action = 0xdeadbee;
3299 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3300 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3301 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3302 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3304 state = 0xdeadbee;
3305 action = 0xdeadbee;
3306 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3307 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3308 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3309 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3311 state = 0xdeadbee;
3312 action = 0xdeadbee;
3313 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3314 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3315 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3316 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3318 state = 0xdeadbee;
3319 action = 0xdeadbee;
3320 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3321 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3322 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3323 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3325 state = 0xdeadbee;
3326 action = 0xdeadbee;
3327 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3328 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3329 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3330 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3332 state = 0xdeadbee;
3333 action = 0xdeadbee;
3334 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3335 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3336 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3337 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3339 state = 0xdeadbee;
3340 action = 0xdeadbee;
3341 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3342 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3343 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3344 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3346 state = 0xdeadbee;
3347 action = 0xdeadbee;
3348 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3349 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3350 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3351 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3353 state = 0xdeadbee;
3354 action = 0xdeadbee;
3355 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3356 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3357 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3358 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3360 state = 0xdeadbee;
3361 action = 0xdeadbee;
3362 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3363 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3364 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3365 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3367 state = 0xdeadbee;
3368 action = 0xdeadbee;
3369 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3370 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3371 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3372 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3374 state = 0xdeadbee;
3375 action = 0xdeadbee;
3376 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3377 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3378 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3379 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3381 state = 0xdeadbee;
3382 action = 0xdeadbee;
3383 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3384 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3385 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3386 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3388 state = 0xdeadbee;
3389 action = 0xdeadbee;
3390 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3391 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3392 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3393 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3395 state = 0xdeadbee;
3396 action = 0xdeadbee;
3397 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3398 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3399 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3400 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3402 state = 0xdeadbee;
3403 action = 0xdeadbee;
3404 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3405 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3406 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3407 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3409 state = 0xdeadbee;
3410 action = 0xdeadbee;
3411 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3412 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3413 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3414 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3416 state = 0xdeadbee;
3417 action = 0xdeadbee;
3418 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3419 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3420 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3421 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3423 state = 0xdeadbee;
3424 action = 0xdeadbee;
3425 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3426 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3427 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3428 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3430 state = 0xdeadbee;
3431 action = 0xdeadbee;
3432 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3433 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3434 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3435 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3437 state = 0xdeadbee;
3438 action = 0xdeadbee;
3439 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3440 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3441 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3442 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3444 state = 0xdeadbee;
3445 action = 0xdeadbee;
3446 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3447 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3448 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3449 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3451 r = MsiDoAction( hpkg, "CostInitialize");
3452 ok( r == ERROR_SUCCESS, "cost init failed\n");
3454 state = 0xdeadbee;
3455 action = 0xdeadbee;
3456 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3458 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3459 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3461 state = 0xdeadbee;
3462 action = 0xdeadbee;
3463 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3465 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3466 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3468 state = 0xdeadbee;
3469 action = 0xdeadbee;
3470 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3472 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3473 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3475 state = 0xdeadbee;
3476 action = 0xdeadbee;
3477 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3479 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3480 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3482 state = 0xdeadbee;
3483 action = 0xdeadbee;
3484 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3486 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3487 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3489 state = 0xdeadbee;
3490 action = 0xdeadbee;
3491 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3493 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3494 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3496 state = 0xdeadbee;
3497 action = 0xdeadbee;
3498 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3500 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3501 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3503 state = 0xdeadbee;
3504 action = 0xdeadbee;
3505 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3507 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3508 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3510 state = 0xdeadbee;
3511 action = 0xdeadbee;
3512 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3514 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3515 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3517 state = 0xdeadbee;
3518 action = 0xdeadbee;
3519 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3520 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3521 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3522 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3524 state = 0xdeadbee;
3525 action = 0xdeadbee;
3526 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3527 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3528 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3529 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3531 state = 0xdeadbee;
3532 action = 0xdeadbee;
3533 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3534 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3535 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3536 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3538 state = 0xdeadbee;
3539 action = 0xdeadbee;
3540 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3541 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3542 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3543 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3545 state = 0xdeadbee;
3546 action = 0xdeadbee;
3547 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3549 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3550 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3552 state = 0xdeadbee;
3553 action = 0xdeadbee;
3554 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3556 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3557 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3559 state = 0xdeadbee;
3560 action = 0xdeadbee;
3561 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3563 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3564 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3566 state = 0xdeadbee;
3567 action = 0xdeadbee;
3568 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3569 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3570 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3571 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3573 state = 0xdeadbee;
3574 action = 0xdeadbee;
3575 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3576 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3577 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3578 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3580 state = 0xdeadbee;
3581 action = 0xdeadbee;
3582 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3583 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3584 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3585 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3587 state = 0xdeadbee;
3588 action = 0xdeadbee;
3589 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3590 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3591 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3592 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3594 state = 0xdeadbee;
3595 action = 0xdeadbee;
3596 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3597 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3598 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3599 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3601 state = 0xdeadbee;
3602 action = 0xdeadbee;
3603 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3604 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3605 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3606 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3608 state = 0xdeadbee;
3609 action = 0xdeadbee;
3610 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3612 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3613 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3615 state = 0xdeadbee;
3616 action = 0xdeadbee;
3617 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3619 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3620 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3622 state = 0xdeadbee;
3623 action = 0xdeadbee;
3624 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3625 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3626 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3627 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3629 r = MsiDoAction( hpkg, "FileCost");
3630 ok( r == ERROR_SUCCESS, "file cost failed\n");
3632 state = 0xdeadbee;
3633 action = 0xdeadbee;
3634 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3636 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3637 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3639 state = 0xdeadbee;
3640 action = 0xdeadbee;
3641 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3643 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3644 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3646 state = 0xdeadbee;
3647 action = 0xdeadbee;
3648 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3650 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3651 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3653 state = 0xdeadbee;
3654 action = 0xdeadbee;
3655 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3657 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3658 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3660 state = 0xdeadbee;
3661 action = 0xdeadbee;
3662 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3664 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3665 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3667 state = 0xdeadbee;
3668 action = 0xdeadbee;
3669 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3671 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3672 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3674 state = 0xdeadbee;
3675 action = 0xdeadbee;
3676 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3678 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3679 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3681 state = 0xdeadbee;
3682 action = 0xdeadbee;
3683 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3685 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3688 state = 0xdeadbee;
3689 action = 0xdeadbee;
3690 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3692 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3695 state = 0xdeadbee;
3696 action = 0xdeadbee;
3697 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3698 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3699 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3700 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3702 state = 0xdeadbee;
3703 action = 0xdeadbee;
3704 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3705 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3706 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3707 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3709 state = 0xdeadbee;
3710 action = 0xdeadbee;
3711 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3712 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3713 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3714 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3716 state = 0xdeadbee;
3717 action = 0xdeadbee;
3718 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3719 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3720 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3721 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3723 state = 0xdeadbee;
3724 action = 0xdeadbee;
3725 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3726 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3727 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3728 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3730 state = 0xdeadbee;
3731 action = 0xdeadbee;
3732 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3733 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3734 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3735 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3737 state = 0xdeadbee;
3738 action = 0xdeadbee;
3739 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3740 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3741 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3742 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3744 state = 0xdeadbee;
3745 action = 0xdeadbee;
3746 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3747 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3748 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3749 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3751 state = 0xdeadbee;
3752 action = 0xdeadbee;
3753 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3755 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3756 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3758 state = 0xdeadbee;
3759 action = 0xdeadbee;
3760 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3762 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3763 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3765 state = 0xdeadbee;
3766 action = 0xdeadbee;
3767 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3769 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3770 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3772 state = 0xdeadbee;
3773 action = 0xdeadbee;
3774 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3776 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3777 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3779 state = 0xdeadbee;
3780 action = 0xdeadbee;
3781 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3783 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3784 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3786 state = 0xdeadbee;
3787 action = 0xdeadbee;
3788 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3790 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3791 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3793 state = 0xdeadbee;
3794 action = 0xdeadbee;
3795 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3797 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3798 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3800 state = 0xdeadbee;
3801 action = 0xdeadbee;
3802 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3804 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3805 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3807 r = MsiDoAction( hpkg, "CostFinalize");
3808 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3810 state = 0xdeadbee;
3811 action = 0xdeadbee;
3812 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3814 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3815 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3817 state = 0xdeadbee;
3818 action = 0xdeadbee;
3819 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3821 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3822 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3824 state = 0xdeadbee;
3825 action = 0xdeadbee;
3826 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3828 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3829 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3831 state = 0xdeadbee;
3832 action = 0xdeadbee;
3833 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3835 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3836 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3838 state = 0xdeadbee;
3839 action = 0xdeadbee;
3840 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3842 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3843 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3845 state = 0xdeadbee;
3846 action = 0xdeadbee;
3847 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3849 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3850 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3852 state = 0xdeadbee;
3853 action = 0xdeadbee;
3854 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3856 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3857 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3859 state = 0xdeadbee;
3860 action = 0xdeadbee;
3861 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3863 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3864 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3866 state = 0xdeadbee;
3867 action = 0xdeadbee;
3868 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3870 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3871 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3873 state = 0xdeadbee;
3874 action = 0xdeadbee;
3875 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3877 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3878 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3880 state = 0xdeadbee;
3881 action = 0xdeadbee;
3882 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3883 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3884 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3885 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3887 state = 0xdeadbee;
3888 action = 0xdeadbee;
3889 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3891 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3892 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3894 state = 0xdeadbee;
3895 action = 0xdeadbee;
3896 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3898 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3899 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3901 state = 0xdeadbee;
3902 action = 0xdeadbee;
3903 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3905 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3906 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3908 state = 0xdeadbee;
3909 action = 0xdeadbee;
3910 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3912 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3913 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3915 state = 0xdeadbee;
3916 action = 0xdeadbee;
3917 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3919 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3920 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3922 state = 0xdeadbee;
3923 action = 0xdeadbee;
3924 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3925 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3926 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3927 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3929 state = 0xdeadbee;
3930 action = 0xdeadbee;
3931 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3933 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3934 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3936 state = 0xdeadbee;
3937 action = 0xdeadbee;
3938 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3940 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3941 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3943 state = 0xdeadbee;
3944 action = 0xdeadbee;
3945 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3947 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3950 state = 0xdeadbee;
3951 action = 0xdeadbee;
3952 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3954 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3955 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3957 state = 0xdeadbee;
3958 action = 0xdeadbee;
3959 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3961 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3962 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3964 state = 0xdeadbee;
3965 action = 0xdeadbee;
3966 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3968 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3971 state = 0xdeadbee;
3972 action = 0xdeadbee;
3973 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3975 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3978 state = 0xdeadbee;
3979 action = 0xdeadbee;
3980 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3982 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3985 MsiCloseHandle(hpkg);
3987 /* uninstall the product */
3988 r = MsiInstallProduct(msifile, "REMOVE=ALL");
3989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3991 /* all features installed locally */
3992 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
3993 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3995 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
3996 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3998 /* these properties must not be in the saved msi file */
3999 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven'");
4000 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4002 hpkg = package_from_db( hdb );
4003 ok( hpkg, "failed to create package\n");
4005 state = 0xdeadbee;
4006 action = 0xdeadbee;
4007 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4008 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4009 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4010 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4012 state = 0xdeadbee;
4013 action = 0xdeadbee;
4014 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4015 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4016 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4017 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4019 state = 0xdeadbee;
4020 action = 0xdeadbee;
4021 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4022 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4023 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4024 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4026 state = 0xdeadbee;
4027 action = 0xdeadbee;
4028 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4029 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4030 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4031 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4033 state = 0xdeadbee;
4034 action = 0xdeadbee;
4035 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4036 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4037 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4038 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4040 state = 0xdeadbee;
4041 action = 0xdeadbee;
4042 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4043 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4044 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4045 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4047 state = 0xdeadbee;
4048 action = 0xdeadbee;
4049 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4050 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4051 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4052 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4054 state = 0xdeadbee;
4055 action = 0xdeadbee;
4056 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4057 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4058 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4059 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4061 state = 0xdeadbee;
4062 action = 0xdeadbee;
4063 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4064 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4065 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4066 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4068 state = 0xdeadbee;
4069 action = 0xdeadbee;
4070 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4071 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4072 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4073 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4075 state = 0xdeadbee;
4076 action = 0xdeadbee;
4077 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4078 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4079 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4080 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4082 state = 0xdeadbee;
4083 action = 0xdeadbee;
4084 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4085 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4086 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4087 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4089 state = 0xdeadbee;
4090 action = 0xdeadbee;
4091 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4092 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4093 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4094 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4096 state = 0xdeadbee;
4097 action = 0xdeadbee;
4098 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4099 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4100 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4101 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4103 state = 0xdeadbee;
4104 action = 0xdeadbee;
4105 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4106 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4107 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4108 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4110 state = 0xdeadbee;
4111 action = 0xdeadbee;
4112 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4113 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4114 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4115 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4117 state = 0xdeadbee;
4118 action = 0xdeadbee;
4119 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4120 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4121 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4122 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4124 state = 0xdeadbee;
4125 action = 0xdeadbee;
4126 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4127 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4128 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4129 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4131 state = 0xdeadbee;
4132 action = 0xdeadbee;
4133 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4134 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4135 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4136 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4138 state = 0xdeadbee;
4139 action = 0xdeadbee;
4140 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4141 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4142 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4143 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4145 state = 0xdeadbee;
4146 action = 0xdeadbee;
4147 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4148 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4149 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4150 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4152 state = 0xdeadbee;
4153 action = 0xdeadbee;
4154 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4155 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4156 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4157 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4159 state = 0xdeadbee;
4160 action = 0xdeadbee;
4161 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4162 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4163 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4164 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4166 state = 0xdeadbee;
4167 action = 0xdeadbee;
4168 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4169 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4170 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4171 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4173 state = 0xdeadbee;
4174 action = 0xdeadbee;
4175 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4176 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4177 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4178 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4180 r = MsiDoAction( hpkg, "CostInitialize");
4181 ok( r == ERROR_SUCCESS, "cost init failed\n");
4183 state = 0xdeadbee;
4184 action = 0xdeadbee;
4185 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4190 state = 0xdeadbee;
4191 action = 0xdeadbee;
4192 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4197 state = 0xdeadbee;
4198 action = 0xdeadbee;
4199 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4204 state = 0xdeadbee;
4205 action = 0xdeadbee;
4206 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4211 state = 0xdeadbee;
4212 action = 0xdeadbee;
4213 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4218 state = 0xdeadbee;
4219 action = 0xdeadbee;
4220 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4225 state = 0xdeadbee;
4226 action = 0xdeadbee;
4227 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4232 state = 0xdeadbee;
4233 action = 0xdeadbee;
4234 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4239 state = 0xdeadbee;
4240 action = 0xdeadbee;
4241 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4246 state = 0xdeadbee;
4247 action = 0xdeadbee;
4248 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4253 state = 0xdeadbee;
4254 action = 0xdeadbee;
4255 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4260 state = 0xdeadbee;
4261 action = 0xdeadbee;
4262 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4267 state = 0xdeadbee;
4268 action = 0xdeadbee;
4269 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4274 state = 0xdeadbee;
4275 action = 0xdeadbee;
4276 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4281 state = 0xdeadbee;
4282 action = 0xdeadbee;
4283 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4288 state = 0xdeadbee;
4289 action = 0xdeadbee;
4290 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4295 state = 0xdeadbee;
4296 action = 0xdeadbee;
4297 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4302 state = 0xdeadbee;
4303 action = 0xdeadbee;
4304 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4309 state = 0xdeadbee;
4310 action = 0xdeadbee;
4311 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4316 state = 0xdeadbee;
4317 action = 0xdeadbee;
4318 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4323 state = 0xdeadbee;
4324 action = 0xdeadbee;
4325 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4330 state = 0xdeadbee;
4331 action = 0xdeadbee;
4332 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4337 state = 0xdeadbee;
4338 action = 0xdeadbee;
4339 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4344 state = 0xdeadbee;
4345 action = 0xdeadbee;
4346 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4351 state = 0xdeadbee;
4352 action = 0xdeadbee;
4353 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4358 r = MsiDoAction( hpkg, "FileCost");
4359 ok( r == ERROR_SUCCESS, "file cost failed\n");
4361 state = 0xdeadbee;
4362 action = 0xdeadbee;
4363 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4368 state = 0xdeadbee;
4369 action = 0xdeadbee;
4370 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4375 state = 0xdeadbee;
4376 action = 0xdeadbee;
4377 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4382 state = 0xdeadbee;
4383 action = 0xdeadbee;
4384 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4389 state = 0xdeadbee;
4390 action = 0xdeadbee;
4391 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4396 state = 0xdeadbee;
4397 action = 0xdeadbee;
4398 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4403 state = 0xdeadbee;
4404 action = 0xdeadbee;
4405 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4410 state = 0xdeadbee;
4411 action = 0xdeadbee;
4412 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4414 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4417 state = 0xdeadbee;
4418 action = 0xdeadbee;
4419 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4421 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4424 state = 0xdeadbee;
4425 action = 0xdeadbee;
4426 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4428 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4431 state = 0xdeadbee;
4432 action = 0xdeadbee;
4433 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4435 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4438 state = 0xdeadbee;
4439 action = 0xdeadbee;
4440 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4442 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4445 state = 0xdeadbee;
4446 action = 0xdeadbee;
4447 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4449 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4452 state = 0xdeadbee;
4453 action = 0xdeadbee;
4454 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4456 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4459 state = 0xdeadbee;
4460 action = 0xdeadbee;
4461 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4463 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4466 state = 0xdeadbee;
4467 action = 0xdeadbee;
4468 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4470 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4473 state = 0xdeadbee;
4474 action = 0xdeadbee;
4475 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4477 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4478 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4480 state = 0xdeadbee;
4481 action = 0xdeadbee;
4482 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4484 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4485 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4487 state = 0xdeadbee;
4488 action = 0xdeadbee;
4489 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4491 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4492 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4494 state = 0xdeadbee;
4495 action = 0xdeadbee;
4496 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4498 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4499 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4501 state = 0xdeadbee;
4502 action = 0xdeadbee;
4503 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4505 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4506 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4508 state = 0xdeadbee;
4509 action = 0xdeadbee;
4510 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4512 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4515 state = 0xdeadbee;
4516 action = 0xdeadbee;
4517 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4519 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4522 state = 0xdeadbee;
4523 action = 0xdeadbee;
4524 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4526 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4527 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4529 state = 0xdeadbee;
4530 action = 0xdeadbee;
4531 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4533 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4534 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4536 r = MsiDoAction( hpkg, "CostFinalize");
4537 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4539 state = 0xdeadbee;
4540 action = 0xdeadbee;
4541 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4543 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4544 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4546 state = 0xdeadbee;
4547 action = 0xdeadbee;
4548 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4550 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4551 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4553 state = 0xdeadbee;
4554 action = 0xdeadbee;
4555 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4557 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4558 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4560 state = 0xdeadbee;
4561 action = 0xdeadbee;
4562 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4564 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4565 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4567 state = 0xdeadbee;
4568 action = 0xdeadbee;
4569 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4571 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4572 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4574 state = 0xdeadbee;
4575 action = 0xdeadbee;
4576 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4577 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4578 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4579 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4581 state = 0xdeadbee;
4582 action = 0xdeadbee;
4583 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4584 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4585 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4586 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4588 state = 0xdeadbee;
4589 action = 0xdeadbee;
4590 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4592 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4593 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4595 state = 0xdeadbee;
4596 action = 0xdeadbee;
4597 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4599 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4600 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4602 state = 0xdeadbee;
4603 action = 0xdeadbee;
4604 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4606 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4607 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4609 state = 0xdeadbee;
4610 action = 0xdeadbee;
4611 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4613 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4614 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4616 state = 0xdeadbee;
4617 action = 0xdeadbee;
4618 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4620 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4621 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4623 state = 0xdeadbee;
4624 action = 0xdeadbee;
4625 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4627 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4628 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4630 state = 0xdeadbee;
4631 action = 0xdeadbee;
4632 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4634 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4635 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4637 state = 0xdeadbee;
4638 action = 0xdeadbee;
4639 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4641 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4642 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4644 state = 0xdeadbee;
4645 action = 0xdeadbee;
4646 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4647 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4648 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4649 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4651 state = 0xdeadbee;
4652 action = 0xdeadbee;
4653 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4655 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4656 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4658 state = 0xdeadbee;
4659 action = 0xdeadbee;
4660 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4662 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4663 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4665 state = 0xdeadbee;
4666 action = 0xdeadbee;
4667 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4669 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4670 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4672 state = 0xdeadbee;
4673 action = 0xdeadbee;
4674 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4676 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4677 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4679 state = 0xdeadbee;
4680 action = 0xdeadbee;
4681 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4683 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4684 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4686 state = 0xdeadbee;
4687 action = 0xdeadbee;
4688 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4690 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4691 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4693 state = 0xdeadbee;
4694 action = 0xdeadbee;
4695 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4697 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4698 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4700 state = 0xdeadbee;
4701 action = 0xdeadbee;
4702 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4704 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4705 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4707 state = 0xdeadbee;
4708 action = 0xdeadbee;
4709 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4711 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4712 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4714 MsiCloseHandle(hpkg);
4716 /* uninstall the product */
4717 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
4718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4720 /* all features installed from source */
4721 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
4722 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4724 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
4725 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4727 /* this property must not be in the saved msi file */
4728 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven'");
4729 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4731 hpkg = package_from_db( hdb );
4732 ok( hpkg, "failed to create package\n");
4734 state = 0xdeadbee;
4735 action = 0xdeadbee;
4736 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4737 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4738 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4739 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4741 state = 0xdeadbee;
4742 action = 0xdeadbee;
4743 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4744 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4745 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4746 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4748 state = 0xdeadbee;
4749 action = 0xdeadbee;
4750 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4751 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4752 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4753 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4755 state = 0xdeadbee;
4756 action = 0xdeadbee;
4757 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4758 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4759 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4760 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4762 state = 0xdeadbee;
4763 action = 0xdeadbee;
4764 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4765 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4766 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4767 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4769 state = 0xdeadbee;
4770 action = 0xdeadbee;
4771 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4772 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4773 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4774 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4776 state = 0xdeadbee;
4777 action = 0xdeadbee;
4778 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4779 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4780 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4781 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4783 state = 0xdeadbee;
4784 action = 0xdeadbee;
4785 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4786 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4787 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4788 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4790 state = 0xdeadbee;
4791 action = 0xdeadbee;
4792 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4793 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4794 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4795 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4797 state = 0xdeadbee;
4798 action = 0xdeadbee;
4799 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4800 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4801 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4802 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4804 state = 0xdeadbee;
4805 action = 0xdeadbee;
4806 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4807 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4808 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4809 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4811 state = 0xdeadbee;
4812 action = 0xdeadbee;
4813 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4814 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4815 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4816 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4818 state = 0xdeadbee;
4819 action = 0xdeadbee;
4820 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4821 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4822 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4823 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4825 state = 0xdeadbee;
4826 action = 0xdeadbee;
4827 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4828 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4829 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4830 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4832 state = 0xdeadbee;
4833 action = 0xdeadbee;
4834 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4835 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4836 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4837 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4839 state = 0xdeadbee;
4840 action = 0xdeadbee;
4841 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4842 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4843 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4844 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4846 state = 0xdeadbee;
4847 action = 0xdeadbee;
4848 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4849 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4850 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4851 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4853 state = 0xdeadbee;
4854 action = 0xdeadbee;
4855 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4856 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4857 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4858 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4860 state = 0xdeadbee;
4861 action = 0xdeadbee;
4862 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4863 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4864 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4865 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4867 state = 0xdeadbee;
4868 action = 0xdeadbee;
4869 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4870 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4871 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4872 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4874 state = 0xdeadbee;
4875 action = 0xdeadbee;
4876 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4877 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4878 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4879 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4881 state = 0xdeadbee;
4882 action = 0xdeadbee;
4883 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4884 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4885 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4886 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4888 state = 0xdeadbee;
4889 action = 0xdeadbee;
4890 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4891 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4892 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4893 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4895 state = 0xdeadbee;
4896 action = 0xdeadbee;
4897 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4898 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4899 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4900 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4902 state = 0xdeadbee;
4903 action = 0xdeadbee;
4904 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4905 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4906 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4907 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4909 r = MsiDoAction( hpkg, "CostInitialize");
4910 ok( r == ERROR_SUCCESS, "cost init failed\n");
4912 state = 0xdeadbee;
4913 action = 0xdeadbee;
4914 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4916 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4917 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4919 state = 0xdeadbee;
4920 action = 0xdeadbee;
4921 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4922 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4923 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4924 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4926 state = 0xdeadbee;
4927 action = 0xdeadbee;
4928 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4929 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4930 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4931 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4933 state = 0xdeadbee;
4934 action = 0xdeadbee;
4935 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4936 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4937 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4938 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4940 state = 0xdeadbee;
4941 action = 0xdeadbee;
4942 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4943 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4944 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4945 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4947 state = 0xdeadbee;
4948 action = 0xdeadbee;
4949 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4950 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4951 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4952 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4954 state = 0xdeadbee;
4955 action = 0xdeadbee;
4956 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4957 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4958 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4959 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4961 state = 0xdeadbee;
4962 action = 0xdeadbee;
4963 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4965 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4966 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4968 state = 0xdeadbee;
4969 action = 0xdeadbee;
4970 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4971 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4972 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4973 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4975 state = 0xdeadbee;
4976 action = 0xdeadbee;
4977 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4978 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4979 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4980 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4982 state = 0xdeadbee;
4983 action = 0xdeadbee;
4984 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4985 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4986 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4987 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4989 state = 0xdeadbee;
4990 action = 0xdeadbee;
4991 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4992 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4993 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4994 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4996 state = 0xdeadbee;
4997 action = 0xdeadbee;
4998 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4999 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5000 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5001 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5003 state = 0xdeadbee;
5004 action = 0xdeadbee;
5005 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5007 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5008 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5010 state = 0xdeadbee;
5011 action = 0xdeadbee;
5012 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5014 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5015 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5017 state = 0xdeadbee;
5018 action = 0xdeadbee;
5019 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5021 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5022 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5024 state = 0xdeadbee;
5025 action = 0xdeadbee;
5026 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5027 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5028 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5029 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5031 state = 0xdeadbee;
5032 action = 0xdeadbee;
5033 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5035 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5036 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5038 state = 0xdeadbee;
5039 action = 0xdeadbee;
5040 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5042 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5043 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5045 state = 0xdeadbee;
5046 action = 0xdeadbee;
5047 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5049 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5050 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5052 state = 0xdeadbee;
5053 action = 0xdeadbee;
5054 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5056 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5057 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5059 state = 0xdeadbee;
5060 action = 0xdeadbee;
5061 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5063 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5064 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5066 state = 0xdeadbee;
5067 action = 0xdeadbee;
5068 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5070 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5073 state = 0xdeadbee;
5074 action = 0xdeadbee;
5075 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5077 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5080 state = 0xdeadbee;
5081 action = 0xdeadbee;
5082 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5087 r = MsiDoAction( hpkg, "FileCost");
5088 ok( r == ERROR_SUCCESS, "file cost failed\n");
5090 state = 0xdeadbee;
5091 action = 0xdeadbee;
5092 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5093 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5094 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5095 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5097 state = 0xdeadbee;
5098 action = 0xdeadbee;
5099 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5100 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5101 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5102 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5104 state = 0xdeadbee;
5105 action = 0xdeadbee;
5106 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5107 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5108 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5109 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5111 state = 0xdeadbee;
5112 action = 0xdeadbee;
5113 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5115 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5116 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5118 state = 0xdeadbee;
5119 action = 0xdeadbee;
5120 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5121 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5122 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5123 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5125 state = 0xdeadbee;
5126 action = 0xdeadbee;
5127 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5129 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5130 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5132 state = 0xdeadbee;
5133 action = 0xdeadbee;
5134 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5135 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5136 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5137 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5139 state = 0xdeadbee;
5140 action = 0xdeadbee;
5141 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5142 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5143 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5144 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5146 state = 0xdeadbee;
5147 action = 0xdeadbee;
5148 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5149 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5150 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5151 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5153 state = 0xdeadbee;
5154 action = 0xdeadbee;
5155 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5156 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5157 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5160 state = 0xdeadbee;
5161 action = 0xdeadbee;
5162 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5163 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5164 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5165 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5167 state = 0xdeadbee;
5168 action = 0xdeadbee;
5169 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5170 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5171 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5174 state = 0xdeadbee;
5175 action = 0xdeadbee;
5176 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5177 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5178 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5179 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5181 state = 0xdeadbee;
5182 action = 0xdeadbee;
5183 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5185 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5186 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5188 state = 0xdeadbee;
5189 action = 0xdeadbee;
5190 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5192 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5193 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5195 state = 0xdeadbee;
5196 action = 0xdeadbee;
5197 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5199 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5200 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5202 state = 0xdeadbee;
5203 action = 0xdeadbee;
5204 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5206 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5207 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5209 state = 0xdeadbee;
5210 action = 0xdeadbee;
5211 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5213 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5216 state = 0xdeadbee;
5217 action = 0xdeadbee;
5218 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5220 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5221 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5223 state = 0xdeadbee;
5224 action = 0xdeadbee;
5225 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5227 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5228 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5230 state = 0xdeadbee;
5231 action = 0xdeadbee;
5232 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5234 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5235 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5237 state = 0xdeadbee;
5238 action = 0xdeadbee;
5239 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5241 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5244 state = 0xdeadbee;
5245 action = 0xdeadbee;
5246 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5248 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5251 state = 0xdeadbee;
5252 action = 0xdeadbee;
5253 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5255 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5256 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5258 state = 0xdeadbee;
5259 action = 0xdeadbee;
5260 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5262 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5263 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5265 r = MsiDoAction( hpkg, "CostFinalize");
5266 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5268 state = 0xdeadbee;
5269 action = 0xdeadbee;
5270 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5271 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5272 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5273 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5275 state = 0xdeadbee;
5276 action = 0xdeadbee;
5277 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5279 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5280 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5282 state = 0xdeadbee;
5283 action = 0xdeadbee;
5284 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5286 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5287 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5289 state = 0xdeadbee;
5290 action = 0xdeadbee;
5291 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5293 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5294 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5296 state = 0xdeadbee;
5297 action = 0xdeadbee;
5298 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5300 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5303 state = 0xdeadbee;
5304 action = 0xdeadbee;
5305 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5307 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5308 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5310 state = 0xdeadbee;
5311 action = 0xdeadbee;
5312 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5314 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5315 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5317 state = 0xdeadbee;
5318 action = 0xdeadbee;
5319 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5321 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5322 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5324 state = 0xdeadbee;
5325 action = 0xdeadbee;
5326 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5328 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5329 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5331 state = 0xdeadbee;
5332 action = 0xdeadbee;
5333 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5335 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5338 state = 0xdeadbee;
5339 action = 0xdeadbee;
5340 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5342 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5343 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5345 state = 0xdeadbee;
5346 action = 0xdeadbee;
5347 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5349 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5350 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5352 state = 0xdeadbee;
5353 action = 0xdeadbee;
5354 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5356 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5359 state = 0xdeadbee;
5360 action = 0xdeadbee;
5361 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5363 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5366 state = 0xdeadbee;
5367 action = 0xdeadbee;
5368 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5370 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5371 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5373 state = 0xdeadbee;
5374 action = 0xdeadbee;
5375 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5377 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5378 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5380 state = 0xdeadbee;
5381 action = 0xdeadbee;
5382 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5384 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5387 state = 0xdeadbee;
5388 action = 0xdeadbee;
5389 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5391 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5392 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5394 state = 0xdeadbee;
5395 action = 0xdeadbee;
5396 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5398 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5401 state = 0xdeadbee;
5402 action = 0xdeadbee;
5403 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5405 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5408 state = 0xdeadbee;
5409 action = 0xdeadbee;
5410 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5412 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5413 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5415 state = 0xdeadbee;
5416 action = 0xdeadbee;
5417 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5419 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5420 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5422 state = 0xdeadbee;
5423 action = 0xdeadbee;
5424 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5426 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5429 state = 0xdeadbee;
5430 action = 0xdeadbee;
5431 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5432 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5433 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5434 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5436 state = 0xdeadbee;
5437 action = 0xdeadbee;
5438 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5439 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5440 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5441 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5443 MsiCloseHandle(hpkg);
5445 /* uninstall the product */
5446 r = MsiInstallProduct(msifile3, "REMOVE=ALL");
5447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5449 DeleteFileA(msifile);
5450 DeleteFileA(msifile2);
5451 DeleteFileA(msifile3);
5454 static void test_getproperty(void)
5456 MSIHANDLE hPackage = 0;
5457 char prop[100];
5458 static CHAR empty[] = "";
5459 DWORD size;
5460 UINT r;
5462 hPackage = package_from_db(create_package_db());
5463 ok( hPackage != 0, " Failed to create package\n");
5465 /* set the property */
5466 r = MsiSetProperty(hPackage, "Name", "Value");
5467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5469 /* retrieve the size, NULL pointer */
5470 size = 0;
5471 r = MsiGetProperty(hPackage, "Name", NULL, &size);
5472 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5473 ok( size == 5, "Expected 5, got %d\n", size);
5475 /* retrieve the size, empty string */
5476 size = 0;
5477 r = MsiGetProperty(hPackage, "Name", empty, &size);
5478 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5479 ok( size == 5, "Expected 5, got %d\n", size);
5481 /* don't change size */
5482 r = MsiGetProperty(hPackage, "Name", prop, &size);
5483 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5484 ok( size == 5, "Expected 5, got %d\n", size);
5485 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
5487 /* increase the size by 1 */
5488 size++;
5489 r = MsiGetProperty(hPackage, "Name", prop, &size);
5490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5491 ok( size == 5, "Expected 5, got %d\n", size);
5492 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
5494 r = MsiCloseHandle( hPackage);
5495 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
5496 DeleteFile(msifile);
5499 static void test_removefiles(void)
5501 MSIHANDLE hpkg;
5502 UINT r;
5503 MSIHANDLE hdb;
5505 hdb = create_package_db();
5506 ok ( hdb, "failed to create package database\n" );
5508 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
5509 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
5511 r = create_feature_table( hdb );
5512 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
5514 r = create_component_table( hdb );
5515 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
5517 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
5518 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5520 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
5521 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5523 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
5524 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5526 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
5527 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5529 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
5530 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5532 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
5533 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5535 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
5536 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5538 r = create_feature_components_table( hdb );
5539 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
5541 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
5542 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5544 r = add_feature_components_entry( hdb, "'one', 'helium'" );
5545 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5547 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
5548 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5550 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
5551 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5553 r = add_feature_components_entry( hdb, "'one', 'boron'" );
5554 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5556 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
5557 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5559 r = create_file_table( hdb );
5560 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
5562 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
5563 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5565 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
5566 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5568 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
5569 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5571 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
5572 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5574 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
5575 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5577 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
5578 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5580 r = create_remove_file_table( hdb );
5581 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
5583 hpkg = package_from_db( hdb );
5584 ok( hpkg, "failed to create package\n");
5586 MsiCloseHandle( hdb );
5588 create_test_file( "hydrogen.txt" );
5589 create_test_file( "helium.txt" );
5590 create_test_file( "lithium.txt" );
5591 create_test_file( "beryllium.txt" );
5592 create_test_file( "boron.txt" );
5593 create_test_file( "carbon.txt" );
5595 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
5596 ok( r == ERROR_SUCCESS, "set property failed\n");
5598 r = MsiDoAction( hpkg, "CostInitialize");
5599 ok( r == ERROR_SUCCESS, "cost init failed\n");
5601 r = MsiDoAction( hpkg, "FileCost");
5602 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5604 r = MsiDoAction( hpkg, "CostFinalize");
5605 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5607 r = MsiDoAction( hpkg, "InstallValidate");
5608 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5610 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
5611 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5613 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
5614 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5616 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
5617 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5619 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
5620 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5622 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
5623 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5625 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
5626 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5628 r = MsiDoAction( hpkg, "RemoveFiles");
5629 ok( r == ERROR_SUCCESS, "remove files failed\n");
5631 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
5632 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
5633 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
5634 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
5635 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
5636 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
5638 MsiCloseHandle( hpkg );
5639 DeleteFileA(msifile);
5642 static void test_appsearch(void)
5644 MSIHANDLE hpkg;
5645 UINT r;
5646 MSIHANDLE hdb;
5647 CHAR prop[MAX_PATH];
5648 DWORD size = MAX_PATH;
5650 hdb = create_package_db();
5651 ok ( hdb, "failed to create package database\n" );
5653 r = create_appsearch_table( hdb );
5654 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
5656 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
5657 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
5659 r = create_reglocator_table( hdb );
5660 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5662 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
5663 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5665 r = create_signature_table( hdb );
5666 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5668 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
5669 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5671 hpkg = package_from_db( hdb );
5672 ok( hpkg, "failed to create package\n");
5674 MsiCloseHandle( hdb );
5676 r = MsiDoAction( hpkg, "AppSearch" );
5677 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
5679 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
5680 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
5681 todo_wine
5683 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
5686 MsiCloseHandle( hpkg );
5687 DeleteFileA(msifile);
5690 static void test_appsearch_complocator(void)
5692 MSIHANDLE hpkg, hdb;
5693 CHAR path[MAX_PATH];
5694 CHAR prop[MAX_PATH];
5695 LPSTR usersid;
5696 DWORD size;
5697 UINT r;
5699 get_user_sid(&usersid);
5700 if (!usersid)
5702 skip("ConvertSidToStringSidA is not available\n");
5703 return;
5706 create_test_file("FileName1");
5707 create_test_file("FileName4");
5708 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
5709 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
5711 create_test_file("FileName2");
5712 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
5713 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
5715 create_test_file("FileName3");
5716 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
5717 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
5719 create_test_file("FileName5");
5720 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
5721 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
5723 create_test_file("FileName6");
5724 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
5725 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
5727 create_test_file("FileName7");
5728 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
5729 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
5731 /* dir is FALSE, but we're pretending it's a directory */
5732 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
5733 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
5735 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
5736 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
5737 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
5739 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
5740 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
5741 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
5743 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
5744 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
5745 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
5747 hdb = create_package_db();
5748 ok(hdb, "Expected a valid database handle\n");
5750 r = create_appsearch_table(hdb);
5751 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5753 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
5754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5756 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
5757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5759 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
5760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5762 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
5763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5765 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
5766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5768 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
5769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5771 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
5772 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5774 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
5775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5777 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
5778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5780 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
5781 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5783 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
5784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5786 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
5787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5789 r = create_complocator_table(hdb);
5790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5792 /* published component, machine, file, signature, misdbLocatorTypeFile */
5793 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
5794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5796 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
5797 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
5798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5800 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
5801 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
5802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5804 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
5805 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
5806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5808 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
5809 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
5810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5812 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
5813 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
5814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5816 /* published component, machine, file, no signature, misdbLocatorTypeFile */
5817 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
5818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5820 /* unpublished component, no signature, misdbLocatorTypeDir */
5821 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
5822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5824 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
5825 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
5826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5828 /* published component, signature w/ ver, misdbLocatorTypeFile */
5829 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
5830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5832 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
5833 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
5834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5836 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
5837 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
5838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5840 r = create_signature_table(hdb);
5841 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5843 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
5844 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5846 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
5847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5849 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
5850 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5852 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
5853 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5855 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
5856 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5858 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
5859 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5861 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
5862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5864 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
5865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5867 hpkg = package_from_db(hdb);
5868 ok(hpkg, "Expected a valid package handle\n");
5870 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
5871 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5873 r = MsiDoAction(hpkg, "AppSearch");
5874 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5876 size = MAX_PATH;
5877 sprintf(path, "%s\\FileName1", CURR_DIR);
5878 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
5879 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5880 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5882 size = MAX_PATH;
5883 sprintf(path, "%s\\FileName2", CURR_DIR);
5884 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
5885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5886 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5888 size = MAX_PATH;
5889 sprintf(path, "%s\\FileName3", CURR_DIR);
5890 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
5891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5892 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5894 size = MAX_PATH;
5895 sprintf(path, "%s\\FileName4", CURR_DIR);
5896 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
5897 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5898 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
5900 size = MAX_PATH;
5901 sprintf(path, "%s\\FileName5", CURR_DIR);
5902 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
5903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5904 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5906 size = MAX_PATH;
5907 sprintf(path, "%s\\", CURR_DIR);
5908 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
5909 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5910 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5912 size = MAX_PATH;
5913 sprintf(path, "%s\\", CURR_DIR);
5914 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
5915 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5916 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5918 size = MAX_PATH;
5919 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
5920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5921 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
5923 size = MAX_PATH;
5924 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
5925 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5926 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
5928 size = MAX_PATH;
5929 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
5930 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
5931 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5932 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5934 size = MAX_PATH;
5935 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
5936 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5937 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
5939 size = MAX_PATH;
5940 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
5941 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
5942 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5943 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
5945 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
5946 MSIINSTALLCONTEXT_MACHINE, NULL);
5947 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
5948 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
5949 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
5950 MSIINSTALLCONTEXT_USERMANAGED, usersid);
5951 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
5952 MSIINSTALLCONTEXT_MACHINE, NULL);
5953 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
5954 MSIINSTALLCONTEXT_MACHINE, NULL);
5955 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
5956 MSIINSTALLCONTEXT_MACHINE, NULL);
5957 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
5958 MSIINSTALLCONTEXT_MACHINE, NULL);
5959 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
5960 MSIINSTALLCONTEXT_MACHINE, NULL);
5961 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
5962 MSIINSTALLCONTEXT_MACHINE, NULL);
5963 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
5964 MSIINSTALLCONTEXT_MACHINE, NULL);
5966 DeleteFileA("FileName1");
5967 DeleteFileA("FileName2");
5968 DeleteFileA("FileName3");
5969 DeleteFileA("FileName4");
5970 DeleteFileA("FileName5");
5971 DeleteFileA("FileName6");
5972 DeleteFileA("FileName7");
5973 DeleteFileA("FileName8.dll");
5974 DeleteFileA("FileName9.dll");
5975 DeleteFileA("FileName10.dll");
5976 MsiCloseHandle(hpkg);
5977 DeleteFileA(msifile);
5980 static void test_appsearch_reglocator(void)
5982 MSIHANDLE hpkg, hdb;
5983 CHAR path[MAX_PATH];
5984 CHAR prop[MAX_PATH];
5985 DWORD binary[2];
5986 DWORD size, val;
5987 BOOL space, version;
5988 HKEY hklm, classes;
5989 HKEY hkcu, users;
5990 LPCSTR str;
5991 LPSTR ptr;
5992 LONG res;
5993 UINT r;
5995 version = TRUE;
5996 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
5997 version = FALSE;
5999 DeleteFileA("test.dll");
6001 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
6002 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6004 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
6005 (const BYTE *)"regszdata", 10);
6006 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6008 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
6009 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6011 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
6012 (const BYTE *)"regszdata", 10);
6013 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6015 users = 0;
6016 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
6017 ok(res == ERROR_SUCCESS ||
6018 broken(res == ERROR_INVALID_PARAMETER),
6019 "Expected ERROR_SUCCESS, got %d\n", res);
6021 if (res == ERROR_SUCCESS)
6023 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
6024 (const BYTE *)"regszdata", 10);
6025 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6028 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
6029 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6031 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
6032 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6034 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
6035 (const BYTE *)"regszdata", 10);
6036 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6038 val = 42;
6039 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
6040 (const BYTE *)&val, sizeof(DWORD));
6041 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6043 val = -42;
6044 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
6045 (const BYTE *)&val, sizeof(DWORD));
6046 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6048 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
6049 (const BYTE *)"%PATH%", 7);
6050 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6052 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
6053 (const BYTE *)"my%NOVAR%", 10);
6054 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6056 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
6057 (const BYTE *)"one\0two\0", 9);
6058 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6060 binary[0] = 0x1234abcd;
6061 binary[1] = 0x567890ef;
6062 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
6063 (const BYTE *)binary, sizeof(binary));
6064 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6066 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
6067 (const BYTE *)"#regszdata", 11);
6068 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6070 create_test_file("FileName1");
6071 sprintf(path, "%s\\FileName1", CURR_DIR);
6072 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
6073 (const BYTE *)path, lstrlenA(path) + 1);
6074 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6076 sprintf(path, "%s\\FileName2", CURR_DIR);
6077 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
6078 (const BYTE *)path, lstrlenA(path) + 1);
6079 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6081 lstrcpyA(path, CURR_DIR);
6082 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
6083 (const BYTE *)path, lstrlenA(path) + 1);
6084 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6086 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
6087 (const BYTE *)"", 1);
6088 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6090 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6091 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
6092 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
6093 (const BYTE *)path, lstrlenA(path) + 1);
6094 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6096 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
6097 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
6098 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
6099 (const BYTE *)path, lstrlenA(path) + 1);
6100 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6102 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6103 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
6104 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
6105 (const BYTE *)path, lstrlenA(path) + 1);
6106 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6108 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
6109 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
6110 (const BYTE *)path, lstrlenA(path) + 1);
6112 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
6113 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
6114 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
6115 (const BYTE *)path, lstrlenA(path) + 1);
6117 hdb = create_package_db();
6118 ok(hdb, "Expected a valid database handle\n");
6120 r = create_appsearch_table(hdb);
6121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6123 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
6124 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6126 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
6127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6129 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
6130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6132 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
6133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6135 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
6136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6138 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
6139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6141 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
6142 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6144 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
6145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6147 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
6148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6150 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
6151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6153 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
6154 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6156 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
6157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6159 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
6160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6162 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
6163 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6165 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
6166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6168 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
6169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6171 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
6172 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6174 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
6175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6177 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
6178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6180 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
6181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6183 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
6184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6186 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
6187 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6189 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
6190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6192 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
6193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6195 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
6196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6198 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
6199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6201 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
6202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6204 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
6205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6207 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
6208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6210 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
6211 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6213 r = create_reglocator_table(hdb);
6214 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6216 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
6217 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
6218 r = add_reglocator_entry(hdb, str);
6219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6221 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
6222 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
6223 r = add_reglocator_entry(hdb, str);
6224 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6226 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
6227 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
6228 r = add_reglocator_entry(hdb, str);
6229 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6231 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
6232 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
6233 r = add_reglocator_entry(hdb, str);
6234 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6236 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
6237 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
6238 r = add_reglocator_entry(hdb, str);
6239 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6241 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
6242 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
6243 r = add_reglocator_entry(hdb, str);
6244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6246 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
6247 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
6248 r = add_reglocator_entry(hdb, str);
6249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6251 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
6252 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
6253 r = add_reglocator_entry(hdb, str);
6254 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6256 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
6257 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
6258 r = add_reglocator_entry(hdb, str);
6259 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6261 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
6262 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
6263 r = add_reglocator_entry(hdb, str);
6264 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6266 /* HKLM, msidbLocatorTypeFileName, no signature */
6267 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
6268 r = add_reglocator_entry(hdb, str);
6269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6271 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
6272 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
6273 r = add_reglocator_entry(hdb, str);
6274 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6276 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
6277 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
6278 r = add_reglocator_entry(hdb, str);
6279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6281 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
6282 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
6283 r = add_reglocator_entry(hdb, str);
6284 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6286 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
6287 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
6288 r = add_reglocator_entry(hdb, str);
6289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6291 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
6292 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
6293 r = add_reglocator_entry(hdb, str);
6294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6296 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
6297 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
6298 r = add_reglocator_entry(hdb, str);
6299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6301 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
6302 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
6303 r = add_reglocator_entry(hdb, str);
6304 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6306 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
6307 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
6308 r = add_reglocator_entry(hdb, str);
6309 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6311 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
6312 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
6313 r = add_reglocator_entry(hdb, str);
6314 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6316 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
6317 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
6318 r = add_reglocator_entry(hdb, str);
6319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6321 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
6322 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
6323 r = add_reglocator_entry(hdb, str);
6324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6326 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
6327 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
6328 r = add_reglocator_entry(hdb, str);
6329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6331 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
6332 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
6333 r = add_reglocator_entry(hdb, str);
6334 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6336 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
6337 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
6338 r = add_reglocator_entry(hdb, str);
6339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6341 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
6342 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
6343 r = add_reglocator_entry(hdb, str);
6344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6346 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
6347 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
6348 r = add_reglocator_entry(hdb, str);
6349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6351 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
6352 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
6353 r = add_reglocator_entry(hdb, str);
6354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6356 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
6357 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
6358 r = add_reglocator_entry(hdb, str);
6359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6361 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
6362 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
6363 r = add_reglocator_entry(hdb, str);
6364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6366 r = create_signature_table(hdb);
6367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6369 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
6370 r = add_signature_entry(hdb, str);
6371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6373 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
6374 r = add_signature_entry(hdb, str);
6375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6377 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
6378 r = add_signature_entry(hdb, str);
6379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6381 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
6382 r = add_signature_entry(hdb, str);
6383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6385 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
6386 r = add_signature_entry(hdb, str);
6387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6389 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
6390 r = add_signature_entry(hdb, str);
6391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6393 ptr = strrchr(CURR_DIR, '\\') + 1;
6394 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
6395 r = add_signature_entry(hdb, path);
6396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6398 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
6399 r = add_signature_entry(hdb, str);
6400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6402 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
6403 r = add_signature_entry(hdb, str);
6404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6406 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
6407 r = add_signature_entry(hdb, str);
6408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6410 hpkg = package_from_db(hdb);
6411 ok(hpkg, "Expected a valid package handle\n");
6413 r = MsiDoAction(hpkg, "AppSearch");
6414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6416 size = MAX_PATH;
6417 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
6418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6419 ok(!lstrcmpA(prop, "regszdata"),
6420 "Expected \"regszdata\", got \"%s\"\n", prop);
6422 size = MAX_PATH;
6423 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
6424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6425 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
6427 size = MAX_PATH;
6428 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
6429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6430 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
6432 ExpandEnvironmentStringsA("%PATH%", path, MAX_PATH);
6434 size = MAX_PATH;
6435 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
6436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6437 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6439 size = MAX_PATH;
6440 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
6441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6442 ok(!lstrcmpA(prop,
6443 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
6445 size = MAX_PATH;
6446 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
6447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6448 todo_wine
6450 ok(!memcmp(prop, "\0one\0two\0\0", 10),
6451 "Expected \"\\0one\\0two\\0\\0\"\n");
6454 size = MAX_PATH;
6455 lstrcpyA(path, "#xCDAB3412EF907856");
6456 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
6457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6458 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6460 size = MAX_PATH;
6461 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
6462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6463 ok(!lstrcmpA(prop, "##regszdata"),
6464 "Expected \"##regszdata\", got \"%s\"\n", prop);
6466 size = MAX_PATH;
6467 sprintf(path, "%s\\FileName1", CURR_DIR);
6468 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
6469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6470 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6472 size = MAX_PATH;
6473 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
6474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6475 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6477 size = MAX_PATH;
6478 sprintf(path, "%s\\", CURR_DIR);
6479 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
6480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6481 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6483 size = MAX_PATH;
6484 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
6485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6486 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6488 size = MAX_PATH;
6489 sprintf(path, "%s\\", CURR_DIR);
6490 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
6491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6492 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6494 size = MAX_PATH;
6495 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
6496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6497 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6499 size = MAX_PATH;
6500 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
6501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6502 ok(!lstrcmpA(prop, "regszdata"),
6503 "Expected \"regszdata\", got \"%s\"\n", prop);
6505 size = MAX_PATH;
6506 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
6507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6508 ok(!lstrcmpA(prop, "regszdata"),
6509 "Expected \"regszdata\", got \"%s\"\n", prop);
6511 if (users)
6513 size = MAX_PATH;
6514 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
6515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6516 ok(!lstrcmpA(prop, "regszdata"),
6517 "Expected \"regszdata\", got \"%s\"\n", prop);
6520 size = MAX_PATH;
6521 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
6522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6523 ok(!lstrcmpA(prop, "defvalue"),
6524 "Expected \"defvalue\", got \"%s\"\n", prop);
6526 size = MAX_PATH;
6527 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
6528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6529 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6531 size = MAX_PATH;
6532 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
6533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6534 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6536 if (version)
6538 size = MAX_PATH;
6539 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
6540 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
6541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6542 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6544 size = MAX_PATH;
6545 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
6546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6547 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6549 size = MAX_PATH;
6550 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
6551 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
6552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6553 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6556 size = MAX_PATH;
6557 lstrcpyA(path, CURR_DIR);
6558 ptr = strrchr(path, '\\') + 1;
6559 *ptr = '\0';
6560 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
6561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6562 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6564 size = MAX_PATH;
6565 sprintf(path, "%s\\", CURR_DIR);
6566 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
6567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6568 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6570 size = MAX_PATH;
6571 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
6572 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6573 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6575 size = MAX_PATH;
6576 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
6577 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6578 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6580 size = MAX_PATH;
6581 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
6582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6583 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6585 size = MAX_PATH;
6586 sprintf(path, "%s\\FileName1", CURR_DIR);
6587 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
6588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6589 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6591 size = MAX_PATH;
6592 sprintf(path, "%s\\FileName1", CURR_DIR);
6593 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
6594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6595 if (space)
6596 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6597 else
6598 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6600 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
6601 RegDeleteValueA(hklm, "Value1");
6602 RegDeleteValueA(hklm, "Value2");
6603 RegDeleteValueA(hklm, "Value3");
6604 RegDeleteValueA(hklm, "Value4");
6605 RegDeleteValueA(hklm, "Value5");
6606 RegDeleteValueA(hklm, "Value6");
6607 RegDeleteValueA(hklm, "Value7");
6608 RegDeleteValueA(hklm, "Value8");
6609 RegDeleteValueA(hklm, "Value9");
6610 RegDeleteValueA(hklm, "Value10");
6611 RegDeleteValueA(hklm, "Value11");
6612 RegDeleteValueA(hklm, "Value12");
6613 RegDeleteValueA(hklm, "Value13");
6614 RegDeleteValueA(hklm, "Value14");
6615 RegDeleteValueA(hklm, "Value15");
6616 RegDeleteValueA(hklm, "Value16");
6617 RegDeleteValueA(hklm, "Value17");
6618 RegDeleteKeyA(hklm, "");
6619 RegCloseKey(hklm);
6621 RegDeleteValueA(classes, "Value1");
6622 RegDeleteKeyA(classes, "");
6623 RegCloseKey(classes);
6625 RegDeleteValueA(hkcu, "Value1");
6626 RegDeleteKeyA(hkcu, "");
6627 RegCloseKey(hkcu);
6629 RegDeleteValueA(users, "Value1");
6630 RegDeleteKeyA(users, "");
6631 RegCloseKey(users);
6633 DeleteFileA("FileName1");
6634 DeleteFileA("FileName3.dll");
6635 DeleteFileA("FileName4.dll");
6636 DeleteFileA("FileName5.dll");
6637 MsiCloseHandle(hpkg);
6638 DeleteFileA(msifile);
6641 static void delete_win_ini(LPCSTR file)
6643 CHAR path[MAX_PATH];
6645 GetWindowsDirectoryA(path, MAX_PATH);
6646 lstrcatA(path, "\\");
6647 lstrcatA(path, file);
6649 DeleteFileA(path);
6652 static void test_appsearch_inilocator(void)
6654 MSIHANDLE hpkg, hdb;
6655 CHAR path[MAX_PATH];
6656 CHAR prop[MAX_PATH];
6657 BOOL version;
6658 LPCSTR str;
6659 LPSTR ptr;
6660 DWORD size;
6661 UINT r;
6663 version = TRUE;
6664 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
6665 version = FALSE;
6667 DeleteFileA("test.dll");
6669 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
6671 create_test_file("FileName1");
6672 sprintf(path, "%s\\FileName1", CURR_DIR);
6673 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
6675 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
6677 sprintf(path, "%s\\IDontExist", CURR_DIR);
6678 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
6680 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6681 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
6682 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
6684 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
6685 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
6686 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
6688 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6689 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
6690 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
6692 hdb = create_package_db();
6693 ok(hdb, "Expected a valid database handle\n");
6695 r = create_appsearch_table(hdb);
6696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6698 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
6699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6701 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
6702 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6704 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
6705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6707 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
6708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6710 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
6711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6713 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
6714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6716 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
6717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6719 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
6720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6722 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
6723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6725 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
6726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6728 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
6729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6731 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
6732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6734 r = create_inilocator_table(hdb);
6735 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6737 /* msidbLocatorTypeRawValue, field 1 */
6738 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
6739 r = add_inilocator_entry(hdb, str);
6740 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6742 /* msidbLocatorTypeRawValue, field 2 */
6743 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
6744 r = add_inilocator_entry(hdb, str);
6745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6747 /* msidbLocatorTypeRawValue, entire field */
6748 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
6749 r = add_inilocator_entry(hdb, str);
6750 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6752 /* msidbLocatorTypeFile */
6753 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
6754 r = add_inilocator_entry(hdb, str);
6755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6757 /* msidbLocatorTypeDirectory, file */
6758 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
6759 r = add_inilocator_entry(hdb, str);
6760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6762 /* msidbLocatorTypeDirectory, directory */
6763 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
6764 r = add_inilocator_entry(hdb, str);
6765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6767 /* msidbLocatorTypeFile, file, no signature */
6768 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
6769 r = add_inilocator_entry(hdb, str);
6770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6772 /* msidbLocatorTypeFile, dir, no signature */
6773 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
6774 r = add_inilocator_entry(hdb, str);
6775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6777 /* msidbLocatorTypeFile, file does not exist */
6778 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
6779 r = add_inilocator_entry(hdb, str);
6780 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6782 /* msidbLocatorTypeFile, signature with version */
6783 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
6784 r = add_inilocator_entry(hdb, str);
6785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6787 /* msidbLocatorTypeFile, signature with version, ver > max */
6788 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
6789 r = add_inilocator_entry(hdb, str);
6790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6792 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
6793 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
6794 r = add_inilocator_entry(hdb, str);
6795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6797 r = create_signature_table(hdb);
6798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6800 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
6801 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6803 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
6804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6806 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6809 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6812 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6813 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6815 hpkg = package_from_db(hdb);
6816 ok(hpkg, "Expected a valid package handle\n");
6818 r = MsiDoAction(hpkg, "AppSearch");
6819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6821 size = MAX_PATH;
6822 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
6823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6824 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
6826 size = MAX_PATH;
6827 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
6828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6829 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
6831 size = MAX_PATH;
6832 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
6833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6834 ok(!lstrcmpA(prop, "keydata,field2"),
6835 "Expected \"keydata,field2\", got \"%s\"\n", prop);
6837 size = MAX_PATH;
6838 sprintf(path, "%s\\FileName1", CURR_DIR);
6839 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
6840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6841 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6843 size = MAX_PATH;
6844 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
6845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6846 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6848 size = MAX_PATH;
6849 sprintf(path, "%s\\", CURR_DIR);
6850 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
6851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6852 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6854 size = MAX_PATH;
6855 sprintf(path, "%s\\", CURR_DIR);
6856 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
6857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6858 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6860 size = MAX_PATH;
6861 lstrcpyA(path, CURR_DIR);
6862 ptr = strrchr(path, '\\');
6863 *(ptr + 1) = '\0';
6864 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
6865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6866 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6868 size = MAX_PATH;
6869 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
6870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6871 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6873 if (version)
6875 size = MAX_PATH;
6876 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
6877 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
6878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6879 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6881 size = MAX_PATH;
6882 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
6883 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6884 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
6886 size = MAX_PATH;
6887 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
6888 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
6889 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6890 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
6893 delete_win_ini("IniFile.ini");
6894 DeleteFileA("FileName1");
6895 DeleteFileA("FileName2.dll");
6896 DeleteFileA("FileName3.dll");
6897 DeleteFileA("FileName4.dll");
6898 MsiCloseHandle(hpkg);
6899 DeleteFileA(msifile);
6902 static void test_appsearch_drlocator(void)
6904 MSIHANDLE hpkg, hdb;
6905 CHAR path[MAX_PATH];
6906 CHAR prop[MAX_PATH];
6907 BOOL version;
6908 LPCSTR str;
6909 DWORD size;
6910 UINT r;
6912 version = TRUE;
6913 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
6914 version = FALSE;
6916 DeleteFileA("test.dll");
6918 create_test_file("FileName1");
6919 CreateDirectoryA("one", NULL);
6920 CreateDirectoryA("one\\two", NULL);
6921 CreateDirectoryA("one\\two\\three", NULL);
6922 create_test_file("one\\two\\three\\FileName2");
6923 CreateDirectoryA("another", NULL);
6924 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6925 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
6926 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6928 hdb = create_package_db();
6929 ok(hdb, "Expected a valid database handle\n");
6931 r = create_appsearch_table(hdb);
6932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6934 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
6935 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6937 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
6938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6940 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
6941 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6943 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
6944 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6946 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
6947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6949 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
6950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6952 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
6953 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6955 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
6956 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6958 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
6959 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6961 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
6962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6964 r = create_drlocator_table(hdb);
6965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6967 /* no parent, full path, depth 0, signature */
6968 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
6969 r = add_drlocator_entry(hdb, path);
6970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6972 /* no parent, full path, depth 0, no signature */
6973 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
6974 r = add_drlocator_entry(hdb, path);
6975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6977 /* no parent, relative path, depth 0, no signature */
6978 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
6979 r = add_drlocator_entry(hdb, path);
6980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6982 /* no parent, full path, depth 2, signature */
6983 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
6984 r = add_drlocator_entry(hdb, path);
6985 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6987 /* no parent, full path, depth 3, signature */
6988 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
6989 r = add_drlocator_entry(hdb, path);
6990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6992 /* no parent, full path, depth 1, signature is dir */
6993 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
6994 r = add_drlocator_entry(hdb, path);
6995 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6997 /* parent is in DrLocator, relative path, depth 0, signature */
6998 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
6999 r = add_drlocator_entry(hdb, path);
7000 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7002 /* no parent, full path, depth 0, signature w/ version */
7003 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
7004 r = add_drlocator_entry(hdb, path);
7005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7007 /* no parent, full path, depth 0, signature w/ version, ver > max */
7008 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
7009 r = add_drlocator_entry(hdb, path);
7010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7012 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
7013 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
7014 r = add_drlocator_entry(hdb, path);
7015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7017 r = create_signature_table(hdb);
7018 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7020 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
7021 r = add_signature_entry(hdb, str);
7022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7024 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
7025 r = add_signature_entry(hdb, str);
7026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7028 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
7029 r = add_signature_entry(hdb, str);
7030 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7032 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
7033 r = add_signature_entry(hdb, str);
7034 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7036 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
7037 r = add_signature_entry(hdb, str);
7038 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7040 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7041 r = add_signature_entry(hdb, str);
7042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7044 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7045 r = add_signature_entry(hdb, str);
7046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7048 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7049 r = add_signature_entry(hdb, str);
7050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7052 hpkg = package_from_db(hdb);
7053 ok(hpkg, "Expected a valid package handle\n");
7055 r = MsiDoAction(hpkg, "AppSearch");
7056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7058 size = MAX_PATH;
7059 sprintf(path, "%s\\FileName1", CURR_DIR);
7060 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7062 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7064 size = MAX_PATH;
7065 sprintf(path, "%s\\", CURR_DIR);
7066 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7068 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7070 size = MAX_PATH;
7071 sprintf(path, "%s\\", CURR_DIR);
7072 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7074 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7076 size = MAX_PATH;
7077 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7079 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7081 size = MAX_PATH;
7082 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
7083 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7085 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7087 size = MAX_PATH;
7088 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7090 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7092 size = MAX_PATH;
7093 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
7094 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7096 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7098 if (version)
7100 size = MAX_PATH;
7101 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7102 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7104 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7106 size = MAX_PATH;
7107 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7109 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7111 size = MAX_PATH;
7112 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7114 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7117 DeleteFileA("FileName1");
7118 DeleteFileA("FileName3.dll");
7119 DeleteFileA("FileName4.dll");
7120 DeleteFileA("FileName5.dll");
7121 DeleteFileA("one\\two\\three\\FileName2");
7122 RemoveDirectoryA("one\\two\\three");
7123 RemoveDirectoryA("one\\two");
7124 RemoveDirectoryA("one");
7125 RemoveDirectoryA("another");
7126 MsiCloseHandle(hpkg);
7127 DeleteFileA(msifile);
7130 static void test_featureparents(void)
7132 MSIHANDLE hpkg;
7133 UINT r;
7134 MSIHANDLE hdb;
7135 INSTALLSTATE state, action;
7137 hdb = create_package_db();
7138 ok ( hdb, "failed to create package database\n" );
7140 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7141 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7143 r = create_feature_table( hdb );
7144 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7146 r = create_component_table( hdb );
7147 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7149 r = create_feature_components_table( hdb );
7150 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7152 r = create_file_table( hdb );
7153 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7155 /* msidbFeatureAttributesFavorLocal */
7156 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
7157 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7159 /* msidbFeatureAttributesFavorSource */
7160 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
7161 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7163 /* msidbFeatureAttributesFavorLocal */
7164 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
7165 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7167 /* disabled because of install level */
7168 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
7169 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7171 /* child feature of disabled feature */
7172 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
7173 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7175 /* component of disabled feature (install level) */
7176 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
7177 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7179 /* component of disabled child feature (install level) */
7180 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
7181 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7183 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
7184 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
7185 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7187 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
7188 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
7189 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7191 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
7192 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
7193 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7195 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
7196 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
7197 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7199 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
7200 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
7201 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7203 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
7204 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
7205 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7207 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
7208 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
7209 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7211 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
7212 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
7213 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7215 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
7216 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
7218 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
7219 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7221 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
7222 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7224 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
7225 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7227 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
7228 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7230 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
7231 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7233 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
7234 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7236 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
7237 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7239 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
7240 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7242 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
7243 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7245 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
7246 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7248 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
7249 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7251 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
7252 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7254 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
7255 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7257 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
7258 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7260 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
7261 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7263 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
7264 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7266 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
7267 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7269 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
7270 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7272 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
7273 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7275 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
7276 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7278 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
7279 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7281 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
7282 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7284 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
7285 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7287 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
7288 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7290 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
7291 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7293 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
7294 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7296 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
7297 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7299 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
7300 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7302 hpkg = package_from_db( hdb );
7303 ok( hpkg, "failed to create package\n");
7305 MsiCloseHandle( hdb );
7307 r = MsiDoAction( hpkg, "CostInitialize");
7308 ok( r == ERROR_SUCCESS, "cost init failed\n");
7310 r = MsiDoAction( hpkg, "FileCost");
7311 ok( r == ERROR_SUCCESS, "file cost failed\n");
7313 r = MsiDoAction( hpkg, "CostFinalize");
7314 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7316 state = 0xdeadbee;
7317 action = 0xdeadbee;
7318 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
7319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7320 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7321 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7323 state = 0xdeadbee;
7324 action = 0xdeadbee;
7325 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
7326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7327 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7328 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7330 state = 0xdeadbee;
7331 action = 0xdeadbee;
7332 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
7333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7334 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7335 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7337 state = 0xdeadbee;
7338 action = 0xdeadbee;
7339 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
7340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7341 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7344 state = 0xdeadbee;
7345 action = 0xdeadbee;
7346 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
7347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7348 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7351 state = 0xdeadbee;
7352 action = 0xdeadbee;
7353 r = MsiGetComponentState(hpkg, "leo", &state, &action);
7354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7356 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7358 state = 0xdeadbee;
7359 action = 0xdeadbee;
7360 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
7361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7362 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
7363 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
7365 state = 0xdeadbee;
7366 action = 0xdeadbee;
7367 r = MsiGetComponentState(hpkg, "libra", &state, &action);
7368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7369 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
7370 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
7372 state = 0xdeadbee;
7373 action = 0xdeadbee;
7374 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
7375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7376 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
7377 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
7379 state = 0xdeadbee;
7380 action = 0xdeadbee;
7381 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
7382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7383 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
7384 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
7386 state = 0xdeadbee;
7387 action = 0xdeadbee;
7388 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
7389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7390 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
7391 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
7393 state = 0xdeadbee;
7394 action = 0xdeadbee;
7395 r = MsiGetComponentState(hpkg, "canis", &state, &action);
7396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7397 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
7398 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
7400 state = 0xdeadbee;
7401 action = 0xdeadbee;
7402 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
7403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7404 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
7405 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
7407 state = 0xdeadbee;
7408 action = 0xdeadbee;
7409 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
7410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7411 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
7412 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
7414 state = 0xdeadbee;
7415 action = 0xdeadbee;
7416 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
7417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7418 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
7419 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
7421 state = 0xdeadbee;
7422 action = 0xdeadbee;
7423 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
7424 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7425 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
7426 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
7428 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
7429 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
7431 state = 0xdeadbee;
7432 action = 0xdeadbee;
7433 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
7434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7435 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
7436 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
7438 state = 0xdeadbee;
7439 action = 0xdeadbee;
7440 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
7441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7442 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
7443 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
7445 state = 0xdeadbee;
7446 action = 0xdeadbee;
7447 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
7448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7449 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
7450 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
7452 state = 0xdeadbee;
7453 action = 0xdeadbee;
7454 r = MsiGetComponentState(hpkg, "leo", &state, &action);
7455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7456 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
7457 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
7459 state = 0xdeadbee;
7460 action = 0xdeadbee;
7461 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
7462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7463 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
7464 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
7466 state = 0xdeadbee;
7467 action = 0xdeadbee;
7468 r = MsiGetComponentState(hpkg, "libra", &state, &action);
7469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7470 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
7471 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
7473 state = 0xdeadbee;
7474 action = 0xdeadbee;
7475 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
7476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7477 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
7478 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
7480 state = 0xdeadbee;
7481 action = 0xdeadbee;
7482 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
7483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7484 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
7485 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
7487 state = 0xdeadbee;
7488 action = 0xdeadbee;
7489 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
7490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7491 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
7492 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
7494 state = 0xdeadbee;
7495 action = 0xdeadbee;
7496 r = MsiGetComponentState(hpkg, "canis", &state, &action);
7497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7498 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
7499 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
7501 state = 0xdeadbee;
7502 action = 0xdeadbee;
7503 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
7504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7505 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
7506 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
7508 state = 0xdeadbee;
7509 action = 0xdeadbee;
7510 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
7511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7512 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
7513 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
7515 state = 0xdeadbee;
7516 action = 0xdeadbee;
7517 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
7518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7519 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
7520 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
7522 state = 0xdeadbee;
7523 action = 0xdeadbee;
7524 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
7525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7526 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
7527 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
7529 MsiCloseHandle(hpkg);
7530 DeleteFileA(msifile);
7533 static void test_installprops(void)
7535 MSIHANDLE hpkg, hdb;
7536 CHAR path[MAX_PATH];
7537 CHAR buf[MAX_PATH];
7538 DWORD size, type;
7539 LANGID langid;
7540 HKEY hkey1, hkey2;
7541 int res;
7542 UINT r;
7544 GetCurrentDirectory(MAX_PATH, path);
7545 lstrcat(path, "\\");
7546 lstrcat(path, msifile);
7548 hdb = create_package_db();
7549 ok( hdb, "failed to create database\n");
7551 hpkg = package_from_db(hdb);
7552 ok( hpkg, "failed to create package\n");
7554 MsiCloseHandle(hdb);
7556 size = MAX_PATH;
7557 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
7558 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7559 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
7561 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
7563 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
7565 size = MAX_PATH;
7566 type = REG_SZ;
7567 *path = '\0';
7568 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
7570 size = MAX_PATH;
7571 type = REG_SZ;
7572 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
7575 /* win9x doesn't set this */
7576 if (*path)
7578 size = MAX_PATH;
7579 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
7580 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7581 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
7584 size = MAX_PATH;
7585 type = REG_SZ;
7586 *path = '\0';
7587 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
7589 size = MAX_PATH;
7590 type = REG_SZ;
7591 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
7594 if (*path)
7596 size = MAX_PATH;
7597 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
7598 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7599 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
7602 size = MAX_PATH;
7603 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
7604 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7605 trace("VersionDatabase = %s\n", buf);
7607 size = MAX_PATH;
7608 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
7609 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7610 trace("VersionMsi = %s\n", buf);
7612 size = MAX_PATH;
7613 r = MsiGetProperty(hpkg, "Date", buf, &size);
7614 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7615 trace("Date = %s\n", buf);
7617 size = MAX_PATH;
7618 r = MsiGetProperty(hpkg, "Time", buf, &size);
7619 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7620 trace("Time = %s\n", buf);
7622 size = MAX_PATH;
7623 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
7624 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
7625 trace("PackageCode = %s\n", buf);
7627 langid = GetUserDefaultLangID();
7628 sprintf(path, "%d", langid);
7630 size = MAX_PATH;
7631 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
7632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
7633 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
7635 res = GetSystemMetrics(SM_CXSCREEN);
7636 size = MAX_PATH;
7637 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
7638 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
7640 res = GetSystemMetrics(SM_CYSCREEN);
7641 size = MAX_PATH;
7642 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
7643 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
7645 CloseHandle(hkey1);
7646 CloseHandle(hkey2);
7647 MsiCloseHandle(hpkg);
7648 DeleteFile(msifile);
7651 static void test_launchconditions(void)
7653 MSIHANDLE hpkg;
7654 MSIHANDLE hdb;
7655 UINT r;
7657 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7659 hdb = create_package_db();
7660 ok( hdb, "failed to create package database\n" );
7662 r = create_launchcondition_table( hdb );
7663 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
7665 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
7666 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
7668 /* invalid condition */
7669 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
7670 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
7672 hpkg = package_from_db( hdb );
7673 ok( hpkg, "failed to create package\n");
7675 MsiCloseHandle( hdb );
7677 r = MsiSetProperty( hpkg, "X", "1" );
7678 ok( r == ERROR_SUCCESS, "failed to set property\n" );
7680 /* invalid conditions are ignored */
7681 r = MsiDoAction( hpkg, "LaunchConditions" );
7682 ok( r == ERROR_SUCCESS, "cost init failed\n" );
7684 /* verify LaunchConditions still does some verification */
7685 r = MsiSetProperty( hpkg, "X", "2" );
7686 ok( r == ERROR_SUCCESS, "failed to set property\n" );
7688 r = MsiDoAction( hpkg, "LaunchConditions" );
7689 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
7691 MsiCloseHandle( hpkg );
7692 DeleteFile( msifile );
7695 static void test_ccpsearch(void)
7697 MSIHANDLE hdb, hpkg;
7698 CHAR prop[MAX_PATH];
7699 DWORD size = MAX_PATH;
7700 UINT r;
7702 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7704 hdb = create_package_db();
7705 ok(hdb, "failed to create package database\n");
7707 r = create_ccpsearch_table(hdb);
7708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7710 r = add_ccpsearch_entry(hdb, "'CCP_random'");
7711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7713 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
7714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7716 r = create_reglocator_table(hdb);
7717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7719 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
7720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7722 r = create_drlocator_table(hdb);
7723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7725 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
7726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7728 r = create_signature_table(hdb);
7729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7731 hpkg = package_from_db(hdb);
7732 ok(hpkg, "failed to create package\n");
7734 MsiCloseHandle(hdb);
7736 r = MsiDoAction(hpkg, "CCPSearch");
7737 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7739 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
7740 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7741 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
7743 MsiCloseHandle(hpkg);
7744 DeleteFileA(msifile);
7747 static void test_complocator(void)
7749 MSIHANDLE hdb, hpkg;
7750 UINT r;
7751 CHAR prop[MAX_PATH];
7752 CHAR expected[MAX_PATH];
7753 DWORD size = MAX_PATH;
7755 hdb = create_package_db();
7756 ok(hdb, "failed to create package database\n");
7758 r = create_appsearch_table(hdb);
7759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7761 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
7762 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7764 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
7765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7767 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
7768 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7770 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
7771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7773 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
7774 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7776 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
7777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7779 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
7780 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7782 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
7783 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7785 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
7786 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7788 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
7789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7791 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
7792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7794 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
7795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7797 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
7798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7800 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
7801 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7803 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
7804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7806 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
7807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7809 r = create_complocator_table(hdb);
7810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7812 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
7813 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7815 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
7816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7818 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
7819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7821 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
7822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7824 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
7825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7827 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
7828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7830 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
7831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7833 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
7834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7836 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
7837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7839 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
7840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7842 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
7843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7845 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
7846 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7848 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
7849 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7851 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
7852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7854 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
7855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7857 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
7858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7860 r = create_signature_table(hdb);
7861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7863 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
7864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7866 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
7867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7869 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
7870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7872 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
7873 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7875 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
7876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7878 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
7879 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7881 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
7882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7884 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
7885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7887 hpkg = package_from_db(hdb);
7888 ok(hpkg, "failed to create package\n");
7890 MsiCloseHandle(hdb);
7892 create_test_file("abelisaurus");
7893 create_test_file("bactrosaurus");
7894 create_test_file("camelotia");
7895 create_test_file("diclonius");
7896 create_test_file("echinodon");
7897 create_test_file("falcarius");
7898 create_test_file("gallimimus");
7899 create_test_file("hagryphus");
7900 CreateDirectoryA("iguanodon", NULL);
7901 CreateDirectoryA("jobaria", NULL);
7902 CreateDirectoryA("kakuru", NULL);
7903 CreateDirectoryA("labocania", NULL);
7904 CreateDirectoryA("megaraptor", NULL);
7905 CreateDirectoryA("neosodon", NULL);
7906 CreateDirectoryA("olorotitan", NULL);
7907 CreateDirectoryA("pantydraco", NULL);
7909 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
7910 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
7911 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
7912 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
7913 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
7914 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
7915 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
7916 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
7917 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
7918 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
7919 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
7920 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
7921 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
7922 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
7923 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
7924 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
7926 r = MsiDoAction(hpkg, "AppSearch");
7927 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7929 size = MAX_PATH;
7930 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
7931 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7933 lstrcpyA(expected, CURR_DIR);
7934 lstrcatA(expected, "\\abelisaurus");
7935 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
7936 "Expected %s or empty string, got %s\n", expected, prop);
7938 size = MAX_PATH;
7939 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
7940 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7941 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7943 size = MAX_PATH;
7944 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
7945 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7946 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7948 size = MAX_PATH;
7949 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
7950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7951 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7953 size = MAX_PATH;
7954 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
7955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7957 lstrcpyA(expected, CURR_DIR);
7958 lstrcatA(expected, "\\");
7959 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
7960 "Expected %s or empty string, got %s\n", expected, prop);
7962 size = MAX_PATH;
7963 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
7964 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7965 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7967 size = MAX_PATH;
7968 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
7969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7970 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7972 size = MAX_PATH;
7973 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
7974 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7975 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7977 size = MAX_PATH;
7978 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
7979 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7980 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7982 size = MAX_PATH;
7983 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
7984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7985 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7987 size = MAX_PATH;
7988 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
7989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7990 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7992 size = MAX_PATH;
7993 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
7994 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7995 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
7997 size = MAX_PATH;
7998 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
7999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8001 lstrcpyA(expected, CURR_DIR);
8002 lstrcatA(expected, "\\");
8003 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
8004 "Expected %s or empty string, got %s\n", expected, prop);
8006 size = MAX_PATH;
8007 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
8008 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8010 lstrcpyA(expected, CURR_DIR);
8011 lstrcatA(expected, "\\neosodon\\");
8012 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
8013 "Expected %s or empty string, got %s\n", expected, prop);
8015 size = MAX_PATH;
8016 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
8017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8018 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
8020 size = MAX_PATH;
8021 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
8022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8023 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
8025 MsiCloseHandle(hpkg);
8026 DeleteFileA("abelisaurus");
8027 DeleteFileA("bactrosaurus");
8028 DeleteFileA("camelotia");
8029 DeleteFileA("diclonius");
8030 DeleteFileA("echinodon");
8031 DeleteFileA("falcarius");
8032 DeleteFileA("gallimimus");
8033 DeleteFileA("hagryphus");
8034 RemoveDirectoryA("iguanodon");
8035 RemoveDirectoryA("jobaria");
8036 RemoveDirectoryA("kakuru");
8037 RemoveDirectoryA("labocania");
8038 RemoveDirectoryA("megaraptor");
8039 RemoveDirectoryA("neosodon");
8040 RemoveDirectoryA("olorotitan");
8041 RemoveDirectoryA("pantydraco");
8042 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
8043 MSIINSTALLCONTEXT_MACHINE, NULL);
8044 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
8045 MSIINSTALLCONTEXT_MACHINE, NULL);
8046 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
8047 MSIINSTALLCONTEXT_MACHINE, NULL);
8048 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
8049 MSIINSTALLCONTEXT_MACHINE, NULL);
8050 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
8051 MSIINSTALLCONTEXT_MACHINE, NULL);
8052 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
8053 MSIINSTALLCONTEXT_MACHINE, NULL);
8054 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
8055 MSIINSTALLCONTEXT_MACHINE, NULL);
8056 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
8057 MSIINSTALLCONTEXT_MACHINE, NULL);
8058 DeleteFileA(msifile);
8061 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
8063 MSIHANDLE summary;
8064 UINT r;
8066 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
8067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8069 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
8070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8072 r = MsiSummaryInfoPersist(summary);
8073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8075 MsiCloseHandle(summary);
8078 static void test_MsiGetSourcePath(void)
8080 MSIHANDLE hdb, hpkg;
8081 CHAR path[MAX_PATH];
8082 CHAR cwd[MAX_PATH];
8083 CHAR subsrc[MAX_PATH];
8084 CHAR sub2[MAX_PATH];
8085 DWORD size;
8086 UINT r;
8088 lstrcpyA(cwd, CURR_DIR);
8089 lstrcatA(cwd, "\\");
8091 lstrcpyA(subsrc, cwd);
8092 lstrcatA(subsrc, "subsource");
8093 lstrcatA(subsrc, "\\");
8095 lstrcpyA(sub2, subsrc);
8096 lstrcatA(sub2, "sub2");
8097 lstrcatA(sub2, "\\");
8099 /* uncompressed source */
8101 hdb = create_package_db();
8102 ok( hdb, "failed to create database\n");
8104 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
8106 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
8107 ok(r == S_OK, "failed\n");
8109 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
8110 ok(r == S_OK, "failed\n");
8112 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
8113 ok(r == S_OK, "failed\n");
8115 r = MsiDatabaseCommit(hdb);
8116 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
8118 hpkg = package_from_db(hdb);
8119 ok(hpkg, "failed to create package\n");
8121 MsiCloseHandle(hdb);
8123 /* invalid database handle */
8124 size = MAX_PATH;
8125 lstrcpyA(path, "kiwi");
8126 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
8127 ok(r == ERROR_INVALID_HANDLE,
8128 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
8129 ok(!lstrcmpA(path, "kiwi"),
8130 "Expected path to be unchanged, got \"%s\"\n", path);
8131 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8133 /* NULL szFolder */
8134 size = MAX_PATH;
8135 lstrcpyA(path, "kiwi");
8136 r = MsiGetSourcePath(hpkg, NULL, path, &size);
8137 ok(r == ERROR_INVALID_PARAMETER,
8138 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8139 ok(!lstrcmpA(path, "kiwi"),
8140 "Expected path to be unchanged, got \"%s\"\n", path);
8141 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8143 /* empty szFolder */
8144 size = MAX_PATH;
8145 lstrcpyA(path, "kiwi");
8146 r = MsiGetSourcePath(hpkg, "", path, &size);
8147 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8148 ok(!lstrcmpA(path, "kiwi"),
8149 "Expected path to be unchanged, got \"%s\"\n", path);
8150 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8152 /* try TARGETDIR */
8153 size = MAX_PATH;
8154 lstrcpyA(path, "kiwi");
8155 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
8156 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8157 ok(!lstrcmpA(path, "kiwi"),
8158 "Expected path to be unchanged, got \"%s\"\n", path);
8159 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8161 /* try SourceDir */
8162 size = MAX_PATH;
8163 lstrcpyA(path, "kiwi");
8164 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8165 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8166 ok(!lstrcmpA(path, "kiwi"),
8167 "Expected path to be unchanged, got \"%s\"\n", path);
8168 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8170 /* try SOURCEDIR */
8171 size = MAX_PATH;
8172 lstrcpyA(path, "kiwi");
8173 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
8174 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8175 ok(!lstrcmpA(path, "kiwi"),
8176 "Expected path to be unchanged, got \"%s\"\n", path);
8177 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8179 /* source path does not exist, but the property exists */
8180 size = MAX_PATH;
8181 lstrcpyA(path, "kiwi");
8182 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8183 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8184 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8185 ok(size == 0, "Expected 0, got %d\n", size);
8187 /* try SubDir */
8188 size = MAX_PATH;
8189 lstrcpyA(path, "kiwi");
8190 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8191 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8192 ok(!lstrcmpA(path, "kiwi"),
8193 "Expected path to be unchanged, got \"%s\"\n", path);
8194 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8196 /* try SubDir2 */
8197 size = MAX_PATH;
8198 lstrcpyA(path, "kiwi");
8199 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8200 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8201 ok(!lstrcmpA(path, "kiwi"),
8202 "Expected path to be unchanged, got \"%s\"\n", path);
8203 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8205 r = MsiDoAction(hpkg, "CostInitialize");
8206 ok(r == ERROR_SUCCESS, "cost init failed\n");
8208 /* try TARGETDIR after CostInitialize */
8209 size = MAX_PATH;
8210 lstrcpyA(path, "kiwi");
8211 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
8212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8213 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8214 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8216 /* try SourceDir after CostInitialize */
8217 size = MAX_PATH;
8218 lstrcpyA(path, "kiwi");
8219 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8221 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8222 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8224 /* try SOURCEDIR after CostInitialize */
8225 size = MAX_PATH;
8226 lstrcpyA(path, "kiwi");
8227 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
8228 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8229 ok(!lstrcmpA(path, "kiwi"),
8230 "Expected path to be unchanged, got \"%s\"\n", path);
8231 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8233 /* source path does not exist, but the property exists */
8234 size = MAX_PATH;
8235 lstrcpyA(path, "kiwi");
8236 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8237 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8238 todo_wine
8240 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8241 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8244 /* try SubDir after CostInitialize */
8245 size = MAX_PATH;
8246 lstrcpyA(path, "kiwi");
8247 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8248 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8249 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8250 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8252 /* try SubDir2 after CostInitialize */
8253 size = MAX_PATH;
8254 lstrcpyA(path, "kiwi");
8255 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8257 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
8258 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
8260 r = MsiDoAction(hpkg, "ResolveSource");
8261 ok(r == ERROR_SUCCESS, "file cost failed\n");
8263 /* try TARGETDIR after ResolveSource */
8264 size = MAX_PATH;
8265 lstrcpyA(path, "kiwi");
8266 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
8267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8268 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8269 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8271 /* try SourceDir after ResolveSource */
8272 size = MAX_PATH;
8273 lstrcpyA(path, "kiwi");
8274 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8275 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8276 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8277 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8279 /* try SOURCEDIR after ResolveSource */
8280 size = MAX_PATH;
8281 lstrcpyA(path, "kiwi");
8282 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
8283 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8284 ok(!lstrcmpA(path, "kiwi"),
8285 "Expected path to be unchanged, got \"%s\"\n", path);
8286 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8288 /* source path does not exist, but the property exists */
8289 size = MAX_PATH;
8290 lstrcpyA(path, "kiwi");
8291 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8293 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8294 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8296 /* try SubDir after ResolveSource */
8297 size = MAX_PATH;
8298 lstrcpyA(path, "kiwi");
8299 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8301 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8302 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8304 /* try SubDir2 after ResolveSource */
8305 size = MAX_PATH;
8306 lstrcpyA(path, "kiwi");
8307 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8308 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8309 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
8310 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
8312 r = MsiDoAction(hpkg, "FileCost");
8313 ok(r == ERROR_SUCCESS, "file cost failed\n");
8315 /* try TARGETDIR after FileCost */
8316 size = MAX_PATH;
8317 lstrcpyA(path, "kiwi");
8318 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
8319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8320 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8321 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8323 /* try SourceDir after FileCost */
8324 size = MAX_PATH;
8325 lstrcpyA(path, "kiwi");
8326 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8328 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8329 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8331 /* try SOURCEDIR after FileCost */
8332 size = MAX_PATH;
8333 lstrcpyA(path, "kiwi");
8334 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
8335 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8336 ok(!lstrcmpA(path, "kiwi"),
8337 "Expected path to be unchanged, got \"%s\"\n", path);
8338 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8340 /* try SubDir after FileCost */
8341 size = MAX_PATH;
8342 lstrcpyA(path, "kiwi");
8343 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8345 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8346 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8348 /* try SubDir2 after FileCost */
8349 size = MAX_PATH;
8350 lstrcpyA(path, "kiwi");
8351 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8352 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8353 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
8354 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
8356 r = MsiDoAction(hpkg, "CostFinalize");
8357 ok(r == ERROR_SUCCESS, "file cost failed\n");
8359 /* try TARGETDIR after CostFinalize */
8360 size = MAX_PATH;
8361 lstrcpyA(path, "kiwi");
8362 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
8363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8364 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8365 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8367 /* try SourceDir after CostFinalize */
8368 size = MAX_PATH;
8369 lstrcpyA(path, "kiwi");
8370 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8372 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8373 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8375 /* try SOURCEDIR after CostFinalize */
8376 size = MAX_PATH;
8377 lstrcpyA(path, "kiwi");
8378 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
8379 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8380 ok(!lstrcmpA(path, "kiwi"),
8381 "Expected path to be unchanged, got \"%s\"\n", path);
8382 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8384 /* try SubDir after CostFinalize */
8385 size = MAX_PATH;
8386 lstrcpyA(path, "kiwi");
8387 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8389 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8390 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8392 /* try SubDir2 after CostFinalize */
8393 size = MAX_PATH;
8394 lstrcpyA(path, "kiwi");
8395 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8397 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
8398 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
8400 /* nonexistent directory */
8401 size = MAX_PATH;
8402 lstrcpyA(path, "kiwi");
8403 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
8404 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
8405 ok(!lstrcmpA(path, "kiwi"),
8406 "Expected path to be unchanged, got \"%s\"\n", path);
8407 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
8409 /* NULL szPathBuf */
8410 size = MAX_PATH;
8411 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
8412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8413 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8415 /* NULL pcchPathBuf */
8416 lstrcpyA(path, "kiwi");
8417 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
8418 ok(r == ERROR_INVALID_PARAMETER,
8419 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8420 ok(!lstrcmpA(path, "kiwi"),
8421 "Expected path to be unchanged, got \"%s\"\n", path);
8423 /* pcchPathBuf is 0 */
8424 size = 0;
8425 lstrcpyA(path, "kiwi");
8426 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8427 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
8428 ok(!lstrcmpA(path, "kiwi"),
8429 "Expected path to be unchanged, got \"%s\"\n", path);
8430 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8432 /* pcchPathBuf does not have room for NULL terminator */
8433 size = lstrlenA(cwd);
8434 lstrcpyA(path, "kiwi");
8435 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8436 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
8437 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
8438 "Expected path with no backslash, got \"%s\"\n", path);
8439 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8441 /* pcchPathBuf has room for NULL terminator */
8442 size = lstrlenA(cwd) + 1;
8443 lstrcpyA(path, "kiwi");
8444 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8446 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8447 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8449 MsiCloseHandle(hpkg);
8451 /* compressed source */
8453 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
8458 hpkg = package_from_db(hdb);
8459 ok(hpkg, "failed to create package\n");
8461 r = MsiDoAction(hpkg, "CostInitialize");
8462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8463 r = MsiDoAction(hpkg, "FileCost");
8464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 r = MsiDoAction(hpkg, "CostFinalize");
8466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8468 /* try TARGETDIR after CostFinalize */
8469 size = MAX_PATH;
8470 lstrcpyA(path, "kiwi");
8471 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
8472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8473 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8474 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8476 /* try SourceDir after CostFinalize */
8477 size = MAX_PATH;
8478 lstrcpyA(path, "kiwi");
8479 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
8480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8481 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8482 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8484 /* try SOURCEDIR after CostFinalize */
8485 size = MAX_PATH;
8486 lstrcpyA(path, "kiwi");
8487 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
8488 todo_wine
8490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8491 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8492 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8495 /* try SubDir after CostFinalize */
8496 size = MAX_PATH;
8497 lstrcpyA(path, "kiwi");
8498 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8500 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8501 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8503 /* try SubDir2 after CostFinalize */
8504 size = MAX_PATH;
8505 lstrcpyA(path, "kiwi");
8506 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8508 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8509 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8511 MsiCloseHandle(hpkg);
8512 DeleteFile(msifile);
8515 static void test_shortlongsource(void)
8517 MSIHANDLE hdb, hpkg;
8518 CHAR path[MAX_PATH];
8519 CHAR cwd[MAX_PATH];
8520 CHAR subsrc[MAX_PATH];
8521 DWORD size;
8522 UINT r;
8524 lstrcpyA(cwd, CURR_DIR);
8525 lstrcatA(cwd, "\\");
8527 lstrcpyA(subsrc, cwd);
8528 lstrcatA(subsrc, "long");
8529 lstrcatA(subsrc, "\\");
8531 /* long file names */
8533 hdb = create_package_db();
8534 ok( hdb, "failed to create database\n");
8536 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
8538 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
8539 ok(r == S_OK, "failed\n");
8541 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
8542 ok(r == S_OK, "failed\n");
8544 /* CostInitialize:short */
8545 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
8546 ok(r == S_OK, "failed\n");
8548 /* CostInitialize:long */
8549 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
8550 ok(r == S_OK, "failed\n");
8552 /* FileCost:short */
8553 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
8554 ok(r == S_OK, "failed\n");
8556 /* FileCost:long */
8557 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
8558 ok(r == S_OK, "failed\n");
8560 /* CostFinalize:short */
8561 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
8562 ok(r == S_OK, "failed\n");
8564 /* CostFinalize:long */
8565 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
8566 ok(r == S_OK, "failed\n");
8568 MsiDatabaseCommit(hdb);
8570 hpkg = package_from_db(hdb);
8571 ok(hpkg, "failed to create package\n");
8573 MsiCloseHandle(hdb);
8575 CreateDirectoryA("one", NULL);
8576 CreateDirectoryA("four", NULL);
8578 r = MsiDoAction(hpkg, "CostInitialize");
8579 ok(r == ERROR_SUCCESS, "file cost failed\n");
8581 CreateDirectory("five", NULL);
8582 CreateDirectory("eight", NULL);
8584 r = MsiDoAction(hpkg, "FileCost");
8585 ok(r == ERROR_SUCCESS, "file cost failed\n");
8587 CreateDirectory("nine", NULL);
8588 CreateDirectory("twelve", NULL);
8590 r = MsiDoAction(hpkg, "CostFinalize");
8591 ok(r == ERROR_SUCCESS, "file cost failed\n");
8593 /* neither short nor long source directories exist */
8594 size = MAX_PATH;
8595 lstrcpyA(path, "kiwi");
8596 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8598 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8599 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8601 CreateDirectoryA("short", NULL);
8603 /* short source directory exists */
8604 size = MAX_PATH;
8605 lstrcpyA(path, "kiwi");
8606 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8608 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8609 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8611 CreateDirectoryA("long", NULL);
8613 /* both short and long source directories exist */
8614 size = MAX_PATH;
8615 lstrcpyA(path, "kiwi");
8616 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8618 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8619 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8621 lstrcpyA(subsrc, cwd);
8622 lstrcatA(subsrc, "two");
8623 lstrcatA(subsrc, "\\");
8625 /* short dir exists before CostInitialize */
8626 size = MAX_PATH;
8627 lstrcpyA(path, "kiwi");
8628 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8630 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8631 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8633 lstrcpyA(subsrc, cwd);
8634 lstrcatA(subsrc, "four");
8635 lstrcatA(subsrc, "\\");
8637 /* long dir exists before CostInitialize */
8638 size = MAX_PATH;
8639 lstrcpyA(path, "kiwi");
8640 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
8641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8642 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8643 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8645 lstrcpyA(subsrc, cwd);
8646 lstrcatA(subsrc, "six");
8647 lstrcatA(subsrc, "\\");
8649 /* short dir exists before FileCost */
8650 size = MAX_PATH;
8651 lstrcpyA(path, "kiwi");
8652 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
8653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8654 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8655 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8657 lstrcpyA(subsrc, cwd);
8658 lstrcatA(subsrc, "eight");
8659 lstrcatA(subsrc, "\\");
8661 /* long dir exists before FileCost */
8662 size = MAX_PATH;
8663 lstrcpyA(path, "kiwi");
8664 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
8665 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8666 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8667 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8669 lstrcpyA(subsrc, cwd);
8670 lstrcatA(subsrc, "ten");
8671 lstrcatA(subsrc, "\\");
8673 /* short dir exists before CostFinalize */
8674 size = MAX_PATH;
8675 lstrcpyA(path, "kiwi");
8676 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
8677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8678 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8679 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8681 lstrcpyA(subsrc, cwd);
8682 lstrcatA(subsrc, "twelve");
8683 lstrcatA(subsrc, "\\");
8685 /* long dir exists before CostFinalize */
8686 size = MAX_PATH;
8687 lstrcpyA(path, "kiwi");
8688 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
8689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8690 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8691 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8693 MsiCloseHandle(hpkg);
8694 RemoveDirectoryA("short");
8695 RemoveDirectoryA("long");
8696 RemoveDirectoryA("one");
8697 RemoveDirectoryA("four");
8698 RemoveDirectoryA("five");
8699 RemoveDirectoryA("eight");
8700 RemoveDirectoryA("nine");
8701 RemoveDirectoryA("twelve");
8703 /* short file names */
8705 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
8706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8708 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
8710 hpkg = package_from_db(hdb);
8711 ok(hpkg, "failed to create package\n");
8713 MsiCloseHandle(hdb);
8715 CreateDirectoryA("one", NULL);
8716 CreateDirectoryA("four", NULL);
8718 r = MsiDoAction(hpkg, "CostInitialize");
8719 ok(r == ERROR_SUCCESS, "file cost failed\n");
8721 CreateDirectory("five", NULL);
8722 CreateDirectory("eight", NULL);
8724 r = MsiDoAction(hpkg, "FileCost");
8725 ok(r == ERROR_SUCCESS, "file cost failed\n");
8727 CreateDirectory("nine", NULL);
8728 CreateDirectory("twelve", NULL);
8730 r = MsiDoAction(hpkg, "CostFinalize");
8731 ok(r == ERROR_SUCCESS, "file cost failed\n");
8733 lstrcpyA(subsrc, cwd);
8734 lstrcatA(subsrc, "short");
8735 lstrcatA(subsrc, "\\");
8737 /* neither short nor long source directories exist */
8738 size = MAX_PATH;
8739 lstrcpyA(path, "kiwi");
8740 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8742 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8743 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8745 CreateDirectoryA("short", NULL);
8747 /* short source directory exists */
8748 size = MAX_PATH;
8749 lstrcpyA(path, "kiwi");
8750 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8751 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8752 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8753 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8755 CreateDirectoryA("long", NULL);
8757 /* both short and long source directories exist */
8758 size = MAX_PATH;
8759 lstrcpyA(path, "kiwi");
8760 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
8761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8762 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8763 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8765 lstrcpyA(subsrc, cwd);
8766 lstrcatA(subsrc, "one");
8767 lstrcatA(subsrc, "\\");
8769 /* short dir exists before CostInitialize */
8770 size = MAX_PATH;
8771 lstrcpyA(path, "kiwi");
8772 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
8773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8774 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8775 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8777 lstrcpyA(subsrc, cwd);
8778 lstrcatA(subsrc, "three");
8779 lstrcatA(subsrc, "\\");
8781 /* long dir exists before CostInitialize */
8782 size = MAX_PATH;
8783 lstrcpyA(path, "kiwi");
8784 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
8785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8786 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8787 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8789 lstrcpyA(subsrc, cwd);
8790 lstrcatA(subsrc, "five");
8791 lstrcatA(subsrc, "\\");
8793 /* short dir exists before FileCost */
8794 size = MAX_PATH;
8795 lstrcpyA(path, "kiwi");
8796 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
8797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8798 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8799 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8801 lstrcpyA(subsrc, cwd);
8802 lstrcatA(subsrc, "seven");
8803 lstrcatA(subsrc, "\\");
8805 /* long dir exists before FileCost */
8806 size = MAX_PATH;
8807 lstrcpyA(path, "kiwi");
8808 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
8809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8810 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8811 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8813 lstrcpyA(subsrc, cwd);
8814 lstrcatA(subsrc, "nine");
8815 lstrcatA(subsrc, "\\");
8817 /* short dir exists before CostFinalize */
8818 size = MAX_PATH;
8819 lstrcpyA(path, "kiwi");
8820 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
8821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8822 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8823 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8825 lstrcpyA(subsrc, cwd);
8826 lstrcatA(subsrc, "eleven");
8827 lstrcatA(subsrc, "\\");
8829 /* long dir exists before CostFinalize */
8830 size = MAX_PATH;
8831 lstrcpyA(path, "kiwi");
8832 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
8833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8834 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
8835 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
8837 MsiCloseHandle(hpkg);
8838 RemoveDirectoryA("short");
8839 RemoveDirectoryA("long");
8840 RemoveDirectoryA("one");
8841 RemoveDirectoryA("four");
8842 RemoveDirectoryA("five");
8843 RemoveDirectoryA("eight");
8844 RemoveDirectoryA("nine");
8845 RemoveDirectoryA("twelve");
8846 DeleteFileA(msifile);
8849 static void test_sourcedir(void)
8851 MSIHANDLE hdb, hpkg;
8852 CHAR package[10];
8853 CHAR path[MAX_PATH];
8854 CHAR cwd[MAX_PATH];
8855 CHAR subsrc[MAX_PATH];
8856 DWORD size;
8857 UINT r;
8859 lstrcpyA(cwd, CURR_DIR);
8860 lstrcatA(cwd, "\\");
8862 lstrcpyA(subsrc, cwd);
8863 lstrcatA(subsrc, "long");
8864 lstrcatA(subsrc, "\\");
8866 hdb = create_package_db();
8867 ok( hdb, "failed to create database\n");
8869 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
8870 ok(r == S_OK, "failed\n");
8872 sprintf(package, "#%li", hdb);
8873 r = MsiOpenPackage(package, &hpkg);
8874 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8876 /* properties only */
8878 /* SourceDir prop */
8879 size = MAX_PATH;
8880 lstrcpyA(path, "kiwi");
8881 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
8882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8883 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8884 ok(size == 0, "Expected 0, got %d\n", size);
8886 /* SOURCEDIR prop */
8887 size = MAX_PATH;
8888 lstrcpyA(path, "kiwi");
8889 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8890 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8891 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8892 ok(size == 0, "Expected 0, got %d\n", size);
8894 r = MsiDoAction(hpkg, "CostInitialize");
8895 ok(r == ERROR_SUCCESS, "file cost failed\n");
8897 /* SourceDir after CostInitialize */
8898 size = MAX_PATH;
8899 lstrcpyA(path, "kiwi");
8900 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
8901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8902 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8903 ok(size == 0, "Expected 0, got %d\n", size);
8905 /* SOURCEDIR after CostInitialize */
8906 size = MAX_PATH;
8907 lstrcpyA(path, "kiwi");
8908 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8909 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8910 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8911 ok(size == 0, "Expected 0, got %d\n", size);
8913 r = MsiDoAction(hpkg, "FileCost");
8914 ok(r == ERROR_SUCCESS, "file cost failed\n");
8916 /* SourceDir after FileCost */
8917 size = MAX_PATH;
8918 lstrcpyA(path, "kiwi");
8919 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
8920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8921 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8922 ok(size == 0, "Expected 0, got %d\n", size);
8924 /* SOURCEDIR after FileCost */
8925 size = MAX_PATH;
8926 lstrcpyA(path, "kiwi");
8927 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8928 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8929 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8930 ok(size == 0, "Expected 0, got %d\n", size);
8932 r = MsiDoAction(hpkg, "CostFinalize");
8933 ok(r == ERROR_SUCCESS, "file cost failed\n");
8935 /* SourceDir after CostFinalize */
8936 size = MAX_PATH;
8937 lstrcpyA(path, "kiwi");
8938 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
8939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8940 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8941 ok(size == 0, "Expected 0, got %d\n", size);
8943 /* SOURCEDIR after CostFinalize */
8944 size = MAX_PATH;
8945 lstrcpyA(path, "kiwi");
8946 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8948 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8949 ok(size == 0, "Expected 0, got %d\n", size);
8951 r = MsiDoAction(hpkg, "ResolveSource");
8952 ok(r == ERROR_SUCCESS, "file cost failed\n");
8954 /* SourceDir after ResolveSource */
8955 size = MAX_PATH;
8956 lstrcpyA(path, "kiwi");
8957 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
8958 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8959 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8960 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8962 /* SOURCEDIR after ResolveSource */
8963 size = MAX_PATH;
8964 lstrcpyA(path, "kiwi");
8965 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
8966 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8967 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
8968 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
8970 /* random casing */
8971 size = MAX_PATH;
8972 lstrcpyA(path, "kiwi");
8973 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
8974 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8975 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8976 ok(size == 0, "Expected 0, got %d\n", size);
8978 MsiCloseHandle(hpkg);
8980 /* reset the package state */
8981 sprintf(package, "#%li", hdb);
8982 r = MsiOpenPackage(package, &hpkg);
8983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8985 /* test how MsiGetSourcePath affects the properties */
8987 /* SourceDir prop */
8988 size = MAX_PATH;
8989 lstrcpyA(path, "kiwi");
8990 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
8991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8992 todo_wine
8994 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
8995 ok(size == 0, "Expected 0, got %d\n", size);
8998 size = MAX_PATH;
8999 lstrcpyA(path, "kiwi");
9000 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9001 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9002 ok(!lstrcmpA(path, "kiwi"),
9003 "Expected path to be unchanged, got \"%s\"\n", path);
9004 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9006 /* SourceDir after MsiGetSourcePath */
9007 size = MAX_PATH;
9008 lstrcpyA(path, "kiwi");
9009 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
9010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9011 todo_wine
9013 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9014 ok(size == 0, "Expected 0, got %d\n", size);
9017 /* SOURCEDIR prop */
9018 size = MAX_PATH;
9019 lstrcpyA(path, "kiwi");
9020 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9021 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9022 todo_wine
9024 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9025 ok(size == 0, "Expected 0, got %d\n", size);
9028 size = MAX_PATH;
9029 lstrcpyA(path, "kiwi");
9030 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9031 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9032 ok(!lstrcmpA(path, "kiwi"),
9033 "Expected path to be unchanged, got \"%s\"\n", path);
9034 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9036 /* SOURCEDIR prop after MsiGetSourcePath */
9037 size = MAX_PATH;
9038 lstrcpyA(path, "kiwi");
9039 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9041 todo_wine
9043 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9044 ok(size == 0, "Expected 0, got %d\n", size);
9047 r = MsiDoAction(hpkg, "CostInitialize");
9048 ok(r == ERROR_SUCCESS, "file cost failed\n");
9050 /* SourceDir after CostInitialize */
9051 size = MAX_PATH;
9052 lstrcpyA(path, "kiwi");
9053 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
9054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9055 todo_wine
9057 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9058 ok(size == 0, "Expected 0, got %d\n", size);
9061 size = MAX_PATH;
9062 lstrcpyA(path, "kiwi");
9063 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9065 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9066 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9068 /* SourceDir after MsiGetSourcePath */
9069 size = MAX_PATH;
9070 lstrcpyA(path, "kiwi");
9071 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
9072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9073 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9074 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9076 /* SOURCEDIR after CostInitialize */
9077 size = MAX_PATH;
9078 lstrcpyA(path, "kiwi");
9079 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9081 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9082 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9084 /* SOURCEDIR source path still does not exist */
9085 size = MAX_PATH;
9086 lstrcpyA(path, "kiwi");
9087 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9088 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9089 ok(!lstrcmpA(path, "kiwi"),
9090 "Expected path to be unchanged, got \"%s\"\n", path);
9091 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9093 r = MsiDoAction(hpkg, "FileCost");
9094 ok(r == ERROR_SUCCESS, "file cost failed\n");
9096 /* SourceDir after FileCost */
9097 size = MAX_PATH;
9098 lstrcpyA(path, "kiwi");
9099 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
9100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9101 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9102 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9104 /* SOURCEDIR after FileCost */
9105 size = MAX_PATH;
9106 lstrcpyA(path, "kiwi");
9107 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9109 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9110 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9112 /* SOURCEDIR source path still does not exist */
9113 size = MAX_PATH;
9114 lstrcpyA(path, "kiwi");
9115 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9116 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9117 ok(!lstrcmpA(path, "kiwi"),
9118 "Expected path to be unchanged, got \"%s\"\n", path);
9119 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9121 r = MsiDoAction(hpkg, "CostFinalize");
9122 ok(r == ERROR_SUCCESS, "file cost failed\n");
9124 /* SourceDir after CostFinalize */
9125 size = MAX_PATH;
9126 lstrcpyA(path, "kiwi");
9127 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
9128 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9129 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9130 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9132 /* SOURCEDIR after CostFinalize */
9133 size = MAX_PATH;
9134 lstrcpyA(path, "kiwi");
9135 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9137 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9138 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9140 /* SOURCEDIR source path still does not exist */
9141 size = MAX_PATH;
9142 lstrcpyA(path, "kiwi");
9143 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9144 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9145 ok(!lstrcmpA(path, "kiwi"),
9146 "Expected path to be unchanged, got \"%s\"\n", path);
9147 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9149 r = MsiDoAction(hpkg, "ResolveSource");
9150 ok(r == ERROR_SUCCESS, "file cost failed\n");
9152 /* SourceDir after ResolveSource */
9153 size = MAX_PATH;
9154 lstrcpyA(path, "kiwi");
9155 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
9156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9157 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9158 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9160 /* SOURCEDIR after ResolveSource */
9161 size = MAX_PATH;
9162 lstrcpyA(path, "kiwi");
9163 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9164 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9165 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9166 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9168 /* SOURCEDIR source path still does not exist */
9169 size = MAX_PATH;
9170 lstrcpyA(path, "kiwi");
9171 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9172 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9173 ok(!lstrcmpA(path, "kiwi"),
9174 "Expected path to be unchanged, got \"%s\"\n", path);
9175 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9177 MsiCloseHandle(hdb);
9178 MsiCloseHandle(hpkg);
9179 DeleteFileA(msifile);
9182 struct access_res
9184 BOOL gothandle;
9185 DWORD lasterr;
9186 BOOL ignore;
9189 static const struct access_res create[16] =
9191 { TRUE, ERROR_SUCCESS, TRUE },
9192 { TRUE, ERROR_SUCCESS, TRUE },
9193 { TRUE, ERROR_SUCCESS, FALSE },
9194 { TRUE, ERROR_SUCCESS, FALSE },
9195 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9196 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9197 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9198 { TRUE, ERROR_SUCCESS, FALSE },
9199 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9200 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9201 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9202 { TRUE, ERROR_SUCCESS, TRUE },
9203 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9204 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9205 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9206 { TRUE, ERROR_SUCCESS, TRUE }
9209 static const struct access_res create_commit[16] =
9211 { TRUE, ERROR_SUCCESS, TRUE },
9212 { TRUE, ERROR_SUCCESS, TRUE },
9213 { TRUE, ERROR_SUCCESS, FALSE },
9214 { TRUE, ERROR_SUCCESS, FALSE },
9215 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9216 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9217 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9218 { TRUE, ERROR_SUCCESS, FALSE },
9219 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9220 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9221 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9222 { TRUE, ERROR_SUCCESS, TRUE },
9223 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9224 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9225 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
9226 { TRUE, ERROR_SUCCESS, TRUE }
9229 static const struct access_res create_close[16] =
9231 { TRUE, ERROR_SUCCESS, FALSE },
9232 { TRUE, ERROR_SUCCESS, FALSE },
9233 { TRUE, ERROR_SUCCESS, FALSE },
9234 { TRUE, ERROR_SUCCESS, FALSE },
9235 { TRUE, ERROR_SUCCESS, FALSE },
9236 { TRUE, ERROR_SUCCESS, FALSE },
9237 { TRUE, ERROR_SUCCESS, FALSE },
9238 { TRUE, ERROR_SUCCESS, FALSE },
9239 { TRUE, ERROR_SUCCESS, FALSE },
9240 { TRUE, ERROR_SUCCESS, FALSE },
9241 { TRUE, ERROR_SUCCESS, FALSE },
9242 { TRUE, ERROR_SUCCESS, FALSE },
9243 { TRUE, ERROR_SUCCESS, FALSE },
9244 { TRUE, ERROR_SUCCESS, FALSE },
9245 { TRUE, ERROR_SUCCESS, FALSE },
9246 { TRUE, ERROR_SUCCESS }
9249 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
9251 DWORD access = 0, share = 0;
9252 DWORD lasterr;
9253 HANDLE hfile;
9254 int i, j, idx = 0;
9256 for (i = 0; i < 4; i++)
9258 if (i == 0) access = 0;
9259 if (i == 1) access = GENERIC_READ;
9260 if (i == 2) access = GENERIC_WRITE;
9261 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
9263 for (j = 0; j < 4; j++)
9265 if (ares[idx].ignore)
9266 continue;
9268 if (j == 0) share = 0;
9269 if (j == 1) share = FILE_SHARE_READ;
9270 if (j == 2) share = FILE_SHARE_WRITE;
9271 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
9273 SetLastError(0xdeadbeef);
9274 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
9275 FILE_ATTRIBUTE_NORMAL, 0);
9276 lasterr = GetLastError();
9278 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
9279 "(%d, handle, %d): Expected %d, got %d\n",
9280 line, idx, ares[idx].gothandle,
9281 (hfile != INVALID_HANDLE_VALUE));
9283 ok(lasterr == ares[idx].lasterr ||
9284 lasterr == 0xdeadbeef, /* win9x */
9285 "(%d, lasterr, %d): Expected %d, got %d\n",
9286 line, idx, ares[idx].lasterr, lasterr);
9288 CloseHandle(hfile);
9289 idx++;
9294 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
9296 static void test_access(void)
9298 MSIHANDLE hdb;
9299 UINT r;
9301 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
9302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9304 test_file_access(msifile, create);
9306 r = MsiDatabaseCommit(hdb);
9307 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9309 test_file_access(msifile, create_commit);
9311 MsiCloseHandle(hdb);
9313 test_file_access(msifile, create_close);
9315 DeleteFileA(msifile);
9317 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
9318 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9320 test_file_access(msifile, create);
9322 r = MsiDatabaseCommit(hdb);
9323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9325 test_file_access(msifile, create_commit);
9327 MsiCloseHandle(hdb);
9329 test_file_access(msifile, create_close);
9331 DeleteFileA(msifile);
9334 static void test_emptypackage(void)
9336 MSIHANDLE hpkg, hdb, hsuminfo;
9337 MSIHANDLE hview, hrec;
9338 MSICONDITION condition;
9339 CHAR buffer[MAX_PATH];
9340 DWORD size;
9341 UINT r;
9343 r = MsiOpenPackageA("", &hpkg);
9344 todo_wine
9346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9349 hdb = MsiGetActiveDatabase(hpkg);
9350 todo_wine
9352 ok(hdb != 0, "Expected a valid database handle\n");
9355 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
9356 todo_wine
9358 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9360 r = MsiViewExecute(hview, 0);
9361 todo_wine
9363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9366 r = MsiViewFetch(hview, &hrec);
9367 todo_wine
9369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9372 size = MAX_PATH;
9373 r = MsiRecordGetString(hrec, 1, buffer, &size);
9374 todo_wine
9376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9377 ok(!lstrcmpA(buffer, "_Property"),
9378 "Expected \"_Property\", got \"%s\"\n", buffer);
9381 MsiCloseHandle(hrec);
9383 r = MsiViewFetch(hview, &hrec);
9384 todo_wine
9386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9389 size = MAX_PATH;
9390 r = MsiRecordGetString(hrec, 1, buffer, &size);
9391 todo_wine
9393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9394 ok(!lstrcmpA(buffer, "#_FolderCache"),
9395 "Expected \"_Property\", got \"%s\"\n", buffer);
9398 MsiCloseHandle(hrec);
9399 MsiViewClose(hview);
9400 MsiCloseHandle(hview);
9402 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
9403 todo_wine
9405 ok(condition == MSICONDITION_FALSE,
9406 "Expected MSICONDITION_FALSE, got %d\n", condition);
9409 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
9410 todo_wine
9412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9414 r = MsiViewExecute(hview, 0);
9415 todo_wine
9417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9420 /* _Property table is not empty */
9421 r = MsiViewFetch(hview, &hrec);
9422 todo_wine
9424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9427 MsiCloseHandle(hrec);
9428 MsiViewClose(hview);
9429 MsiCloseHandle(hview);
9431 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
9432 todo_wine
9434 ok(condition == MSICONDITION_FALSE,
9435 "Expected MSICONDITION_FALSE, got %d\n", condition);
9438 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
9439 todo_wine
9441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9443 r = MsiViewExecute(hview, 0);
9444 todo_wine
9446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9449 /* #_FolderCache is not empty */
9450 r = MsiViewFetch(hview, &hrec);
9451 todo_wine
9453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9456 MsiCloseHandle(hrec);
9457 MsiViewClose(hview);
9458 MsiCloseHandle(hview);
9460 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
9461 todo_wine
9463 ok(r == ERROR_BAD_QUERY_SYNTAX,
9464 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
9467 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
9468 todo_wine
9470 ok(r == ERROR_BAD_QUERY_SYNTAX,
9471 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
9474 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
9475 todo_wine
9477 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
9478 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
9481 MsiCloseHandle(hsuminfo);
9483 r = MsiDatabaseCommit(hdb);
9484 todo_wine
9486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9489 MsiCloseHandle(hdb);
9490 MsiCloseHandle(hpkg);
9493 START_TEST(package)
9495 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
9497 test_createpackage();
9498 test_doaction();
9499 test_gettargetpath_bad();
9500 test_settargetpath();
9501 test_props();
9502 test_property_table();
9503 test_condition();
9504 test_msipackage();
9505 test_formatrecord2();
9506 test_states();
9507 test_getproperty();
9508 test_removefiles();
9509 test_appsearch();
9510 test_appsearch_complocator();
9511 test_appsearch_reglocator();
9512 test_appsearch_inilocator();
9513 test_appsearch_drlocator();
9514 test_featureparents();
9515 test_installprops();
9516 test_launchconditions();
9517 test_ccpsearch();
9518 test_complocator();
9519 test_MsiGetSourcePath();
9520 test_shortlongsource();
9521 test_sourcedir();
9522 test_access();
9523 test_emptypackage();