msi/tests: Fix package test when run on a different drive than C:\.
[wine/hacks.git] / dlls / msi / tests / package.c
blobccc92083534320879f55812045a92a0559580a4b
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, buf, size, &size);
52 user = (PTOKEN_USER)buf;
53 pConvertSidToStringSidA(user->User.Sid, usersid);
54 CloseHandle(token);
57 /* RegDeleteTreeW from dlls/advapi32/registry.c */
58 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
60 LONG ret;
61 DWORD dwMaxSubkeyLen, dwMaxValueLen;
62 DWORD dwMaxLen, dwSize;
63 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
64 HKEY hSubKey = hKey;
66 if(lpszSubKey)
68 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
69 if (ret) return ret;
72 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
73 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
74 if (ret) goto cleanup;
76 dwMaxSubkeyLen++;
77 dwMaxValueLen++;
78 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
79 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
81 /* Name too big: alloc a buffer for it */
82 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
84 ret = ERROR_NOT_ENOUGH_MEMORY;
85 goto cleanup;
89 /* Recursively delete all the subkeys */
90 while (TRUE)
92 dwSize = dwMaxLen;
93 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
94 NULL, NULL, NULL)) break;
96 ret = package_RegDeleteTreeW(hSubKey, lpszName);
97 if (ret) goto cleanup;
100 if (lpszSubKey)
101 ret = RegDeleteKeyW(hKey, lpszSubKey);
102 else
103 while (TRUE)
105 dwSize = dwMaxLen;
106 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
107 NULL, NULL, NULL, NULL)) break;
109 ret = RegDeleteValueW(hKey, lpszName);
110 if (ret) goto cleanup;
113 cleanup:
114 if (lpszName != szNameBuf)
115 HeapFree(GetProcessHeap(), 0, lpszName);
116 if(lpszSubKey)
117 RegCloseKey(hSubKey);
118 return ret;
121 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
123 DWORD i,n=1;
124 GUID guid;
126 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
127 return FALSE;
129 for(i=0; i<8; i++)
130 out[7-i] = in[n++];
131 n++;
132 for(i=0; i<4; i++)
133 out[11-i] = in[n++];
134 n++;
135 for(i=0; i<4; i++)
136 out[15-i] = in[n++];
137 n++;
138 for(i=0; i<2; i++)
140 out[17+i*2] = in[n++];
141 out[16+i*2] = in[n++];
143 n++;
144 for( ; i<8; i++)
146 out[17+i*2] = in[n++];
147 out[16+i*2] = in[n++];
149 out[32]=0;
150 return TRUE;
153 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
155 WCHAR guidW[MAX_PATH];
156 WCHAR squashedW[MAX_PATH];
157 GUID guid;
158 HRESULT hr;
159 int size;
161 hr = CoCreateGuid(&guid);
162 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
164 size = StringFromGUID2(&guid, guidW, MAX_PATH);
165 ok(size == 39, "Expected 39, got %d\n", hr);
167 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
168 squash_guid(guidW, squashedW);
169 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
172 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
173 LPCSTR guid, LPSTR usersid, BOOL dir)
175 WCHAR guidW[MAX_PATH];
176 WCHAR squashedW[MAX_PATH];
177 CHAR squashed[MAX_PATH];
178 CHAR comppath[MAX_PATH];
179 CHAR prodpath[MAX_PATH];
180 CHAR path[MAX_PATH];
181 LPCSTR prod = NULL;
182 HKEY hkey;
184 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
185 squash_guid(guidW, squashedW);
186 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
188 if (context == MSIINSTALLCONTEXT_MACHINE)
190 prod = "3D0DAE300FACA1300AD792060BCDAA92";
191 sprintf(comppath,
192 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
193 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
194 lstrcpyA(prodpath,
195 "SOFTWARE\\Classes\\Installer\\"
196 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
198 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
200 prod = "7D2F387510109040002000060BECB6AB";
201 sprintf(comppath,
202 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
203 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
204 sprintf(prodpath,
205 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
206 "Installer\\%s\\Installer\\Products\\"
207 "7D2F387510109040002000060BECB6AB", usersid);
209 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
211 prod = "7D2F387510109040002000060BECB6AB";
212 sprintf(comppath,
213 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
214 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
215 sprintf(prodpath,
216 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
217 "Installer\\Managed\\%s\\Installer\\Products\\"
218 "7D2F387510109040002000060BECB6AB", usersid);
221 RegCreateKeyA(HKEY_LOCAL_MACHINE, comppath, &hkey);
223 lstrcpyA(path, CURR_DIR);
224 lstrcatA(path, "\\");
225 if (!dir) lstrcatA(path, filename);
227 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
228 RegCloseKey(hkey);
230 RegCreateKeyA(HKEY_LOCAL_MACHINE, prodpath, &hkey);
231 RegCloseKey(hkey);
234 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
236 WCHAR guidW[MAX_PATH];
237 WCHAR squashedW[MAX_PATH];
238 WCHAR substrW[MAX_PATH];
239 CHAR squashed[MAX_PATH];
240 CHAR comppath[MAX_PATH];
241 CHAR prodpath[MAX_PATH];
243 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
244 squash_guid(guidW, squashedW);
245 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
247 if (context == MSIINSTALLCONTEXT_MACHINE)
249 sprintf(comppath,
250 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
251 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
252 lstrcpyA(prodpath,
253 "SOFTWARE\\Classes\\Installer\\"
254 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
256 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
258 sprintf(comppath,
259 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
260 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
261 sprintf(prodpath,
262 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
263 "Installer\\%s\\Installer\\Products\\"
264 "7D2F387510109040002000060BECB6AB", usersid);
266 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
268 sprintf(comppath,
269 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
270 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
271 sprintf(prodpath,
272 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
273 "Installer\\Managed\\%s\\Installer\\Products\\"
274 "7D2F387510109040002000060BECB6AB", usersid);
277 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
278 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
280 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
281 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
284 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
286 MSIHANDLE hview = 0;
287 UINT r, ret;
289 /* open a select query */
290 r = MsiDatabaseOpenView(hdb, query, &hview);
291 if (r != ERROR_SUCCESS)
292 return r;
293 r = MsiViewExecute(hview, 0);
294 if (r != ERROR_SUCCESS)
295 return r;
296 ret = MsiViewFetch(hview, phrec);
297 r = MsiViewClose(hview);
298 if (r != ERROR_SUCCESS)
299 return r;
300 r = MsiCloseHandle(hview);
301 if (r != ERROR_SUCCESS)
302 return r;
303 return ret;
306 static UINT run_query( MSIHANDLE hdb, const char *query )
308 MSIHANDLE hview = 0;
309 UINT r;
311 r = MsiDatabaseOpenView(hdb, query, &hview);
312 if( r != ERROR_SUCCESS )
313 return r;
315 r = MsiViewExecute(hview, 0);
316 if( r == ERROR_SUCCESS )
317 r = MsiViewClose(hview);
318 MsiCloseHandle(hview);
319 return r;
322 static UINT create_component_table( MSIHANDLE hdb )
324 return run_query( hdb,
325 "CREATE TABLE `Component` ( "
326 "`Component` CHAR(72) NOT NULL, "
327 "`ComponentId` CHAR(38), "
328 "`Directory_` CHAR(72) NOT NULL, "
329 "`Attributes` SHORT NOT NULL, "
330 "`Condition` CHAR(255), "
331 "`KeyPath` CHAR(72) "
332 "PRIMARY KEY `Component`)" );
335 static UINT create_feature_table( MSIHANDLE hdb )
337 return run_query( hdb,
338 "CREATE TABLE `Feature` ( "
339 "`Feature` CHAR(38) NOT NULL, "
340 "`Feature_Parent` CHAR(38), "
341 "`Title` CHAR(64), "
342 "`Description` CHAR(255), "
343 "`Display` SHORT NOT NULL, "
344 "`Level` SHORT NOT NULL, "
345 "`Directory_` CHAR(72), "
346 "`Attributes` SHORT NOT NULL "
347 "PRIMARY KEY `Feature`)" );
350 static UINT create_feature_components_table( MSIHANDLE hdb )
352 return run_query( hdb,
353 "CREATE TABLE `FeatureComponents` ( "
354 "`Feature_` CHAR(38) NOT NULL, "
355 "`Component_` CHAR(72) NOT NULL "
356 "PRIMARY KEY `Feature_`, `Component_` )" );
359 static UINT create_file_table( MSIHANDLE hdb )
361 return run_query( hdb,
362 "CREATE TABLE `File` ("
363 "`File` CHAR(72) NOT NULL, "
364 "`Component_` CHAR(72) NOT NULL, "
365 "`FileName` CHAR(255) NOT NULL, "
366 "`FileSize` LONG NOT NULL, "
367 "`Version` CHAR(72), "
368 "`Language` CHAR(20), "
369 "`Attributes` SHORT, "
370 "`Sequence` SHORT NOT NULL "
371 "PRIMARY KEY `File`)" );
374 static UINT create_remove_file_table( MSIHANDLE hdb )
376 return run_query( hdb,
377 "CREATE TABLE `RemoveFile` ("
378 "`FileKey` CHAR(72) NOT NULL, "
379 "`Component_` CHAR(72) NOT NULL, "
380 "`FileName` CHAR(255) LOCALIZABLE, "
381 "`DirProperty` CHAR(72) NOT NULL, "
382 "`InstallMode` SHORT NOT NULL "
383 "PRIMARY KEY `FileKey`)" );
386 static UINT create_appsearch_table( MSIHANDLE hdb )
388 return run_query( hdb,
389 "CREATE TABLE `AppSearch` ("
390 "`Property` CHAR(72) NOT NULL, "
391 "`Signature_` CHAR(72) NOT NULL "
392 "PRIMARY KEY `Property`, `Signature_`)" );
395 static UINT create_reglocator_table( MSIHANDLE hdb )
397 return run_query( hdb,
398 "CREATE TABLE `RegLocator` ("
399 "`Signature_` CHAR(72) NOT NULL, "
400 "`Root` SHORT NOT NULL, "
401 "`Key` CHAR(255) NOT NULL, "
402 "`Name` CHAR(255), "
403 "`Type` SHORT "
404 "PRIMARY KEY `Signature_`)" );
407 static UINT create_signature_table( MSIHANDLE hdb )
409 return run_query( hdb,
410 "CREATE TABLE `Signature` ("
411 "`Signature` CHAR(72) NOT NULL, "
412 "`FileName` CHAR(255) NOT NULL, "
413 "`MinVersion` CHAR(20), "
414 "`MaxVersion` CHAR(20), "
415 "`MinSize` LONG, "
416 "`MaxSize` LONG, "
417 "`MinDate` LONG, "
418 "`MaxDate` LONG, "
419 "`Languages` CHAR(255) "
420 "PRIMARY KEY `Signature`)" );
423 static UINT create_launchcondition_table( MSIHANDLE hdb )
425 return run_query( hdb,
426 "CREATE TABLE `LaunchCondition` ("
427 "`Condition` CHAR(255) NOT NULL, "
428 "`Description` CHAR(255) NOT NULL "
429 "PRIMARY KEY `Condition`)" );
432 static UINT create_property_table( MSIHANDLE hdb )
434 return run_query( hdb,
435 "CREATE TABLE `Property` ("
436 "`Property` CHAR(72) NOT NULL, "
437 "`Value` CHAR(0) "
438 "PRIMARY KEY `Property`)" );
441 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
443 return run_query( hdb,
444 "CREATE TABLE `InstallExecuteSequence` ("
445 "`Action` CHAR(72) NOT NULL, "
446 "`Condition` CHAR(255), "
447 "`Sequence` SHORT "
448 "PRIMARY KEY `Action`)" );
451 static UINT create_media_table( MSIHANDLE hdb )
453 return run_query( hdb,
454 "CREATE TABLE `Media` ("
455 "`DiskId` SHORT NOT NULL, "
456 "`LastSequence` SHORT NOT NULL, "
457 "`DiskPrompt` CHAR(64), "
458 "`Cabinet` CHAR(255), "
459 "`VolumeLabel` CHAR(32), "
460 "`Source` CHAR(72) "
461 "PRIMARY KEY `DiskId`)" );
464 static UINT create_ccpsearch_table( MSIHANDLE hdb )
466 return run_query( hdb,
467 "CREATE TABLE `CCPSearch` ("
468 "`Signature_` CHAR(72) NOT NULL "
469 "PRIMARY KEY `Signature_`)" );
472 static UINT create_drlocator_table( MSIHANDLE hdb )
474 return run_query( hdb,
475 "CREATE TABLE `DrLocator` ("
476 "`Signature_` CHAR(72) NOT NULL, "
477 "`Parent` CHAR(72), "
478 "`Path` CHAR(255), "
479 "`Depth` SHORT "
480 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
483 static UINT create_complocator_table( MSIHANDLE hdb )
485 return run_query( hdb,
486 "CREATE TABLE `CompLocator` ("
487 "`Signature_` CHAR(72) NOT NULL, "
488 "`ComponentId` CHAR(38) NOT NULL, "
489 "`Type` SHORT "
490 "PRIMARY KEY `Signature_`)" );
493 static UINT create_inilocator_table( MSIHANDLE hdb )
495 return run_query( hdb,
496 "CREATE TABLE `IniLocator` ("
497 "`Signature_` CHAR(72) NOT NULL, "
498 "`FileName` CHAR(255) NOT NULL, "
499 "`Section` CHAR(96)NOT NULL, "
500 "`Key` CHAR(128)NOT NULL, "
501 "`Field` SHORT, "
502 "`Type` SHORT "
503 "PRIMARY KEY `Signature_`)" );
506 #define make_add_entry(type, qtext) \
507 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
509 char insert[] = qtext; \
510 char *query; \
511 UINT sz, r; \
512 sz = strlen(values) + sizeof insert; \
513 query = HeapAlloc(GetProcessHeap(),0,sz); \
514 sprintf(query,insert,values); \
515 r = run_query( hdb, query ); \
516 HeapFree(GetProcessHeap(), 0, query); \
517 return r; \
520 make_add_entry(component,
521 "INSERT INTO `Component` "
522 "(`Component`, `ComponentId`, `Directory_`, "
523 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
525 make_add_entry(directory,
526 "INSERT INTO `Directory` "
527 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
529 make_add_entry(feature,
530 "INSERT INTO `Feature` "
531 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
532 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
534 make_add_entry(feature_components,
535 "INSERT INTO `FeatureComponents` "
536 "(`Feature_`, `Component_`) VALUES( %s )")
538 make_add_entry(file,
539 "INSERT INTO `File` "
540 "(`File`, `Component_`, `FileName`, `FileSize`, "
541 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
543 make_add_entry(appsearch,
544 "INSERT INTO `AppSearch` "
545 "(`Property`, `Signature_`) VALUES( %s )")
547 make_add_entry(reglocator,
548 "INSERT INTO `RegLocator` "
549 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
551 make_add_entry(signature,
552 "INSERT INTO `Signature` "
553 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
554 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
555 "VALUES( %s )")
557 make_add_entry(launchcondition,
558 "INSERT INTO `LaunchCondition` "
559 "(`Condition`, `Description`) VALUES( %s )")
561 make_add_entry(property,
562 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
564 make_add_entry(install_execute_sequence,
565 "INSERT INTO `InstallExecuteSequence` "
566 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
568 make_add_entry(media,
569 "INSERT INTO `Media` "
570 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
571 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
573 make_add_entry(ccpsearch,
574 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
576 make_add_entry(drlocator,
577 "INSERT INTO `DrLocator` "
578 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
580 make_add_entry(complocator,
581 "INSERT INTO `CompLocator` "
582 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
584 make_add_entry(inilocator,
585 "INSERT INTO `IniLocator` "
586 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
587 "VALUES( %s )")
589 static UINT set_summary_info(MSIHANDLE hdb)
591 UINT res;
592 MSIHANDLE suminfo;
594 /* build summary info */
595 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
596 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
598 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
599 "Installation Database");
600 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
602 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
603 "Installation Database");
604 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
606 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
607 "Wine Hackers");
608 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
610 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
611 ";1033");
612 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
614 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
615 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
616 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
618 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
619 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
621 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
622 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
624 res = MsiSummaryInfoPersist(suminfo);
625 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
627 res = MsiCloseHandle( suminfo);
628 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
630 return res;
634 static MSIHANDLE create_package_db(void)
636 MSIHANDLE hdb = 0;
637 UINT res;
639 DeleteFile(msifile);
641 /* create an empty database */
642 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
643 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
644 if( res != ERROR_SUCCESS )
645 return hdb;
647 res = MsiDatabaseCommit( hdb );
648 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
650 res = set_summary_info(hdb);
652 res = run_query( hdb,
653 "CREATE TABLE `Directory` ( "
654 "`Directory` CHAR(255) NOT NULL, "
655 "`Directory_Parent` CHAR(255), "
656 "`DefaultDir` CHAR(255) NOT NULL "
657 "PRIMARY KEY `Directory`)" );
658 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
660 return hdb;
663 static MSIHANDLE package_from_db(MSIHANDLE hdb)
665 UINT res;
666 CHAR szPackage[10];
667 MSIHANDLE hPackage;
669 sprintf(szPackage,"#%i",hdb);
670 res = MsiOpenPackage(szPackage,&hPackage);
671 if (res != ERROR_SUCCESS)
672 return 0;
674 res = MsiCloseHandle(hdb);
675 if (res != ERROR_SUCCESS)
676 return 0;
678 return hPackage;
681 static void create_test_file(const CHAR *name)
683 HANDLE file;
684 DWORD written;
686 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
687 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
688 WriteFile(file, name, strlen(name), &written, NULL);
689 WriteFile(file, "\n", strlen("\n"), &written, NULL);
690 CloseHandle(file);
693 typedef struct _tagVS_VERSIONINFO
695 WORD wLength;
696 WORD wValueLength;
697 WORD wType;
698 WCHAR szKey[1];
699 WORD wPadding1[1];
700 VS_FIXEDFILEINFO Value;
701 WORD wPadding2[1];
702 WORD wChildren[1];
703 } VS_VERSIONINFO;
705 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
706 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
708 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
710 VS_VERSIONINFO *pVerInfo;
711 VS_FIXEDFILEINFO *pFixedInfo;
712 LPBYTE buffer, ofs;
713 CHAR path[MAX_PATH];
714 DWORD handle, size;
715 HANDLE resource;
716 BOOL ret = FALSE;
718 GetSystemDirectory(path, MAX_PATH);
719 lstrcatA(path, "\\kernel32.dll");
721 CopyFileA(path, name, FALSE);
723 size = GetFileVersionInfoSize(path, &handle);
724 buffer = HeapAlloc(GetProcessHeap(), 0, size);
726 GetFileVersionInfoA(path, 0, size, buffer);
728 pVerInfo = (VS_VERSIONINFO *)buffer;
729 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
730 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
732 pFixedInfo->dwFileVersionMS = ms;
733 pFixedInfo->dwFileVersionLS = ls;
734 pFixedInfo->dwProductVersionMS = ms;
735 pFixedInfo->dwProductVersionLS = ls;
737 resource = BeginUpdateResource(name, FALSE);
738 if (!resource)
739 goto done;
741 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
742 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
743 goto done;
745 if (!EndUpdateResource(resource, FALSE))
746 goto done;
748 ret = TRUE;
750 done:
751 HeapFree(GetProcessHeap(), 0, buffer);
752 return ret;
755 static void test_createpackage(void)
757 MSIHANDLE hPackage = 0;
758 UINT res;
760 hPackage = package_from_db(create_package_db());
761 ok( hPackage != 0, " Failed to create package\n");
763 res = MsiCloseHandle( hPackage);
764 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
765 DeleteFile(msifile);
768 static void test_doaction( void )
770 MSIHANDLE hpkg;
771 UINT r;
773 r = MsiDoAction( -1, NULL );
774 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
776 hpkg = package_from_db(create_package_db());
777 ok( hpkg, "failed to create package\n");
779 r = MsiDoAction(hpkg, NULL);
780 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
782 r = MsiDoAction(0, "boo");
783 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
785 r = MsiDoAction(hpkg, "boo");
786 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
788 MsiCloseHandle( hpkg );
789 DeleteFile(msifile);
792 static void test_gettargetpath_bad(void)
794 char buffer[0x80];
795 MSIHANDLE hpkg;
796 DWORD sz;
797 UINT r;
799 hpkg = package_from_db(create_package_db());
800 ok( hpkg, "failed to create package\n");
802 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
803 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
805 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
806 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
808 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
809 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
811 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
812 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
814 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
815 ok( r == ERROR_DIRECTORY, "wrong return val\n");
817 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
818 ok( r == ERROR_DIRECTORY, "wrong return val\n");
820 MsiCloseHandle( hpkg );
821 DeleteFile(msifile);
824 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
826 UINT r;
827 DWORD size;
828 MSIHANDLE rec;
830 rec = MsiCreateRecord( 1 );
831 ok(rec, "MsiCreate record failed\n");
833 r = MsiRecordSetString( rec, 0, file );
834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
836 size = MAX_PATH;
837 r = MsiFormatRecord( hpkg, rec, buff, &size );
838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
840 MsiCloseHandle( rec );
843 static void test_settargetpath(void)
845 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
846 DWORD sz;
847 MSIHANDLE hpkg;
848 UINT r;
849 MSIHANDLE hdb;
851 hdb = create_package_db();
852 ok ( hdb, "failed to create package database\n" );
854 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
855 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
857 r = create_component_table( hdb );
858 ok( r == S_OK, "cannot create Component table: %d\n", r );
860 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
861 ok( r == S_OK, "cannot add dummy component: %d\n", r );
863 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
864 ok( r == S_OK, "cannot add test component: %d\n", r );
866 r = create_feature_table( hdb );
867 ok( r == S_OK, "cannot create Feature table: %d\n", r );
869 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
870 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
872 r = create_feature_components_table( hdb );
873 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
875 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
876 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
878 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
879 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
881 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
882 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
884 r = create_file_table( hdb );
885 ok( r == S_OK, "cannot create File table: %d\n", r );
887 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
888 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
890 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
891 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
893 hpkg = package_from_db( hdb );
894 ok( hpkg, "failed to create package\n");
896 r = MsiDoAction( hpkg, "CostInitialize");
897 ok( r == ERROR_SUCCESS, "cost init failed\n");
899 r = MsiDoAction( hpkg, "FileCost");
900 ok( r == ERROR_SUCCESS, "file cost failed\n");
902 r = MsiDoAction( hpkg, "CostFinalize");
903 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
905 r = MsiSetTargetPath( 0, NULL, NULL );
906 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
908 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
909 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
911 r = MsiSetTargetPath( hpkg, "boo", NULL );
912 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
914 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
915 ok( r == ERROR_DIRECTORY, "wrong return val\n");
917 sz = sizeof tempdir - 1;
918 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
919 sprintf( file, "%srootfile.txt", tempdir );
920 query_file_path( hpkg, "[#RootFile]", buffer );
921 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
922 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
924 GetTempFileName( tempdir, "_wt", 0, buffer );
925 sprintf( tempdir, "%s\\subdir", buffer );
927 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
928 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
929 "MsiSetTargetPath on file returned %d\n", r );
931 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
932 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
933 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
935 DeleteFile( buffer );
937 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
938 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
940 r = GetFileAttributes( buffer );
941 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
943 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
944 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
946 sz = sizeof buffer - 1;
947 lstrcat( tempdir, "\\" );
948 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
949 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
950 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
952 sprintf( file, "%srootfile.txt", tempdir );
953 query_file_path( hpkg, "[#RootFile]", buffer );
954 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
956 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
957 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
959 query_file_path( hpkg, "[#TestFile]", buffer );
960 ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
961 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
963 sz = sizeof buffer - 1;
964 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
965 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
966 ok( !lstrcmp(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
968 MsiCloseHandle( hpkg );
971 static void test_condition(void)
973 MSICONDITION r;
974 MSIHANDLE hpkg;
976 hpkg = package_from_db(create_package_db());
977 ok( hpkg, "failed to create package\n");
979 r = MsiEvaluateCondition(0, NULL);
980 ok( r == MSICONDITION_ERROR, "wrong return val\n");
982 r = MsiEvaluateCondition(hpkg, NULL);
983 ok( r == MSICONDITION_NONE, "wrong return val\n");
985 r = MsiEvaluateCondition(hpkg, "");
986 ok( r == MSICONDITION_NONE, "wrong return val\n");
988 r = MsiEvaluateCondition(hpkg, "1");
989 ok( r == MSICONDITION_TRUE, "wrong return val\n");
991 r = MsiEvaluateCondition(hpkg, "0");
992 ok( r == MSICONDITION_FALSE, "wrong return val\n");
994 r = MsiEvaluateCondition(hpkg, "-1");
995 ok( r == MSICONDITION_TRUE, "wrong return val\n");
997 r = MsiEvaluateCondition(hpkg, "0 = 0");
998 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1000 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1001 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1003 r = MsiEvaluateCondition(hpkg, "0 = 1");
1004 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1006 r = MsiEvaluateCondition(hpkg, "0 > 1");
1007 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1009 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1010 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1012 r = MsiEvaluateCondition(hpkg, "1 > 1");
1013 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1015 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1016 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1018 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1019 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1021 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1022 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1024 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1025 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1027 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1028 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1030 r = MsiEvaluateCondition(hpkg, "0 < 1");
1031 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1033 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1034 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1036 r = MsiEvaluateCondition(hpkg, "1 < 1");
1037 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1039 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1040 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1042 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1043 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1045 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1046 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1048 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1049 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1051 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1052 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1054 r = MsiEvaluateCondition(hpkg, "0 >=");
1055 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1057 r = MsiEvaluateCondition(hpkg, " ");
1058 ok( r == MSICONDITION_NONE, "wrong return val\n");
1060 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1061 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1063 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1064 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1066 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1067 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1069 r = MsiEvaluateCondition(hpkg, "not 0");
1070 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1072 r = MsiEvaluateCondition(hpkg, "not LicView");
1073 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1075 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1076 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1078 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1079 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1081 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1082 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1084 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1085 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1087 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1088 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1090 r = MsiEvaluateCondition(hpkg, "\"0\"");
1091 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1093 r = MsiEvaluateCondition(hpkg, "1 and 2");
1094 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1096 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1097 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1099 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1100 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1102 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1103 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1105 r = MsiEvaluateCondition(hpkg, "(0)");
1106 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1108 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1109 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1111 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1112 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1114 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1115 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1117 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1118 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1120 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1121 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1123 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1124 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1126 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1127 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1129 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1130 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1132 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1133 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1135 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1136 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1138 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1139 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1141 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1142 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1144 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1145 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1147 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1148 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1150 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1151 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1153 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1154 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1156 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1157 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1159 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1160 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1162 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1163 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1165 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1166 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1168 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1169 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1171 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1172 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1174 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1175 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1178 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1180 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1181 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1183 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1184 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1186 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1187 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1189 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1190 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1192 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1193 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1195 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1196 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1198 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1199 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1201 MsiSetProperty(hpkg, "mm", "5" );
1203 r = MsiEvaluateCondition(hpkg, "mm = 5");
1204 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, "mm < 6");
1207 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1210 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1212 r = MsiEvaluateCondition(hpkg, "mm > 4");
1213 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1215 r = MsiEvaluateCondition(hpkg, "mm < 12");
1216 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1218 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1219 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1221 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1222 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1224 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1225 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1228 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1230 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1231 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1234 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1237 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1239 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1240 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1242 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1243 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1246 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1249 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1252 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1254 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1255 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1257 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1258 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1260 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1261 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1263 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1264 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1266 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1267 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1269 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1270 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1272 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1273 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1275 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1276 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1278 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1279 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1281 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1282 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1284 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1285 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1287 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1288 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1290 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1291 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1293 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1294 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1296 MsiSetProperty(hpkg, "bandalmael", "0" );
1297 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1298 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1300 MsiSetProperty(hpkg, "bandalmael", "" );
1301 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1302 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1304 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1305 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1306 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1308 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1309 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1310 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1312 MsiSetProperty(hpkg, "bandalmael", "0 " );
1313 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1314 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1316 MsiSetProperty(hpkg, "bandalmael", "-0" );
1317 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1318 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1320 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1321 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1322 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1324 MsiSetProperty(hpkg, "bandalmael", "--0" );
1325 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1326 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1328 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1329 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1330 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1332 MsiSetProperty(hpkg, "bandalmael", "-" );
1333 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1334 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1336 MsiSetProperty(hpkg, "bandalmael", "+0" );
1337 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1338 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1340 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1341 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1342 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1343 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1344 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1346 MsiSetProperty(hpkg, "one", "hi");
1347 MsiSetProperty(hpkg, "two", "hithere");
1348 r = MsiEvaluateCondition(hpkg, "one >< two");
1349 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1351 MsiSetProperty(hpkg, "one", "hithere");
1352 MsiSetProperty(hpkg, "two", "hi");
1353 r = MsiEvaluateCondition(hpkg, "one >< two");
1354 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1356 MsiSetProperty(hpkg, "one", "hello");
1357 MsiSetProperty(hpkg, "two", "hi");
1358 r = MsiEvaluateCondition(hpkg, "one >< two");
1359 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1361 MsiSetProperty(hpkg, "one", "hellohithere");
1362 MsiSetProperty(hpkg, "two", "hi");
1363 r = MsiEvaluateCondition(hpkg, "one >< two");
1364 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1366 MsiSetProperty(hpkg, "one", "");
1367 MsiSetProperty(hpkg, "two", "hi");
1368 r = MsiEvaluateCondition(hpkg, "one >< two");
1369 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1371 MsiSetProperty(hpkg, "one", "hi");
1372 MsiSetProperty(hpkg, "two", "");
1373 r = MsiEvaluateCondition(hpkg, "one >< two");
1374 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1376 MsiSetProperty(hpkg, "one", "");
1377 MsiSetProperty(hpkg, "two", "");
1378 r = MsiEvaluateCondition(hpkg, "one >< two");
1379 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1381 MsiSetProperty(hpkg, "one", "1234");
1382 MsiSetProperty(hpkg, "two", "1");
1383 r = MsiEvaluateCondition(hpkg, "one >< two");
1384 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1386 MsiSetProperty(hpkg, "one", "one 1234");
1387 MsiSetProperty(hpkg, "two", "1");
1388 r = MsiEvaluateCondition(hpkg, "one >< two");
1389 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1391 MsiSetProperty(hpkg, "one", "hithere");
1392 MsiSetProperty(hpkg, "two", "hi");
1393 r = MsiEvaluateCondition(hpkg, "one << two");
1394 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1396 MsiSetProperty(hpkg, "one", "hi");
1397 MsiSetProperty(hpkg, "two", "hithere");
1398 r = MsiEvaluateCondition(hpkg, "one << two");
1399 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1401 MsiSetProperty(hpkg, "one", "hi");
1402 MsiSetProperty(hpkg, "two", "hi");
1403 r = MsiEvaluateCondition(hpkg, "one << two");
1404 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1406 MsiSetProperty(hpkg, "one", "abcdhithere");
1407 MsiSetProperty(hpkg, "two", "hi");
1408 r = MsiEvaluateCondition(hpkg, "one << two");
1409 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1411 MsiSetProperty(hpkg, "one", "");
1412 MsiSetProperty(hpkg, "two", "hi");
1413 r = MsiEvaluateCondition(hpkg, "one << two");
1414 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1416 MsiSetProperty(hpkg, "one", "hithere");
1417 MsiSetProperty(hpkg, "two", "");
1418 r = MsiEvaluateCondition(hpkg, "one << two");
1419 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1421 MsiSetProperty(hpkg, "one", "");
1422 MsiSetProperty(hpkg, "two", "");
1423 r = MsiEvaluateCondition(hpkg, "one << two");
1424 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1426 MsiSetProperty(hpkg, "one", "1234");
1427 MsiSetProperty(hpkg, "two", "1");
1428 r = MsiEvaluateCondition(hpkg, "one << two");
1429 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1431 MsiSetProperty(hpkg, "one", "1234 one");
1432 MsiSetProperty(hpkg, "two", "1");
1433 r = MsiEvaluateCondition(hpkg, "one << two");
1434 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1436 MsiSetProperty(hpkg, "one", "hithere");
1437 MsiSetProperty(hpkg, "two", "there");
1438 r = MsiEvaluateCondition(hpkg, "one >> two");
1439 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1441 MsiSetProperty(hpkg, "one", "hithere");
1442 MsiSetProperty(hpkg, "two", "hi");
1443 r = MsiEvaluateCondition(hpkg, "one >> two");
1444 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1446 MsiSetProperty(hpkg, "one", "there");
1447 MsiSetProperty(hpkg, "two", "hithere");
1448 r = MsiEvaluateCondition(hpkg, "one >> two");
1449 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1451 MsiSetProperty(hpkg, "one", "there");
1452 MsiSetProperty(hpkg, "two", "there");
1453 r = MsiEvaluateCondition(hpkg, "one >> two");
1454 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1456 MsiSetProperty(hpkg, "one", "abcdhithere");
1457 MsiSetProperty(hpkg, "two", "hi");
1458 r = MsiEvaluateCondition(hpkg, "one >> two");
1459 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1461 MsiSetProperty(hpkg, "one", "");
1462 MsiSetProperty(hpkg, "two", "there");
1463 r = MsiEvaluateCondition(hpkg, "one >> two");
1464 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1466 MsiSetProperty(hpkg, "one", "there");
1467 MsiSetProperty(hpkg, "two", "");
1468 r = MsiEvaluateCondition(hpkg, "one >> two");
1469 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1471 MsiSetProperty(hpkg, "one", "");
1472 MsiSetProperty(hpkg, "two", "");
1473 r = MsiEvaluateCondition(hpkg, "one >> two");
1474 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1476 MsiSetProperty(hpkg, "one", "1234");
1477 MsiSetProperty(hpkg, "two", "4");
1478 r = MsiEvaluateCondition(hpkg, "one >> two");
1479 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1481 MsiSetProperty(hpkg, "one", "one 1234");
1482 MsiSetProperty(hpkg, "two", "4");
1483 r = MsiEvaluateCondition(hpkg, "one >> two");
1484 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1486 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1488 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1489 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1491 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1492 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1494 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1495 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1497 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1498 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1500 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1501 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1503 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1504 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1506 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1507 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1509 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1510 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1512 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1513 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1515 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1516 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1518 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1519 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1521 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1522 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1524 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1525 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1527 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1528 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1530 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1531 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1533 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1534 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1536 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1537 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1539 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1540 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1542 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1543 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1545 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1546 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1548 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1549 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1551 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1552 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1554 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1555 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1557 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1558 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1560 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1561 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1563 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1564 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1566 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1567 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1569 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1570 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1572 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1573 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1575 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1576 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1578 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1579 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1581 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1582 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1584 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1585 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1587 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1588 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1590 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1591 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1593 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1594 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1596 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1597 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1599 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1600 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1601 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1603 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1604 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1606 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1607 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1609 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1610 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1612 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1613 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1615 MsiSetProperty(hpkg, "one", "1");
1616 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1617 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1619 MsiSetProperty(hpkg, "X", "5.0");
1621 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1622 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1624 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1625 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1627 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1628 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1630 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1631 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1633 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1634 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1636 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1637 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1639 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1640 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1642 /* feature doesn't exist */
1643 r = MsiEvaluateCondition(hpkg, "&nofeature");
1644 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1646 MsiSetProperty(hpkg, "A", "2");
1647 MsiSetProperty(hpkg, "X", "50");
1649 r = MsiEvaluateCondition(hpkg, "2 <= X");
1650 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1652 r = MsiEvaluateCondition(hpkg, "A <= X");
1653 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1655 r = MsiEvaluateCondition(hpkg, "A <= 50");
1656 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1658 MsiSetProperty(hpkg, "X", "50val");
1660 r = MsiEvaluateCondition(hpkg, "2 <= X");
1661 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1663 r = MsiEvaluateCondition(hpkg, "A <= X");
1664 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1666 MsiSetProperty(hpkg, "A", "7");
1667 MsiSetProperty(hpkg, "X", "50");
1669 r = MsiEvaluateCondition(hpkg, "7 <= X");
1670 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1672 r = MsiEvaluateCondition(hpkg, "A <= X");
1673 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1675 r = MsiEvaluateCondition(hpkg, "A <= 50");
1676 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1678 MsiSetProperty(hpkg, "X", "50val");
1680 r = MsiEvaluateCondition(hpkg, "2 <= X");
1681 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1683 r = MsiEvaluateCondition(hpkg, "A <= X");
1684 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1686 MsiCloseHandle( hpkg );
1687 DeleteFile(msifile);
1690 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1692 UINT r;
1693 DWORD sz;
1694 char buffer[2];
1696 sz = sizeof buffer;
1697 strcpy(buffer,"x");
1698 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1699 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1702 static void test_props(void)
1704 MSIHANDLE hpkg, hdb;
1705 UINT r;
1706 DWORD sz;
1707 char buffer[0x100];
1709 hdb = create_package_db();
1710 r = run_query( hdb,
1711 "CREATE TABLE `Property` ( "
1712 "`Property` CHAR(255) NOT NULL, "
1713 "`Value` CHAR(255) "
1714 "PRIMARY KEY `Property`)" );
1715 ok( r == ERROR_SUCCESS , "Failed\n" );
1717 r = run_query(hdb,
1718 "INSERT INTO `Property` "
1719 "(`Property`, `Value`) "
1720 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1721 ok( r == ERROR_SUCCESS , "Failed\n" );
1723 hpkg = package_from_db( hdb );
1724 ok( hpkg, "failed to create package\n");
1726 /* test invalid values */
1727 r = MsiGetProperty( 0, NULL, NULL, NULL );
1728 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1730 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1731 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1733 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1734 ok( r == ERROR_SUCCESS, "wrong return val\n");
1736 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1737 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1739 /* test retrieving an empty/nonexistent property */
1740 sz = sizeof buffer;
1741 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1742 ok( r == ERROR_SUCCESS, "wrong return val\n");
1743 ok( sz == 0, "wrong size returned\n");
1745 check_prop_empty( hpkg, "boo");
1746 sz = 0;
1747 strcpy(buffer,"x");
1748 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1749 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1750 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1751 ok( sz == 0, "wrong size returned\n");
1753 sz = 1;
1754 strcpy(buffer,"x");
1755 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1756 ok( r == ERROR_SUCCESS, "wrong return val\n");
1757 ok( buffer[0] == 0, "buffer was not changed\n");
1758 ok( sz == 0, "wrong size returned\n");
1760 /* set the property to something */
1761 r = MsiSetProperty( 0, NULL, NULL );
1762 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1764 r = MsiSetProperty( hpkg, NULL, NULL );
1765 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1767 r = MsiSetProperty( hpkg, "", NULL );
1768 ok( r == ERROR_SUCCESS, "wrong return val\n");
1770 /* try set and get some illegal property identifiers */
1771 r = MsiSetProperty( hpkg, "", "asdf" );
1772 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1774 r = MsiSetProperty( hpkg, "=", "asdf" );
1775 ok( r == ERROR_SUCCESS, "wrong return val\n");
1777 r = MsiSetProperty( hpkg, " ", "asdf" );
1778 ok( r == ERROR_SUCCESS, "wrong return val\n");
1780 r = MsiSetProperty( hpkg, "'", "asdf" );
1781 ok( r == ERROR_SUCCESS, "wrong return val\n");
1783 sz = sizeof buffer;
1784 buffer[0]=0;
1785 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1786 ok( r == ERROR_SUCCESS, "wrong return val\n");
1787 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1789 /* set empty values */
1790 r = MsiSetProperty( hpkg, "boo", NULL );
1791 ok( r == ERROR_SUCCESS, "wrong return val\n");
1792 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1794 r = MsiSetProperty( hpkg, "boo", "" );
1795 ok( r == ERROR_SUCCESS, "wrong return val\n");
1796 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1798 /* set a non-empty value */
1799 r = MsiSetProperty( hpkg, "boo", "xyz" );
1800 ok( r == ERROR_SUCCESS, "wrong return val\n");
1802 sz = 1;
1803 strcpy(buffer,"x");
1804 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1805 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1806 ok( buffer[0] == 0, "buffer was not changed\n");
1807 ok( sz == 3, "wrong size returned\n");
1809 sz = 4;
1810 strcpy(buffer,"x");
1811 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1812 ok( r == ERROR_SUCCESS, "wrong return val\n");
1813 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1814 ok( sz == 3, "wrong size returned\n");
1816 sz = 3;
1817 strcpy(buffer,"x");
1818 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1819 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1820 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1821 ok( sz == 3, "wrong size returned\n");
1823 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1824 ok( r == ERROR_SUCCESS, "wrong return val\n");
1826 sz = 4;
1827 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1828 ok( r == ERROR_SUCCESS, "wrong return val\n");
1829 ok( !strcmp(buffer,""), "buffer wrong\n");
1830 ok( sz == 0, "wrong size returned\n");
1832 sz = 4;
1833 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1834 ok( r == ERROR_SUCCESS, "wrong return val\n");
1835 ok( !strcmp(buffer,""), "buffer wrong\n");
1836 ok( sz == 0, "wrong size returned\n");
1838 sz = 4;
1839 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1840 ok( r == ERROR_SUCCESS, "wrong return val\n");
1841 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1842 ok( sz == 3, "wrong size returned\n");
1844 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1845 ok( r == ERROR_SUCCESS, "wrong return val\n");
1847 sz = 0;
1848 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1849 ok( r == ERROR_SUCCESS, "return wrong\n");
1850 ok( sz == 13, "size wrong (%d)\n", sz);
1852 sz = 13;
1853 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1854 ok( r == ERROR_MORE_DATA, "return wrong\n");
1855 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1857 r = MsiSetProperty(hpkg, "property", "value");
1858 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1860 sz = 6;
1861 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1863 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1865 r = MsiSetProperty(hpkg, "property", NULL);
1866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1868 sz = 6;
1869 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1870 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1871 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1873 MsiCloseHandle( hpkg );
1874 DeleteFile(msifile);
1877 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1879 MSIHANDLE hview, hrec;
1880 BOOL found;
1881 CHAR buffer[MAX_PATH];
1882 DWORD sz;
1883 UINT r;
1885 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1886 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1887 r = MsiViewExecute(hview, 0);
1888 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1890 found = FALSE;
1891 while (r == ERROR_SUCCESS && !found)
1893 r = MsiViewFetch(hview, &hrec);
1894 if (r != ERROR_SUCCESS) break;
1896 sz = MAX_PATH;
1897 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1898 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1900 sz = MAX_PATH;
1901 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1902 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1903 found = TRUE;
1906 MsiCloseHandle(hrec);
1909 MsiViewClose(hview);
1910 MsiCloseHandle(hview);
1912 return found;
1915 static void test_property_table(void)
1917 const char *query;
1918 UINT r;
1919 MSIHANDLE hpkg, hdb, hrec;
1920 char buffer[MAX_PATH];
1921 DWORD sz;
1922 BOOL found;
1924 hdb = create_package_db();
1925 ok( hdb, "failed to create package\n");
1927 hpkg = package_from_db(hdb);
1928 ok( hpkg, "failed to create package\n");
1930 MsiCloseHandle(hdb);
1932 hdb = MsiGetActiveDatabase(hpkg);
1934 query = "CREATE TABLE `_Property` ( "
1935 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1936 r = run_query(hdb, query);
1937 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1939 MsiCloseHandle(hdb);
1940 MsiCloseHandle(hpkg);
1941 DeleteFile(msifile);
1943 hdb = create_package_db();
1944 ok( hdb, "failed to create package\n");
1946 query = "CREATE TABLE `_Property` ( "
1947 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1948 r = run_query(hdb, query);
1949 ok(r == ERROR_SUCCESS, "failed to create table\n");
1951 query = "ALTER `_Property` ADD `foo` INTEGER";
1952 r = run_query(hdb, query);
1953 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1955 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1956 r = run_query(hdb, query);
1957 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1959 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1960 r = run_query(hdb, query);
1961 ok(r == ERROR_SUCCESS, "failed to add column\n");
1963 hpkg = package_from_db(hdb);
1964 todo_wine
1966 ok(!hpkg, "package should not be created\n");
1969 MsiCloseHandle(hdb);
1970 MsiCloseHandle(hpkg);
1971 DeleteFile(msifile);
1973 hdb = create_package_db();
1974 ok (hdb, "failed to create package database\n");
1976 r = create_property_table(hdb);
1977 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
1979 r = add_property_entry(hdb, "'prop', 'val'");
1980 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1982 hpkg = package_from_db(hdb);
1983 ok(hpkg, "failed to create package\n");
1985 MsiCloseHandle(hdb);
1987 sz = MAX_PATH;
1988 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
1989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1990 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
1992 hdb = MsiGetActiveDatabase(hpkg);
1994 found = find_prop_in_property(hdb, "prop", "val");
1995 ok(found, "prop should be in the _Property table\n");
1997 r = add_property_entry(hdb, "'dantes', 'mercedes'");
1998 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2000 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2001 r = do_query(hdb, query, &hrec);
2002 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2004 found = find_prop_in_property(hdb, "dantes", "mercedes");
2005 ok(found == FALSE, "dantes should not be in the _Property table\n");
2007 sz = MAX_PATH;
2008 lstrcpy(buffer, "aaa");
2009 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2011 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2013 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2016 found = find_prop_in_property(hdb, "dantes", "mercedes");
2017 ok(found == TRUE, "dantes should be in the _Property table\n");
2019 MsiCloseHandle(hdb);
2020 MsiCloseHandle(hpkg);
2021 DeleteFile(msifile);
2024 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2026 MSIHANDLE htab = 0;
2027 UINT res;
2029 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2030 if( res == ERROR_SUCCESS )
2032 UINT r;
2034 r = MsiViewExecute( htab, hrec );
2035 if( r != ERROR_SUCCESS )
2037 res = r;
2038 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2041 r = MsiViewClose( htab );
2042 if( r != ERROR_SUCCESS )
2043 res = r;
2045 r = MsiCloseHandle( htab );
2046 if( r != ERROR_SUCCESS )
2047 res = r;
2049 return res;
2052 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2054 return try_query_param( hdb, szQuery, 0 );
2057 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2059 MSIHANDLE summary;
2060 UINT r;
2062 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2065 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2068 r = MsiSummaryInfoPersist(summary);
2069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2071 MsiCloseHandle(summary);
2074 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2076 MSIHANDLE summary;
2077 UINT r;
2079 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2082 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2085 r = MsiSummaryInfoPersist(summary);
2086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2088 MsiCloseHandle(summary);
2091 static void test_msipackage(void)
2093 MSIHANDLE hdb = 0, hpack = 100;
2094 UINT r;
2095 const char *query;
2096 char name[10];
2098 /* NULL szPackagePath */
2099 r = MsiOpenPackage(NULL, &hpack);
2100 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2102 /* empty szPackagePath */
2103 r = MsiOpenPackage("", &hpack);
2104 todo_wine
2106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2109 if (r == ERROR_SUCCESS)
2110 MsiCloseHandle(hpack);
2112 /* nonexistent szPackagePath */
2113 r = MsiOpenPackage("nonexistent", &hpack);
2114 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2116 /* NULL hProduct */
2117 r = MsiOpenPackage(msifile, NULL);
2118 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2120 name[0]='#';
2121 name[1]=0;
2122 r = MsiOpenPackage(name, &hpack);
2123 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2125 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2128 /* database exists, but is emtpy */
2129 sprintf(name, "#%d", hdb);
2130 r = MsiOpenPackage(name, &hpack);
2131 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2132 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2134 query = "CREATE TABLE `Property` ( "
2135 "`Property` CHAR(72), `Value` CHAR(0) "
2136 "PRIMARY KEY `Property`)";
2137 r = try_query(hdb, query);
2138 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2140 query = "CREATE TABLE `InstallExecuteSequence` ("
2141 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2142 "PRIMARY KEY `Action`)";
2143 r = try_query(hdb, query);
2144 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2146 /* a few key tables exist */
2147 sprintf(name, "#%d", hdb);
2148 r = MsiOpenPackage(name, &hpack);
2149 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2150 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2152 MsiCloseHandle(hdb);
2153 DeleteFile(msifile);
2155 /* start with a clean database to show what constitutes a valid package */
2156 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2159 sprintf(name, "#%d", hdb);
2161 /* The following summary information props must exist:
2162 * - PID_REVNUMBER
2163 * - PID_PAGECOUNT
2166 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2167 r = MsiOpenPackage(name, &hpack);
2168 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2169 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2171 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2172 r = MsiOpenPackage(name, &hpack);
2173 ok(r == ERROR_SUCCESS,
2174 "Expected ERROR_SUCCESS, got %d\n", r);
2176 MsiCloseHandle(hpack);
2177 MsiCloseHandle(hdb);
2178 DeleteFile(msifile);
2181 static void test_formatrecord2(void)
2183 MSIHANDLE hpkg, hrec ;
2184 char buffer[0x100];
2185 DWORD sz;
2186 UINT r;
2188 hpkg = package_from_db(create_package_db());
2189 ok( hpkg, "failed to create package\n");
2191 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2192 ok( r == ERROR_SUCCESS, "set property failed\n");
2194 hrec = MsiCreateRecord(2);
2195 ok(hrec, "create record failed\n");
2197 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2198 ok( r == ERROR_SUCCESS, "format record failed\n");
2200 buffer[0] = 0;
2201 sz = sizeof buffer;
2202 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2204 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2205 r = MsiRecordSetString(hrec, 1, "hoo");
2206 sz = sizeof buffer;
2207 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2208 ok( sz == 3, "size wrong\n");
2209 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2210 ok( r == ERROR_SUCCESS, "format failed\n");
2212 r = MsiRecordSetString(hrec, 0, "x[~]x");
2213 sz = sizeof buffer;
2214 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2215 ok( sz == 3, "size wrong\n");
2216 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2217 ok( r == ERROR_SUCCESS, "format failed\n");
2219 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2220 r = MsiRecordSetString(hrec, 1, "hoo");
2221 sz = sizeof buffer;
2222 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2223 ok( sz == 3, "size wrong\n");
2224 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2225 ok( r == ERROR_SUCCESS, "format failed\n");
2227 r = MsiRecordSetString(hrec, 0, "[\\[]");
2228 sz = sizeof buffer;
2229 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2230 ok( sz == 1, "size wrong\n");
2231 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2232 ok( r == ERROR_SUCCESS, "format failed\n");
2234 SetEnvironmentVariable("FOO", "BAR");
2235 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2236 sz = sizeof buffer;
2237 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2238 ok( sz == 3, "size wrong\n");
2239 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2240 ok( r == ERROR_SUCCESS, "format failed\n");
2242 r = MsiRecordSetString(hrec, 0, "[[1]]");
2243 r = MsiRecordSetString(hrec, 1, "%FOO");
2244 sz = sizeof buffer;
2245 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2246 ok( sz == 3, "size wrong\n");
2247 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2248 ok( r == ERROR_SUCCESS, "format failed\n");
2250 MsiCloseHandle( hrec );
2251 MsiCloseHandle( hpkg );
2252 DeleteFile(msifile);
2255 static void test_states(void)
2257 MSIHANDLE hpkg;
2258 UINT r;
2259 MSIHANDLE hdb;
2260 INSTALLSTATE state, action;
2262 static const CHAR msifile2[] = "winetest2.msi";
2263 static const CHAR msifile3[] = "winetest3.msi";
2264 static const CHAR msifile4[] = "winetest4.msi";
2266 hdb = create_package_db();
2267 ok ( hdb, "failed to create package database\n" );
2269 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2270 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2272 r = create_property_table( hdb );
2273 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2275 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2276 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2278 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2279 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2281 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2282 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2284 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2285 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2287 r = create_install_execute_sequence_table( hdb );
2288 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2290 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2291 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2293 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2294 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2296 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2297 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2299 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2300 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2302 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2303 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2305 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2306 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2308 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2309 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2311 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2312 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2314 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2315 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2317 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2318 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2320 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2321 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2323 r = create_media_table( hdb );
2324 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2326 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2327 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2329 r = create_feature_table( hdb );
2330 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2332 r = create_component_table( hdb );
2333 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2335 /* msidbFeatureAttributesFavorLocal */
2336 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2337 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2339 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2340 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2341 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2343 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2344 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2345 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2347 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2348 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2349 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2351 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2352 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2353 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2355 /* msidbFeatureAttributesFavorSource */
2356 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2357 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2359 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2360 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2361 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2363 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2364 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2365 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2367 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2368 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2369 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2371 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2372 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2373 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2375 /* msidbFeatureAttributesFavorSource */
2376 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2377 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2379 /* msidbFeatureAttributesFavorLocal */
2380 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2381 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2383 /* disabled */
2384 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2385 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2387 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2388 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2389 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2391 /* no feature parent:msidbComponentAttributesLocalOnly */
2392 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2393 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2395 /* msidbFeatureAttributesFavorLocal:removed */
2396 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2397 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2399 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2400 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2401 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2403 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2404 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2405 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2407 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2408 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2409 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2411 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2412 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2413 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2415 /* msidbFeatureAttributesFavorSource:removed */
2416 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2417 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2419 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2420 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2421 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2423 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2424 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2425 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2427 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2428 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2429 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2431 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2432 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2433 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2435 /* msidbFeatureAttributesFavorLocal */
2436 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2437 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2439 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2440 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2442 /* msidbFeatureAttributesFavorSource */
2443 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2444 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2446 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2447 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2449 /* msidbFeatureAttributesFavorAdvertise */
2450 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2451 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2453 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2454 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2456 r = create_feature_components_table( hdb );
2457 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2459 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2460 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2462 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2463 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2465 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2466 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2468 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2469 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2471 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2472 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2474 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2475 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2477 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2478 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2480 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2481 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2483 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2484 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2486 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2487 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2489 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2490 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2492 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2493 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2495 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2496 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2498 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2499 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2501 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2502 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2504 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2505 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2507 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2508 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2510 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2511 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2513 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2514 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2516 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2517 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2519 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2520 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2522 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2523 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2525 r = create_file_table( hdb );
2526 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2528 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2529 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2531 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2532 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2534 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2535 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2537 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2538 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2540 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2541 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2543 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2544 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2546 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2547 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2549 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2550 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2552 /* compressed file */
2553 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2554 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2556 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2557 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2559 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2560 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2562 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2563 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2565 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2566 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2568 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2569 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2571 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2572 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2574 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2575 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2577 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2578 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2580 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2581 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2583 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2584 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2586 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2587 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2589 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2590 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2592 MsiDatabaseCommit(hdb);
2594 /* these properties must not be in the saved msi file */
2595 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2596 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2598 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2599 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2601 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2602 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2604 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2605 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2607 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2608 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2610 hpkg = package_from_db( hdb );
2611 ok( hpkg, "failed to create package\n");
2613 MsiCloseHandle(hdb);
2615 CopyFileA(msifile, msifile2, FALSE);
2616 CopyFileA(msifile, msifile3, FALSE);
2617 CopyFileA(msifile, msifile4, FALSE);
2619 state = 0xdeadbee;
2620 action = 0xdeadbee;
2621 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2622 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2623 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2624 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2626 state = 0xdeadbee;
2627 action = 0xdeadbee;
2628 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2629 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2630 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2631 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2633 state = 0xdeadbee;
2634 action = 0xdeadbee;
2635 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2636 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2637 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2638 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2640 state = 0xdeadbee;
2641 action = 0xdeadbee;
2642 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2643 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2644 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2645 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2647 state = 0xdeadbee;
2648 action = 0xdeadbee;
2649 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2650 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2651 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2652 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2654 state = 0xdeadbee;
2655 action = 0xdeadbee;
2656 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2657 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2658 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2659 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2661 state = 0xdeadbee;
2662 action = 0xdeadbee;
2663 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2664 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2665 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2666 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2668 state = 0xdeadbee;
2669 action = 0xdeadbee;
2670 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2671 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2672 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2673 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2675 state = 0xdeadbee;
2676 action = 0xdeadbee;
2677 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2678 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2679 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2680 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2682 state = 0xdeadbee;
2683 action = 0xdeadbee;
2684 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2685 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2686 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2687 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2689 state = 0xdeadbee;
2690 action = 0xdeadbee;
2691 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2692 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2693 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2694 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2696 state = 0xdeadbee;
2697 action = 0xdeadbee;
2698 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2699 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2700 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2701 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2703 state = 0xdeadbee;
2704 action = 0xdeadbee;
2705 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2706 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2707 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2708 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2710 state = 0xdeadbee;
2711 action = 0xdeadbee;
2712 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2713 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2714 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2715 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2717 state = 0xdeadbee;
2718 action = 0xdeadbee;
2719 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2720 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2721 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2722 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2724 state = 0xdeadbee;
2725 action = 0xdeadbee;
2726 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2727 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2728 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2729 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2731 state = 0xdeadbee;
2732 action = 0xdeadbee;
2733 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2734 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2735 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2736 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2738 state = 0xdeadbee;
2739 action = 0xdeadbee;
2740 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2741 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2742 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2743 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2745 state = 0xdeadbee;
2746 action = 0xdeadbee;
2747 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2748 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2749 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2750 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2752 state = 0xdeadbee;
2753 action = 0xdeadbee;
2754 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2755 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2756 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2757 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2759 state = 0xdeadbee;
2760 action = 0xdeadbee;
2761 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2762 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2763 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2764 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2766 state = 0xdeadbee;
2767 action = 0xdeadbee;
2768 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2769 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2770 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2771 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2773 state = 0xdeadbee;
2774 action = 0xdeadbee;
2775 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2776 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2777 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2778 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2780 state = 0xdeadbee;
2781 action = 0xdeadbee;
2782 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2783 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2784 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2785 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2787 state = 0xdeadbee;
2788 action = 0xdeadbee;
2789 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2790 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2794 state = 0xdeadbee;
2795 action = 0xdeadbee;
2796 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2797 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2801 state = 0xdeadbee;
2802 action = 0xdeadbee;
2803 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2804 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2808 state = 0xdeadbee;
2809 action = 0xdeadbee;
2810 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2811 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2815 state = 0xdeadbee;
2816 action = 0xdeadbee;
2817 r = MsiGetComponentState(hpkg, "tau", &state, &action);
2818 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2822 state = 0xdeadbee;
2823 action = 0xdeadbee;
2824 r = MsiGetComponentState(hpkg, "phi", &state, &action);
2825 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2826 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2827 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2829 state = 0xdeadbee;
2830 action = 0xdeadbee;
2831 r = MsiGetComponentState(hpkg, "chi", &state, &action);
2832 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2833 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2834 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2836 r = MsiDoAction( hpkg, "CostInitialize");
2837 ok( r == ERROR_SUCCESS, "cost init failed\n");
2839 state = 0xdeadbee;
2840 action = 0xdeadbee;
2841 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2842 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2843 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2844 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2846 state = 0xdeadbee;
2847 action = 0xdeadbee;
2848 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2850 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2851 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2853 state = 0xdeadbee;
2854 action = 0xdeadbee;
2855 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2857 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2860 state = 0xdeadbee;
2861 action = 0xdeadbee;
2862 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2863 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2864 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2865 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2867 state = 0xdeadbee;
2868 action = 0xdeadbee;
2869 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2870 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2871 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2872 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2874 state = 0xdeadbee;
2875 action = 0xdeadbee;
2876 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2877 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2878 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2879 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2881 state = 0xdeadbee;
2882 action = 0xdeadbee;
2883 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2885 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2886 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2888 state = 0xdeadbee;
2889 action = 0xdeadbee;
2890 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2891 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2892 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2893 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2895 state = 0xdeadbee;
2896 action = 0xdeadbee;
2897 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2898 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2899 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2900 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2902 state = 0xdeadbee;
2903 action = 0xdeadbee;
2904 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2905 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2906 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2907 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2909 state = 0xdeadbee;
2910 action = 0xdeadbee;
2911 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2912 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2913 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2914 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2916 state = 0xdeadbee;
2917 action = 0xdeadbee;
2918 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2920 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2921 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2923 state = 0xdeadbee;
2924 action = 0xdeadbee;
2925 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2927 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2930 state = 0xdeadbee;
2931 action = 0xdeadbee;
2932 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2934 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2935 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2937 state = 0xdeadbee;
2938 action = 0xdeadbee;
2939 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2941 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2942 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2944 state = 0xdeadbee;
2945 action = 0xdeadbee;
2946 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2948 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2951 state = 0xdeadbee;
2952 action = 0xdeadbee;
2953 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2955 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2956 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2958 state = 0xdeadbee;
2959 action = 0xdeadbee;
2960 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2962 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2963 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2965 state = 0xdeadbee;
2966 action = 0xdeadbee;
2967 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2969 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2972 state = 0xdeadbee;
2973 action = 0xdeadbee;
2974 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2979 state = 0xdeadbee;
2980 action = 0xdeadbee;
2981 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2986 state = 0xdeadbee;
2987 action = 0xdeadbee;
2988 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2993 state = 0xdeadbee;
2994 action = 0xdeadbee;
2995 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3000 state = 0xdeadbee;
3001 action = 0xdeadbee;
3002 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3004 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3007 state = 0xdeadbee;
3008 action = 0xdeadbee;
3009 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3014 state = 0xdeadbee;
3015 action = 0xdeadbee;
3016 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3021 state = 0xdeadbee;
3022 action = 0xdeadbee;
3023 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3028 state = 0xdeadbee;
3029 action = 0xdeadbee;
3030 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3035 state = 0xdeadbee;
3036 action = 0xdeadbee;
3037 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3042 state = 0xdeadbee;
3043 action = 0xdeadbee;
3044 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3049 state = 0xdeadbee;
3050 action = 0xdeadbee;
3051 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3056 r = MsiDoAction( hpkg, "FileCost");
3057 ok( r == ERROR_SUCCESS, "file cost failed\n");
3059 state = 0xdeadbee;
3060 action = 0xdeadbee;
3061 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3063 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3064 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3066 state = 0xdeadbee;
3067 action = 0xdeadbee;
3068 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3070 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3073 state = 0xdeadbee;
3074 action = 0xdeadbee;
3075 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3077 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3080 state = 0xdeadbee;
3081 action = 0xdeadbee;
3082 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3087 state = 0xdeadbee;
3088 action = 0xdeadbee;
3089 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3091 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3092 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3094 state = 0xdeadbee;
3095 action = 0xdeadbee;
3096 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3098 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3101 state = 0xdeadbee;
3102 action = 0xdeadbee;
3103 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3105 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3108 state = 0xdeadbee;
3109 action = 0xdeadbee;
3110 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3112 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3115 state = 0xdeadbee;
3116 action = 0xdeadbee;
3117 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3122 state = 0xdeadbee;
3123 action = 0xdeadbee;
3124 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3129 state = 0xdeadbee;
3130 action = 0xdeadbee;
3131 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3136 state = 0xdeadbee;
3137 action = 0xdeadbee;
3138 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3143 state = 0xdeadbee;
3144 action = 0xdeadbee;
3145 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3150 state = 0xdeadbee;
3151 action = 0xdeadbee;
3152 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3157 state = 0xdeadbee;
3158 action = 0xdeadbee;
3159 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3164 state = 0xdeadbee;
3165 action = 0xdeadbee;
3166 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3171 state = 0xdeadbee;
3172 action = 0xdeadbee;
3173 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3178 state = 0xdeadbee;
3179 action = 0xdeadbee;
3180 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3185 state = 0xdeadbee;
3186 action = 0xdeadbee;
3187 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3192 state = 0xdeadbee;
3193 action = 0xdeadbee;
3194 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3199 state = 0xdeadbee;
3200 action = 0xdeadbee;
3201 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3206 state = 0xdeadbee;
3207 action = 0xdeadbee;
3208 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3213 state = 0xdeadbee;
3214 action = 0xdeadbee;
3215 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3220 state = 0xdeadbee;
3221 action = 0xdeadbee;
3222 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3227 state = 0xdeadbee;
3228 action = 0xdeadbee;
3229 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3234 state = 0xdeadbee;
3235 action = 0xdeadbee;
3236 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3241 state = 0xdeadbee;
3242 action = 0xdeadbee;
3243 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3248 state = 0xdeadbee;
3249 action = 0xdeadbee;
3250 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3255 state = 0xdeadbee;
3256 action = 0xdeadbee;
3257 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3262 state = 0xdeadbee;
3263 action = 0xdeadbee;
3264 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3269 state = 0xdeadbee;
3270 action = 0xdeadbee;
3271 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3276 r = MsiDoAction( hpkg, "CostFinalize");
3277 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3279 state = 0xdeadbee;
3280 action = 0xdeadbee;
3281 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3283 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3284 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3286 state = 0xdeadbee;
3287 action = 0xdeadbee;
3288 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3290 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3291 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3293 state = 0xdeadbee;
3294 action = 0xdeadbee;
3295 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3297 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3298 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3300 state = 0xdeadbee;
3301 action = 0xdeadbee;
3302 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3304 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3305 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3307 state = 0xdeadbee;
3308 action = 0xdeadbee;
3309 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3311 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3314 state = 0xdeadbee;
3315 action = 0xdeadbee;
3316 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3318 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3321 state = 0xdeadbee;
3322 action = 0xdeadbee;
3323 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3325 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3328 state = 0xdeadbee;
3329 action = 0xdeadbee;
3330 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3332 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3335 state = 0xdeadbee;
3336 action = 0xdeadbee;
3337 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3339 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3342 state = 0xdeadbee;
3343 action = 0xdeadbee;
3344 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3346 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3349 state = 0xdeadbee;
3350 action = 0xdeadbee;
3351 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3353 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3354 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3356 state = 0xdeadbee;
3357 action = 0xdeadbee;
3358 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3360 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3361 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3363 state = 0xdeadbee;
3364 action = 0xdeadbee;
3365 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3367 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3368 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3370 state = 0xdeadbee;
3371 action = 0xdeadbee;
3372 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3374 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3375 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3377 state = 0xdeadbee;
3378 action = 0xdeadbee;
3379 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3381 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3382 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3384 state = 0xdeadbee;
3385 action = 0xdeadbee;
3386 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3388 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3389 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3391 state = 0xdeadbee;
3392 action = 0xdeadbee;
3393 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3395 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3396 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3398 state = 0xdeadbee;
3399 action = 0xdeadbee;
3400 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3402 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3403 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3405 state = 0xdeadbee;
3406 action = 0xdeadbee;
3407 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3409 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3410 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3412 state = 0xdeadbee;
3413 action = 0xdeadbee;
3414 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3416 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3417 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3419 state = 0xdeadbee;
3420 action = 0xdeadbee;
3421 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3423 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3426 state = 0xdeadbee;
3427 action = 0xdeadbee;
3428 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3430 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3431 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3433 state = 0xdeadbee;
3434 action = 0xdeadbee;
3435 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3437 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3438 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3440 state = 0xdeadbee;
3441 action = 0xdeadbee;
3442 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3444 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3445 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3447 state = 0xdeadbee;
3448 action = 0xdeadbee;
3449 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3451 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3452 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3454 state = 0xdeadbee;
3455 action = 0xdeadbee;
3456 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3458 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3459 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3461 state = 0xdeadbee;
3462 action = 0xdeadbee;
3463 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3465 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3466 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3468 state = 0xdeadbee;
3469 action = 0xdeadbee;
3470 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3472 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3473 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3475 state = 0xdeadbee;
3476 action = 0xdeadbee;
3477 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3479 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3480 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3482 state = 0xdeadbee;
3483 action = 0xdeadbee;
3484 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3486 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3487 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3489 state = 0xdeadbee;
3490 action = 0xdeadbee;
3491 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3493 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3494 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3496 MsiCloseHandle( hpkg );
3498 /* publish the features and components */
3499 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3502 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3503 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3505 /* these properties must not be in the saved msi file */
3506 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3507 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3509 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3510 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3512 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3513 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3515 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3516 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3518 hpkg = package_from_db( hdb );
3519 ok( hpkg, "failed to create package\n");
3521 MsiCloseHandle(hdb);
3523 state = 0xdeadbee;
3524 action = 0xdeadbee;
3525 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3526 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3527 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3528 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3530 state = 0xdeadbee;
3531 action = 0xdeadbee;
3532 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3533 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3534 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3535 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3537 state = 0xdeadbee;
3538 action = 0xdeadbee;
3539 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3540 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3541 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3542 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3544 state = 0xdeadbee;
3545 action = 0xdeadbee;
3546 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3547 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3548 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3549 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3551 state = 0xdeadbee;
3552 action = 0xdeadbee;
3553 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3554 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3555 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3556 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3558 state = 0xdeadbee;
3559 action = 0xdeadbee;
3560 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3561 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3562 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3563 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3565 state = 0xdeadbee;
3566 action = 0xdeadbee;
3567 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3568 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3569 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3570 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3572 state = 0xdeadbee;
3573 action = 0xdeadbee;
3574 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3575 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3576 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3577 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3579 state = 0xdeadbee;
3580 action = 0xdeadbee;
3581 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3582 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3583 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3584 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3586 state = 0xdeadbee;
3587 action = 0xdeadbee;
3588 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3589 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3590 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3591 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3593 state = 0xdeadbee;
3594 action = 0xdeadbee;
3595 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3596 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3597 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3598 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3600 state = 0xdeadbee;
3601 action = 0xdeadbee;
3602 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3603 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3604 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3605 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3607 state = 0xdeadbee;
3608 action = 0xdeadbee;
3609 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3610 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3611 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3612 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3614 state = 0xdeadbee;
3615 action = 0xdeadbee;
3616 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3617 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3618 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3619 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3621 state = 0xdeadbee;
3622 action = 0xdeadbee;
3623 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3624 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3625 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3626 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3628 state = 0xdeadbee;
3629 action = 0xdeadbee;
3630 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3631 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3632 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3633 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3635 state = 0xdeadbee;
3636 action = 0xdeadbee;
3637 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3638 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3639 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3640 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3642 state = 0xdeadbee;
3643 action = 0xdeadbee;
3644 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3645 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3646 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3647 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3649 state = 0xdeadbee;
3650 action = 0xdeadbee;
3651 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3652 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3653 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3654 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3656 state = 0xdeadbee;
3657 action = 0xdeadbee;
3658 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3659 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3660 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3661 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3663 state = 0xdeadbee;
3664 action = 0xdeadbee;
3665 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3666 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3667 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3668 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3670 state = 0xdeadbee;
3671 action = 0xdeadbee;
3672 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3673 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3674 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3675 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3677 state = 0xdeadbee;
3678 action = 0xdeadbee;
3679 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3680 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3681 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3682 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3684 state = 0xdeadbee;
3685 action = 0xdeadbee;
3686 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3687 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3688 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3689 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3691 state = 0xdeadbee;
3692 action = 0xdeadbee;
3693 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3694 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3695 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3696 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3698 state = 0xdeadbee;
3699 action = 0xdeadbee;
3700 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3701 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3702 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3703 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3705 state = 0xdeadbee;
3706 action = 0xdeadbee;
3707 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3708 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3709 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3710 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3712 state = 0xdeadbee;
3713 action = 0xdeadbee;
3714 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3715 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3716 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3717 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3719 state = 0xdeadbee;
3720 action = 0xdeadbee;
3721 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3722 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3723 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3724 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3726 state = 0xdeadbee;
3727 action = 0xdeadbee;
3728 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3729 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3730 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3731 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3733 state = 0xdeadbee;
3734 action = 0xdeadbee;
3735 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3736 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3737 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3738 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3740 r = MsiDoAction( hpkg, "CostInitialize");
3741 ok( r == ERROR_SUCCESS, "cost init failed\n");
3743 state = 0xdeadbee;
3744 action = 0xdeadbee;
3745 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3746 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3747 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3748 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3750 state = 0xdeadbee;
3751 action = 0xdeadbee;
3752 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3753 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3754 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3755 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3757 state = 0xdeadbee;
3758 action = 0xdeadbee;
3759 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3760 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3761 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3762 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3764 state = 0xdeadbee;
3765 action = 0xdeadbee;
3766 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3767 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3768 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3769 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3771 state = 0xdeadbee;
3772 action = 0xdeadbee;
3773 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3774 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3775 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3776 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3778 state = 0xdeadbee;
3779 action = 0xdeadbee;
3780 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3781 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3782 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3783 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3785 state = 0xdeadbee;
3786 action = 0xdeadbee;
3787 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3788 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3789 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3790 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3792 state = 0xdeadbee;
3793 action = 0xdeadbee;
3794 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3795 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3796 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3797 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3799 state = 0xdeadbee;
3800 action = 0xdeadbee;
3801 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3802 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3803 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3804 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3806 state = 0xdeadbee;
3807 action = 0xdeadbee;
3808 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3809 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3810 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3811 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3813 state = 0xdeadbee;
3814 action = 0xdeadbee;
3815 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3816 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3817 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3818 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3820 state = 0xdeadbee;
3821 action = 0xdeadbee;
3822 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3823 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3824 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3825 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3827 state = 0xdeadbee;
3828 action = 0xdeadbee;
3829 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3830 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3831 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3832 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3834 state = 0xdeadbee;
3835 action = 0xdeadbee;
3836 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3838 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3839 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3841 state = 0xdeadbee;
3842 action = 0xdeadbee;
3843 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3844 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3845 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3846 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3848 state = 0xdeadbee;
3849 action = 0xdeadbee;
3850 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3851 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3852 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3853 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3855 state = 0xdeadbee;
3856 action = 0xdeadbee;
3857 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3858 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3859 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3860 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3862 state = 0xdeadbee;
3863 action = 0xdeadbee;
3864 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3865 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3866 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3867 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3869 state = 0xdeadbee;
3870 action = 0xdeadbee;
3871 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3872 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3873 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3874 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3876 state = 0xdeadbee;
3877 action = 0xdeadbee;
3878 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3879 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3880 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3881 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3883 state = 0xdeadbee;
3884 action = 0xdeadbee;
3885 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3886 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3887 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3888 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3890 state = 0xdeadbee;
3891 action = 0xdeadbee;
3892 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3893 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3894 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3895 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3897 state = 0xdeadbee;
3898 action = 0xdeadbee;
3899 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3900 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3901 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3902 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3904 state = 0xdeadbee;
3905 action = 0xdeadbee;
3906 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3907 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3908 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3909 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3911 state = 0xdeadbee;
3912 action = 0xdeadbee;
3913 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3914 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3915 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3916 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3918 state = 0xdeadbee;
3919 action = 0xdeadbee;
3920 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3921 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3922 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3923 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3925 state = 0xdeadbee;
3926 action = 0xdeadbee;
3927 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3928 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3929 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3930 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3932 state = 0xdeadbee;
3933 action = 0xdeadbee;
3934 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3935 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3936 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3937 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3939 state = 0xdeadbee;
3940 action = 0xdeadbee;
3941 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3942 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3943 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3944 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3946 state = 0xdeadbee;
3947 action = 0xdeadbee;
3948 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3949 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3950 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3951 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3953 state = 0xdeadbee;
3954 action = 0xdeadbee;
3955 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3956 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3957 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3958 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3960 r = MsiDoAction( hpkg, "FileCost");
3961 ok( r == ERROR_SUCCESS, "file cost failed\n");
3963 state = 0xdeadbee;
3964 action = 0xdeadbee;
3965 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3967 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3968 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3970 state = 0xdeadbee;
3971 action = 0xdeadbee;
3972 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3974 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3975 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3977 state = 0xdeadbee;
3978 action = 0xdeadbee;
3979 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3981 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3982 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3984 state = 0xdeadbee;
3985 action = 0xdeadbee;
3986 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3991 state = 0xdeadbee;
3992 action = 0xdeadbee;
3993 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3998 state = 0xdeadbee;
3999 action = 0xdeadbee;
4000 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4005 state = 0xdeadbee;
4006 action = 0xdeadbee;
4007 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4012 state = 0xdeadbee;
4013 action = 0xdeadbee;
4014 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4019 state = 0xdeadbee;
4020 action = 0xdeadbee;
4021 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4026 state = 0xdeadbee;
4027 action = 0xdeadbee;
4028 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4033 state = 0xdeadbee;
4034 action = 0xdeadbee;
4035 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4040 state = 0xdeadbee;
4041 action = 0xdeadbee;
4042 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4047 state = 0xdeadbee;
4048 action = 0xdeadbee;
4049 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4054 state = 0xdeadbee;
4055 action = 0xdeadbee;
4056 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4061 state = 0xdeadbee;
4062 action = 0xdeadbee;
4063 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4068 state = 0xdeadbee;
4069 action = 0xdeadbee;
4070 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4075 state = 0xdeadbee;
4076 action = 0xdeadbee;
4077 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4082 state = 0xdeadbee;
4083 action = 0xdeadbee;
4084 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4089 state = 0xdeadbee;
4090 action = 0xdeadbee;
4091 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4096 state = 0xdeadbee;
4097 action = 0xdeadbee;
4098 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4103 state = 0xdeadbee;
4104 action = 0xdeadbee;
4105 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4110 state = 0xdeadbee;
4111 action = 0xdeadbee;
4112 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4117 state = 0xdeadbee;
4118 action = 0xdeadbee;
4119 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4124 state = 0xdeadbee;
4125 action = 0xdeadbee;
4126 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4131 state = 0xdeadbee;
4132 action = 0xdeadbee;
4133 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4138 state = 0xdeadbee;
4139 action = 0xdeadbee;
4140 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4145 state = 0xdeadbee;
4146 action = 0xdeadbee;
4147 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4152 state = 0xdeadbee;
4153 action = 0xdeadbee;
4154 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4159 state = 0xdeadbee;
4160 action = 0xdeadbee;
4161 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4166 state = 0xdeadbee;
4167 action = 0xdeadbee;
4168 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4173 r = MsiDoAction( hpkg, "CostFinalize");
4174 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4176 state = 0xdeadbee;
4177 action = 0xdeadbee;
4178 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4180 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4181 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4183 state = 0xdeadbee;
4184 action = 0xdeadbee;
4185 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4187 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4188 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4190 state = 0xdeadbee;
4191 action = 0xdeadbee;
4192 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4194 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4195 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4197 state = 0xdeadbee;
4198 action = 0xdeadbee;
4199 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4201 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4202 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4204 state = 0xdeadbee;
4205 action = 0xdeadbee;
4206 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4208 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "six", &state, &action);
4214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4215 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "seven", &state, &action);
4221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4222 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "eight", &state, &action);
4228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4229 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4232 state = 0xdeadbee;
4233 action = 0xdeadbee;
4234 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4236 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4239 state = 0xdeadbee;
4240 action = 0xdeadbee;
4241 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4243 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "alpha", &state, &action);
4249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4250 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4251 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4253 state = 0xdeadbee;
4254 action = 0xdeadbee;
4255 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4257 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4258 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4260 state = 0xdeadbee;
4261 action = 0xdeadbee;
4262 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4264 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4265 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4267 state = 0xdeadbee;
4268 action = 0xdeadbee;
4269 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4271 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4272 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4274 state = 0xdeadbee;
4275 action = 0xdeadbee;
4276 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4278 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4279 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4281 state = 0xdeadbee;
4282 action = 0xdeadbee;
4283 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4285 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, 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, "zeta", &state, &action);
4291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4292 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, 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, "iota", &state, &action);
4298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4299 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4300 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4302 state = 0xdeadbee;
4303 action = 0xdeadbee;
4304 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4306 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4307 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4309 state = 0xdeadbee;
4310 action = 0xdeadbee;
4311 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4313 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "lambda", &state, &action);
4319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4320 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "mu", &state, &action);
4326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4327 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "nu", &state, &action);
4333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4334 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "xi", &state, &action);
4340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4341 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "omicron", &state, &action);
4347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4348 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "pi", &state, &action);
4354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4355 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4358 state = 0xdeadbee;
4359 action = 0xdeadbee;
4360 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4362 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4365 state = 0xdeadbee;
4366 action = 0xdeadbee;
4367 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4369 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4372 state = 0xdeadbee;
4373 action = 0xdeadbee;
4374 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4376 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4379 state = 0xdeadbee;
4380 action = 0xdeadbee;
4381 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4383 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4386 state = 0xdeadbee;
4387 action = 0xdeadbee;
4388 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4390 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4391 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4393 MsiCloseHandle(hpkg);
4395 /* uninstall the product */
4396 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4399 /* all features installed locally */
4400 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4403 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4404 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4406 /* these properties must not be in the saved msi file */
4407 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4408 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4410 hpkg = package_from_db( hdb );
4411 ok( hpkg, "failed to create package\n");
4413 state = 0xdeadbee;
4414 action = 0xdeadbee;
4415 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4416 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4417 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4418 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4420 state = 0xdeadbee;
4421 action = 0xdeadbee;
4422 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4423 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4424 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4425 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4427 state = 0xdeadbee;
4428 action = 0xdeadbee;
4429 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4430 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4431 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4432 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4434 state = 0xdeadbee;
4435 action = 0xdeadbee;
4436 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4437 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4438 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4439 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4441 state = 0xdeadbee;
4442 action = 0xdeadbee;
4443 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4444 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4445 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4446 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4448 state = 0xdeadbee;
4449 action = 0xdeadbee;
4450 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4451 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4452 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4453 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4455 state = 0xdeadbee;
4456 action = 0xdeadbee;
4457 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4458 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4459 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4460 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4462 state = 0xdeadbee;
4463 action = 0xdeadbee;
4464 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4465 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4466 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4467 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4469 state = 0xdeadbee;
4470 action = 0xdeadbee;
4471 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4472 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4473 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4474 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4476 state = 0xdeadbee;
4477 action = 0xdeadbee;
4478 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4479 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4480 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4481 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4483 state = 0xdeadbee;
4484 action = 0xdeadbee;
4485 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4486 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4487 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4488 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4490 state = 0xdeadbee;
4491 action = 0xdeadbee;
4492 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4493 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4494 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4495 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4497 state = 0xdeadbee;
4498 action = 0xdeadbee;
4499 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4500 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4501 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4502 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4504 state = 0xdeadbee;
4505 action = 0xdeadbee;
4506 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4507 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4508 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4509 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4511 state = 0xdeadbee;
4512 action = 0xdeadbee;
4513 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4514 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4515 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4516 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4518 state = 0xdeadbee;
4519 action = 0xdeadbee;
4520 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4521 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4522 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4523 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4525 state = 0xdeadbee;
4526 action = 0xdeadbee;
4527 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4528 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4529 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4530 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4532 state = 0xdeadbee;
4533 action = 0xdeadbee;
4534 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4535 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4536 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4537 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4539 state = 0xdeadbee;
4540 action = 0xdeadbee;
4541 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4542 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4543 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4544 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4546 state = 0xdeadbee;
4547 action = 0xdeadbee;
4548 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4549 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4550 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4551 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4553 state = 0xdeadbee;
4554 action = 0xdeadbee;
4555 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4556 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4557 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4558 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4560 state = 0xdeadbee;
4561 action = 0xdeadbee;
4562 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4563 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4564 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4565 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4567 state = 0xdeadbee;
4568 action = 0xdeadbee;
4569 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4570 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4571 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4572 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4574 state = 0xdeadbee;
4575 action = 0xdeadbee;
4576 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4577 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4578 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4579 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4581 state = 0xdeadbee;
4582 action = 0xdeadbee;
4583 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4584 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4585 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4586 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4588 state = 0xdeadbee;
4589 action = 0xdeadbee;
4590 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4591 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4592 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4593 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4595 state = 0xdeadbee;
4596 action = 0xdeadbee;
4597 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4598 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4599 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4600 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4602 state = 0xdeadbee;
4603 action = 0xdeadbee;
4604 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4605 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4606 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4607 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4609 state = 0xdeadbee;
4610 action = 0xdeadbee;
4611 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4612 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4613 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4614 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4616 state = 0xdeadbee;
4617 action = 0xdeadbee;
4618 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4619 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4620 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4621 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4623 state = 0xdeadbee;
4624 action = 0xdeadbee;
4625 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4626 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4627 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4628 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4630 r = MsiDoAction( hpkg, "CostInitialize");
4631 ok( r == ERROR_SUCCESS, "cost init failed\n");
4633 state = 0xdeadbee;
4634 action = 0xdeadbee;
4635 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4636 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4637 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4638 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4640 state = 0xdeadbee;
4641 action = 0xdeadbee;
4642 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4643 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4644 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4645 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4647 state = 0xdeadbee;
4648 action = 0xdeadbee;
4649 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4650 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4651 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4652 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4654 state = 0xdeadbee;
4655 action = 0xdeadbee;
4656 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4657 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4658 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4659 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4661 state = 0xdeadbee;
4662 action = 0xdeadbee;
4663 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4664 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4665 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4666 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4668 state = 0xdeadbee;
4669 action = 0xdeadbee;
4670 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4671 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4672 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4673 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4675 state = 0xdeadbee;
4676 action = 0xdeadbee;
4677 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4678 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4679 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4680 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4682 state = 0xdeadbee;
4683 action = 0xdeadbee;
4684 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4685 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4686 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4687 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4689 state = 0xdeadbee;
4690 action = 0xdeadbee;
4691 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4692 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4693 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4694 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4696 state = 0xdeadbee;
4697 action = 0xdeadbee;
4698 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4699 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4700 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4701 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4703 state = 0xdeadbee;
4704 action = 0xdeadbee;
4705 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4706 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4707 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4708 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4710 state = 0xdeadbee;
4711 action = 0xdeadbee;
4712 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4713 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4714 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4715 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4717 state = 0xdeadbee;
4718 action = 0xdeadbee;
4719 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4720 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4721 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4722 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4724 state = 0xdeadbee;
4725 action = 0xdeadbee;
4726 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4727 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4728 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4729 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4731 state = 0xdeadbee;
4732 action = 0xdeadbee;
4733 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4734 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4735 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4736 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4738 state = 0xdeadbee;
4739 action = 0xdeadbee;
4740 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4741 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4742 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4743 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4745 state = 0xdeadbee;
4746 action = 0xdeadbee;
4747 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4748 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4749 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4750 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4752 state = 0xdeadbee;
4753 action = 0xdeadbee;
4754 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4755 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4756 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4757 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4759 state = 0xdeadbee;
4760 action = 0xdeadbee;
4761 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4763 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4764 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4766 state = 0xdeadbee;
4767 action = 0xdeadbee;
4768 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4770 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4771 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4773 state = 0xdeadbee;
4774 action = 0xdeadbee;
4775 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4777 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4778 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4780 state = 0xdeadbee;
4781 action = 0xdeadbee;
4782 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4784 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4785 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4787 state = 0xdeadbee;
4788 action = 0xdeadbee;
4789 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4791 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4792 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4794 state = 0xdeadbee;
4795 action = 0xdeadbee;
4796 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4798 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4799 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4801 state = 0xdeadbee;
4802 action = 0xdeadbee;
4803 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4805 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4806 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4808 state = 0xdeadbee;
4809 action = 0xdeadbee;
4810 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4811 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4812 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4813 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4815 state = 0xdeadbee;
4816 action = 0xdeadbee;
4817 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4818 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4819 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4820 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4822 state = 0xdeadbee;
4823 action = 0xdeadbee;
4824 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4825 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4826 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4827 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4829 state = 0xdeadbee;
4830 action = 0xdeadbee;
4831 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4832 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4833 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4834 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4836 state = 0xdeadbee;
4837 action = 0xdeadbee;
4838 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4839 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4840 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4841 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4843 state = 0xdeadbee;
4844 action = 0xdeadbee;
4845 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4846 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4847 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4848 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4850 r = MsiDoAction( hpkg, "FileCost");
4851 ok( r == ERROR_SUCCESS, "file cost failed\n");
4853 state = 0xdeadbee;
4854 action = 0xdeadbee;
4855 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4857 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4860 state = 0xdeadbee;
4861 action = 0xdeadbee;
4862 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4863 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4864 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4865 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4867 state = 0xdeadbee;
4868 action = 0xdeadbee;
4869 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4870 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4871 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4872 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4874 state = 0xdeadbee;
4875 action = 0xdeadbee;
4876 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4877 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4878 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4879 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4881 state = 0xdeadbee;
4882 action = 0xdeadbee;
4883 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4885 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4886 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4888 state = 0xdeadbee;
4889 action = 0xdeadbee;
4890 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4891 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4892 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4893 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4895 state = 0xdeadbee;
4896 action = 0xdeadbee;
4897 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4898 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4899 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4900 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4902 state = 0xdeadbee;
4903 action = 0xdeadbee;
4904 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4905 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4906 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4907 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4909 state = 0xdeadbee;
4910 action = 0xdeadbee;
4911 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4912 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4913 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4914 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4916 state = 0xdeadbee;
4917 action = 0xdeadbee;
4918 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4920 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4921 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4923 state = 0xdeadbee;
4924 action = 0xdeadbee;
4925 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4927 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4930 state = 0xdeadbee;
4931 action = 0xdeadbee;
4932 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4934 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4935 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4937 state = 0xdeadbee;
4938 action = 0xdeadbee;
4939 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4941 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4942 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4944 state = 0xdeadbee;
4945 action = 0xdeadbee;
4946 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4948 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4951 state = 0xdeadbee;
4952 action = 0xdeadbee;
4953 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4955 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4956 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4958 state = 0xdeadbee;
4959 action = 0xdeadbee;
4960 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4962 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4963 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4965 state = 0xdeadbee;
4966 action = 0xdeadbee;
4967 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4969 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4972 state = 0xdeadbee;
4973 action = 0xdeadbee;
4974 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4979 state = 0xdeadbee;
4980 action = 0xdeadbee;
4981 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4986 state = 0xdeadbee;
4987 action = 0xdeadbee;
4988 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4993 state = 0xdeadbee;
4994 action = 0xdeadbee;
4995 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5000 state = 0xdeadbee;
5001 action = 0xdeadbee;
5002 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5004 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5007 state = 0xdeadbee;
5008 action = 0xdeadbee;
5009 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5014 state = 0xdeadbee;
5015 action = 0xdeadbee;
5016 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5021 state = 0xdeadbee;
5022 action = 0xdeadbee;
5023 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5028 state = 0xdeadbee;
5029 action = 0xdeadbee;
5030 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5035 state = 0xdeadbee;
5036 action = 0xdeadbee;
5037 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5042 state = 0xdeadbee;
5043 action = 0xdeadbee;
5044 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5049 state = 0xdeadbee;
5050 action = 0xdeadbee;
5051 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5056 state = 0xdeadbee;
5057 action = 0xdeadbee;
5058 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5060 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5061 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5063 state = 0xdeadbee;
5064 action = 0xdeadbee;
5065 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5067 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5068 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5070 r = MsiDoAction( hpkg, "CostFinalize");
5071 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5073 state = 0xdeadbee;
5074 action = 0xdeadbee;
5075 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5077 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5078 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5080 state = 0xdeadbee;
5081 action = 0xdeadbee;
5082 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5084 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5085 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5087 state = 0xdeadbee;
5088 action = 0xdeadbee;
5089 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5091 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5092 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5094 state = 0xdeadbee;
5095 action = 0xdeadbee;
5096 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5098 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5099 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5101 state = 0xdeadbee;
5102 action = 0xdeadbee;
5103 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5105 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5108 state = 0xdeadbee;
5109 action = 0xdeadbee;
5110 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5112 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5113 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5115 state = 0xdeadbee;
5116 action = 0xdeadbee;
5117 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5119 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5120 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5122 state = 0xdeadbee;
5123 action = 0xdeadbee;
5124 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5126 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5127 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5129 state = 0xdeadbee;
5130 action = 0xdeadbee;
5131 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5133 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5134 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5136 state = 0xdeadbee;
5137 action = 0xdeadbee;
5138 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5140 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5141 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5143 state = 0xdeadbee;
5144 action = 0xdeadbee;
5145 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5147 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5148 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5150 state = 0xdeadbee;
5151 action = 0xdeadbee;
5152 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5154 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5155 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5157 state = 0xdeadbee;
5158 action = 0xdeadbee;
5159 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5161 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5162 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5164 state = 0xdeadbee;
5165 action = 0xdeadbee;
5166 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5168 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5169 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5171 state = 0xdeadbee;
5172 action = 0xdeadbee;
5173 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5175 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5176 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5178 state = 0xdeadbee;
5179 action = 0xdeadbee;
5180 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5182 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5183 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5185 state = 0xdeadbee;
5186 action = 0xdeadbee;
5187 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5189 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5190 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5192 state = 0xdeadbee;
5193 action = 0xdeadbee;
5194 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5196 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5197 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5199 state = 0xdeadbee;
5200 action = 0xdeadbee;
5201 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5203 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5204 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5206 state = 0xdeadbee;
5207 action = 0xdeadbee;
5208 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5210 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5213 state = 0xdeadbee;
5214 action = 0xdeadbee;
5215 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5217 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5218 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5220 state = 0xdeadbee;
5221 action = 0xdeadbee;
5222 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5224 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5225 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5227 state = 0xdeadbee;
5228 action = 0xdeadbee;
5229 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5231 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5232 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5234 state = 0xdeadbee;
5235 action = 0xdeadbee;
5236 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5238 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5239 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5241 state = 0xdeadbee;
5242 action = 0xdeadbee;
5243 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5245 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5246 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5248 state = 0xdeadbee;
5249 action = 0xdeadbee;
5250 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5252 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5253 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5255 state = 0xdeadbee;
5256 action = 0xdeadbee;
5257 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5259 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5260 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5262 state = 0xdeadbee;
5263 action = 0xdeadbee;
5264 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5266 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5267 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5269 state = 0xdeadbee;
5270 action = 0xdeadbee;
5271 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5273 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5274 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5276 state = 0xdeadbee;
5277 action = 0xdeadbee;
5278 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5280 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5281 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5283 state = 0xdeadbee;
5284 action = 0xdeadbee;
5285 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5287 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5288 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5290 MsiCloseHandle(hpkg);
5292 /* uninstall the product */
5293 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5296 /* all features installed from source */
5297 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5298 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5300 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5301 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5303 /* this property must not be in the saved msi file */
5304 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5305 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5307 hpkg = package_from_db( hdb );
5308 ok( hpkg, "failed to create package\n");
5310 state = 0xdeadbee;
5311 action = 0xdeadbee;
5312 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5313 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5314 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5315 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5317 state = 0xdeadbee;
5318 action = 0xdeadbee;
5319 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5320 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5321 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5322 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5324 state = 0xdeadbee;
5325 action = 0xdeadbee;
5326 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5327 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5328 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5329 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5331 state = 0xdeadbee;
5332 action = 0xdeadbee;
5333 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5334 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5335 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5336 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5338 state = 0xdeadbee;
5339 action = 0xdeadbee;
5340 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5341 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5342 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5343 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5345 state = 0xdeadbee;
5346 action = 0xdeadbee;
5347 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5348 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5349 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5350 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5352 state = 0xdeadbee;
5353 action = 0xdeadbee;
5354 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5355 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5356 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5357 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5359 state = 0xdeadbee;
5360 action = 0xdeadbee;
5361 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5362 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5363 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5364 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5366 state = 0xdeadbee;
5367 action = 0xdeadbee;
5368 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5369 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5370 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5371 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5373 state = 0xdeadbee;
5374 action = 0xdeadbee;
5375 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5376 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5377 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5378 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5380 state = 0xdeadbee;
5381 action = 0xdeadbee;
5382 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5383 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5384 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5385 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5387 state = 0xdeadbee;
5388 action = 0xdeadbee;
5389 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5390 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5391 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5392 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5394 state = 0xdeadbee;
5395 action = 0xdeadbee;
5396 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5397 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5398 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5399 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5401 state = 0xdeadbee;
5402 action = 0xdeadbee;
5403 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5404 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5405 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5406 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5408 state = 0xdeadbee;
5409 action = 0xdeadbee;
5410 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5411 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5412 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5413 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5415 state = 0xdeadbee;
5416 action = 0xdeadbee;
5417 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5418 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5419 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5420 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5422 state = 0xdeadbee;
5423 action = 0xdeadbee;
5424 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5425 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5426 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5427 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5429 state = 0xdeadbee;
5430 action = 0xdeadbee;
5431 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5432 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5433 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5434 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5436 state = 0xdeadbee;
5437 action = 0xdeadbee;
5438 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5439 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5440 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5441 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5443 state = 0xdeadbee;
5444 action = 0xdeadbee;
5445 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5446 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5447 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5448 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5450 state = 0xdeadbee;
5451 action = 0xdeadbee;
5452 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5453 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5454 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5455 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5457 state = 0xdeadbee;
5458 action = 0xdeadbee;
5459 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5460 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5461 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5462 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5464 state = 0xdeadbee;
5465 action = 0xdeadbee;
5466 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5467 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5468 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5469 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5471 state = 0xdeadbee;
5472 action = 0xdeadbee;
5473 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5474 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5475 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5476 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5478 state = 0xdeadbee;
5479 action = 0xdeadbee;
5480 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5481 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5482 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5483 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5485 state = 0xdeadbee;
5486 action = 0xdeadbee;
5487 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5488 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5489 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5490 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5492 state = 0xdeadbee;
5493 action = 0xdeadbee;
5494 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5495 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5496 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5497 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5499 state = 0xdeadbee;
5500 action = 0xdeadbee;
5501 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5502 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5503 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5504 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5506 state = 0xdeadbee;
5507 action = 0xdeadbee;
5508 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5509 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5510 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5511 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5513 state = 0xdeadbee;
5514 action = 0xdeadbee;
5515 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5516 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5517 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5518 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5520 state = 0xdeadbee;
5521 action = 0xdeadbee;
5522 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5523 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5524 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5525 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5527 r = MsiDoAction( hpkg, "CostInitialize");
5528 ok( r == ERROR_SUCCESS, "cost init failed\n");
5530 state = 0xdeadbee;
5531 action = 0xdeadbee;
5532 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5534 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5535 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5537 state = 0xdeadbee;
5538 action = 0xdeadbee;
5539 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5541 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5542 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5544 state = 0xdeadbee;
5545 action = 0xdeadbee;
5546 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5548 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5549 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5551 state = 0xdeadbee;
5552 action = 0xdeadbee;
5553 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5555 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5558 state = 0xdeadbee;
5559 action = 0xdeadbee;
5560 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5562 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5563 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5565 state = 0xdeadbee;
5566 action = 0xdeadbee;
5567 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5569 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5570 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5572 state = 0xdeadbee;
5573 action = 0xdeadbee;
5574 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5576 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5577 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5579 state = 0xdeadbee;
5580 action = 0xdeadbee;
5581 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5583 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5584 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5586 state = 0xdeadbee;
5587 action = 0xdeadbee;
5588 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5590 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5591 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5593 state = 0xdeadbee;
5594 action = 0xdeadbee;
5595 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5597 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5598 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5600 state = 0xdeadbee;
5601 action = 0xdeadbee;
5602 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5604 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5605 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5607 state = 0xdeadbee;
5608 action = 0xdeadbee;
5609 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5611 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5612 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5614 state = 0xdeadbee;
5615 action = 0xdeadbee;
5616 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5618 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5619 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5621 state = 0xdeadbee;
5622 action = 0xdeadbee;
5623 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5625 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5626 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5628 state = 0xdeadbee;
5629 action = 0xdeadbee;
5630 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5632 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5633 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5635 state = 0xdeadbee;
5636 action = 0xdeadbee;
5637 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5639 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5640 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5642 state = 0xdeadbee;
5643 action = 0xdeadbee;
5644 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5646 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5647 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5649 state = 0xdeadbee;
5650 action = 0xdeadbee;
5651 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5653 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5654 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5656 state = 0xdeadbee;
5657 action = 0xdeadbee;
5658 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5660 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5661 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5663 state = 0xdeadbee;
5664 action = 0xdeadbee;
5665 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5666 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5667 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5668 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5670 state = 0xdeadbee;
5671 action = 0xdeadbee;
5672 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5674 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5675 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5677 state = 0xdeadbee;
5678 action = 0xdeadbee;
5679 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5681 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5682 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5684 state = 0xdeadbee;
5685 action = 0xdeadbee;
5686 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5688 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5689 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5691 state = 0xdeadbee;
5692 action = 0xdeadbee;
5693 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5695 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5696 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5698 state = 0xdeadbee;
5699 action = 0xdeadbee;
5700 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5702 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5703 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5705 state = 0xdeadbee;
5706 action = 0xdeadbee;
5707 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5709 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5710 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5712 state = 0xdeadbee;
5713 action = 0xdeadbee;
5714 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5716 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5717 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5719 state = 0xdeadbee;
5720 action = 0xdeadbee;
5721 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5723 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5724 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5726 state = 0xdeadbee;
5727 action = 0xdeadbee;
5728 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5730 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5731 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5733 state = 0xdeadbee;
5734 action = 0xdeadbee;
5735 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5737 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5738 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5740 state = 0xdeadbee;
5741 action = 0xdeadbee;
5742 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5744 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5745 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5747 r = MsiDoAction( hpkg, "FileCost");
5748 ok( r == ERROR_SUCCESS, "file cost failed\n");
5750 state = 0xdeadbee;
5751 action = 0xdeadbee;
5752 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5753 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5754 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5755 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5757 state = 0xdeadbee;
5758 action = 0xdeadbee;
5759 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5760 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5761 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5762 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5764 state = 0xdeadbee;
5765 action = 0xdeadbee;
5766 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5767 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5768 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5769 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5771 state = 0xdeadbee;
5772 action = 0xdeadbee;
5773 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5774 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5775 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5776 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5778 state = 0xdeadbee;
5779 action = 0xdeadbee;
5780 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5781 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5782 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5783 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5785 state = 0xdeadbee;
5786 action = 0xdeadbee;
5787 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5788 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5789 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5790 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5792 state = 0xdeadbee;
5793 action = 0xdeadbee;
5794 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5795 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5796 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5797 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5799 state = 0xdeadbee;
5800 action = 0xdeadbee;
5801 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5802 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5803 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5804 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5806 state = 0xdeadbee;
5807 action = 0xdeadbee;
5808 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5809 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5810 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5811 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5813 state = 0xdeadbee;
5814 action = 0xdeadbee;
5815 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5816 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5817 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5818 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5820 state = 0xdeadbee;
5821 action = 0xdeadbee;
5822 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5823 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5824 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5825 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5827 state = 0xdeadbee;
5828 action = 0xdeadbee;
5829 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5830 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5831 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5832 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5834 state = 0xdeadbee;
5835 action = 0xdeadbee;
5836 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5838 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5839 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5841 state = 0xdeadbee;
5842 action = 0xdeadbee;
5843 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5844 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5845 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5846 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5848 state = 0xdeadbee;
5849 action = 0xdeadbee;
5850 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5851 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5852 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5853 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5855 state = 0xdeadbee;
5856 action = 0xdeadbee;
5857 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5858 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5859 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5860 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5862 state = 0xdeadbee;
5863 action = 0xdeadbee;
5864 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5865 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5866 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5867 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5869 state = 0xdeadbee;
5870 action = 0xdeadbee;
5871 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5872 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5873 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5874 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5876 state = 0xdeadbee;
5877 action = 0xdeadbee;
5878 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5879 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5880 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5881 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5883 state = 0xdeadbee;
5884 action = 0xdeadbee;
5885 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5886 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5887 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5888 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5890 state = 0xdeadbee;
5891 action = 0xdeadbee;
5892 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5893 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5894 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5895 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5897 state = 0xdeadbee;
5898 action = 0xdeadbee;
5899 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5900 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5901 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5902 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5904 state = 0xdeadbee;
5905 action = 0xdeadbee;
5906 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5907 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5908 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5909 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5911 state = 0xdeadbee;
5912 action = 0xdeadbee;
5913 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5914 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5915 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5916 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5918 state = 0xdeadbee;
5919 action = 0xdeadbee;
5920 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5921 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5922 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5923 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5925 state = 0xdeadbee;
5926 action = 0xdeadbee;
5927 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5928 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5929 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5930 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5932 state = 0xdeadbee;
5933 action = 0xdeadbee;
5934 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5935 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5936 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5937 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5939 state = 0xdeadbee;
5940 action = 0xdeadbee;
5941 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5942 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5943 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5944 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5946 state = 0xdeadbee;
5947 action = 0xdeadbee;
5948 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5949 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5950 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5951 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5953 state = 0xdeadbee;
5954 action = 0xdeadbee;
5955 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5956 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5957 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5958 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5960 state = 0xdeadbee;
5961 action = 0xdeadbee;
5962 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5963 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5964 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5965 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5967 r = MsiDoAction( hpkg, "CostFinalize");
5968 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5970 state = 0xdeadbee;
5971 action = 0xdeadbee;
5972 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5974 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5975 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5977 state = 0xdeadbee;
5978 action = 0xdeadbee;
5979 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5981 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5982 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5984 state = 0xdeadbee;
5985 action = 0xdeadbee;
5986 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5988 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5989 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5991 state = 0xdeadbee;
5992 action = 0xdeadbee;
5993 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5995 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5996 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5998 state = 0xdeadbee;
5999 action = 0xdeadbee;
6000 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6002 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6005 state = 0xdeadbee;
6006 action = 0xdeadbee;
6007 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6009 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6010 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6012 state = 0xdeadbee;
6013 action = 0xdeadbee;
6014 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6016 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6017 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6019 state = 0xdeadbee;
6020 action = 0xdeadbee;
6021 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6023 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6024 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6026 state = 0xdeadbee;
6027 action = 0xdeadbee;
6028 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6030 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6031 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6033 state = 0xdeadbee;
6034 action = 0xdeadbee;
6035 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6037 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6038 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6040 state = 0xdeadbee;
6041 action = 0xdeadbee;
6042 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6044 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6045 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6047 state = 0xdeadbee;
6048 action = 0xdeadbee;
6049 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6051 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6054 state = 0xdeadbee;
6055 action = 0xdeadbee;
6056 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6058 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6061 state = 0xdeadbee;
6062 action = 0xdeadbee;
6063 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6065 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6066 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6068 state = 0xdeadbee;
6069 action = 0xdeadbee;
6070 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6072 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6073 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6075 state = 0xdeadbee;
6076 action = 0xdeadbee;
6077 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6079 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6082 state = 0xdeadbee;
6083 action = 0xdeadbee;
6084 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6086 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6089 state = 0xdeadbee;
6090 action = 0xdeadbee;
6091 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6093 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6094 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6096 state = 0xdeadbee;
6097 action = 0xdeadbee;
6098 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6100 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6101 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6103 state = 0xdeadbee;
6104 action = 0xdeadbee;
6105 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6107 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6110 state = 0xdeadbee;
6111 action = 0xdeadbee;
6112 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6114 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6115 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6117 state = 0xdeadbee;
6118 action = 0xdeadbee;
6119 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6121 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6124 state = 0xdeadbee;
6125 action = 0xdeadbee;
6126 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6128 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6131 state = 0xdeadbee;
6132 action = 0xdeadbee;
6133 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6135 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6136 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6138 state = 0xdeadbee;
6139 action = 0xdeadbee;
6140 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6142 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6143 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6145 state = 0xdeadbee;
6146 action = 0xdeadbee;
6147 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6149 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6152 state = 0xdeadbee;
6153 action = 0xdeadbee;
6154 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6156 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6159 state = 0xdeadbee;
6160 action = 0xdeadbee;
6161 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6163 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6164 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6166 state = 0xdeadbee;
6167 action = 0xdeadbee;
6168 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6170 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6171 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6173 state = 0xdeadbee;
6174 action = 0xdeadbee;
6175 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6177 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6178 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6180 state = 0xdeadbee;
6181 action = 0xdeadbee;
6182 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6184 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6185 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6187 MsiCloseHandle(hpkg);
6189 /* reinstall the product */
6190 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6191 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6193 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6194 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6196 /* this property must not be in the saved msi file */
6197 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6198 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6200 hpkg = package_from_db( hdb );
6201 ok( hpkg, "failed to create package\n");
6203 state = 0xdeadbee;
6204 action = 0xdeadbee;
6205 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6206 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6207 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6208 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6210 state = 0xdeadbee;
6211 action = 0xdeadbee;
6212 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6213 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6214 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6215 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6217 state = 0xdeadbee;
6218 action = 0xdeadbee;
6219 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6220 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6221 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6222 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6224 state = 0xdeadbee;
6225 action = 0xdeadbee;
6226 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6227 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6228 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6229 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6231 state = 0xdeadbee;
6232 action = 0xdeadbee;
6233 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6234 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6235 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6236 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6238 state = 0xdeadbee;
6239 action = 0xdeadbee;
6240 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6241 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6242 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6243 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6245 state = 0xdeadbee;
6246 action = 0xdeadbee;
6247 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6248 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6249 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6250 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6252 state = 0xdeadbee;
6253 action = 0xdeadbee;
6254 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6255 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6256 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6257 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6259 state = 0xdeadbee;
6260 action = 0xdeadbee;
6261 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6262 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6263 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6264 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6266 state = 0xdeadbee;
6267 action = 0xdeadbee;
6268 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6269 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6270 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6271 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6273 state = 0xdeadbee;
6274 action = 0xdeadbee;
6275 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6276 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6277 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6278 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6280 state = 0xdeadbee;
6281 action = 0xdeadbee;
6282 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6283 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6284 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6285 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6287 state = 0xdeadbee;
6288 action = 0xdeadbee;
6289 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6290 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6291 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6292 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6294 state = 0xdeadbee;
6295 action = 0xdeadbee;
6296 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6297 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6298 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6299 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6301 state = 0xdeadbee;
6302 action = 0xdeadbee;
6303 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6304 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6305 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6306 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6308 state = 0xdeadbee;
6309 action = 0xdeadbee;
6310 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6311 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6312 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6313 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6315 state = 0xdeadbee;
6316 action = 0xdeadbee;
6317 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6318 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6319 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6320 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6322 state = 0xdeadbee;
6323 action = 0xdeadbee;
6324 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6325 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6326 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6327 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6329 state = 0xdeadbee;
6330 action = 0xdeadbee;
6331 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6332 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6333 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6334 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6336 state = 0xdeadbee;
6337 action = 0xdeadbee;
6338 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6339 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6340 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6341 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6343 state = 0xdeadbee;
6344 action = 0xdeadbee;
6345 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6346 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6347 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6348 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6350 state = 0xdeadbee;
6351 action = 0xdeadbee;
6352 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6353 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6354 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6355 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6357 state = 0xdeadbee;
6358 action = 0xdeadbee;
6359 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6360 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6361 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6362 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6364 state = 0xdeadbee;
6365 action = 0xdeadbee;
6366 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6367 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6368 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6369 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6371 state = 0xdeadbee;
6372 action = 0xdeadbee;
6373 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6374 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6375 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6376 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6378 state = 0xdeadbee;
6379 action = 0xdeadbee;
6380 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6381 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6382 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6383 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6385 state = 0xdeadbee;
6386 action = 0xdeadbee;
6387 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6388 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6389 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6390 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6392 state = 0xdeadbee;
6393 action = 0xdeadbee;
6394 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6395 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6396 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6397 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6399 state = 0xdeadbee;
6400 action = 0xdeadbee;
6401 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6402 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6403 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6404 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6406 state = 0xdeadbee;
6407 action = 0xdeadbee;
6408 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6409 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6410 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6411 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6413 state = 0xdeadbee;
6414 action = 0xdeadbee;
6415 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6416 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6417 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6418 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6420 r = MsiDoAction( hpkg, "CostInitialize");
6421 ok( r == ERROR_SUCCESS, "cost init failed\n");
6423 state = 0xdeadbee;
6424 action = 0xdeadbee;
6425 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6430 state = 0xdeadbee;
6431 action = 0xdeadbee;
6432 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6437 state = 0xdeadbee;
6438 action = 0xdeadbee;
6439 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6441 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6442 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6444 state = 0xdeadbee;
6445 action = 0xdeadbee;
6446 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6448 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6449 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6451 state = 0xdeadbee;
6452 action = 0xdeadbee;
6453 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6455 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6456 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6458 state = 0xdeadbee;
6459 action = 0xdeadbee;
6460 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6462 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6463 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6465 state = 0xdeadbee;
6466 action = 0xdeadbee;
6467 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6469 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6472 state = 0xdeadbee;
6473 action = 0xdeadbee;
6474 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6475 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6476 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6477 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6479 state = 0xdeadbee;
6480 action = 0xdeadbee;
6481 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6482 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6483 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6484 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6486 state = 0xdeadbee;
6487 action = 0xdeadbee;
6488 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6490 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6491 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6493 state = 0xdeadbee;
6494 action = 0xdeadbee;
6495 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6496 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6497 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6498 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6500 state = 0xdeadbee;
6501 action = 0xdeadbee;
6502 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6503 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6504 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6505 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6507 state = 0xdeadbee;
6508 action = 0xdeadbee;
6509 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6510 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6511 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6512 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6514 state = 0xdeadbee;
6515 action = 0xdeadbee;
6516 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6517 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6518 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6519 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6521 state = 0xdeadbee;
6522 action = 0xdeadbee;
6523 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6525 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6526 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6528 state = 0xdeadbee;
6529 action = 0xdeadbee;
6530 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6531 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6532 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6533 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6535 state = 0xdeadbee;
6536 action = 0xdeadbee;
6537 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6538 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6539 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6540 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6542 state = 0xdeadbee;
6543 action = 0xdeadbee;
6544 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6545 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6546 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6547 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6549 state = 0xdeadbee;
6550 action = 0xdeadbee;
6551 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6552 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6553 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6554 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6556 state = 0xdeadbee;
6557 action = 0xdeadbee;
6558 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6559 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6560 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6561 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6563 state = 0xdeadbee;
6564 action = 0xdeadbee;
6565 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6566 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6567 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6568 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6570 state = 0xdeadbee;
6571 action = 0xdeadbee;
6572 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6573 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6574 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6575 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6577 state = 0xdeadbee;
6578 action = 0xdeadbee;
6579 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6580 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6581 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6582 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6584 state = 0xdeadbee;
6585 action = 0xdeadbee;
6586 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6587 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6588 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6589 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6591 state = 0xdeadbee;
6592 action = 0xdeadbee;
6593 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6594 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6595 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6596 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6598 state = 0xdeadbee;
6599 action = 0xdeadbee;
6600 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6601 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6602 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6603 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6605 state = 0xdeadbee;
6606 action = 0xdeadbee;
6607 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6608 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6609 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6610 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6612 state = 0xdeadbee;
6613 action = 0xdeadbee;
6614 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6615 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6616 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6617 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6619 state = 0xdeadbee;
6620 action = 0xdeadbee;
6621 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6622 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6623 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6624 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6626 state = 0xdeadbee;
6627 action = 0xdeadbee;
6628 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6629 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6630 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6631 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6633 state = 0xdeadbee;
6634 action = 0xdeadbee;
6635 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6636 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6637 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6638 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6640 r = MsiDoAction( hpkg, "FileCost");
6641 ok( r == ERROR_SUCCESS, "file cost failed\n");
6643 state = 0xdeadbee;
6644 action = 0xdeadbee;
6645 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6647 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6648 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6650 state = 0xdeadbee;
6651 action = 0xdeadbee;
6652 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6654 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6655 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6657 state = 0xdeadbee;
6658 action = 0xdeadbee;
6659 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6661 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6664 state = 0xdeadbee;
6665 action = 0xdeadbee;
6666 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6668 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6671 state = 0xdeadbee;
6672 action = 0xdeadbee;
6673 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6675 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6676 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6678 state = 0xdeadbee;
6679 action = 0xdeadbee;
6680 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6682 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6683 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6685 state = 0xdeadbee;
6686 action = 0xdeadbee;
6687 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6689 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6690 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6692 state = 0xdeadbee;
6693 action = 0xdeadbee;
6694 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6696 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6697 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6699 state = 0xdeadbee;
6700 action = 0xdeadbee;
6701 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6703 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6704 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6706 state = 0xdeadbee;
6707 action = 0xdeadbee;
6708 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6710 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6711 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6713 state = 0xdeadbee;
6714 action = 0xdeadbee;
6715 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6717 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6718 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6720 state = 0xdeadbee;
6721 action = 0xdeadbee;
6722 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6723 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6724 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6725 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6727 state = 0xdeadbee;
6728 action = 0xdeadbee;
6729 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6730 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6731 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6732 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6734 state = 0xdeadbee;
6735 action = 0xdeadbee;
6736 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6737 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6738 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6739 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6741 state = 0xdeadbee;
6742 action = 0xdeadbee;
6743 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6745 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6746 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6748 state = 0xdeadbee;
6749 action = 0xdeadbee;
6750 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6752 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6753 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6755 state = 0xdeadbee;
6756 action = 0xdeadbee;
6757 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6759 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6760 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6762 state = 0xdeadbee;
6763 action = 0xdeadbee;
6764 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6766 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6767 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6769 state = 0xdeadbee;
6770 action = 0xdeadbee;
6771 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6773 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6774 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6776 state = 0xdeadbee;
6777 action = 0xdeadbee;
6778 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6779 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6780 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6781 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6783 state = 0xdeadbee;
6784 action = 0xdeadbee;
6785 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6786 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6787 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6788 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6790 state = 0xdeadbee;
6791 action = 0xdeadbee;
6792 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6793 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6794 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6795 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6797 state = 0xdeadbee;
6798 action = 0xdeadbee;
6799 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6801 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6802 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6804 state = 0xdeadbee;
6805 action = 0xdeadbee;
6806 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6808 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6809 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6811 state = 0xdeadbee;
6812 action = 0xdeadbee;
6813 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6815 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6816 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6818 state = 0xdeadbee;
6819 action = 0xdeadbee;
6820 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6821 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6822 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6823 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6825 state = 0xdeadbee;
6826 action = 0xdeadbee;
6827 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6829 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6830 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6832 state = 0xdeadbee;
6833 action = 0xdeadbee;
6834 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6835 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6836 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6837 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6839 state = 0xdeadbee;
6840 action = 0xdeadbee;
6841 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6842 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6843 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6844 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6846 state = 0xdeadbee;
6847 action = 0xdeadbee;
6848 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6850 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6851 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6853 state = 0xdeadbee;
6854 action = 0xdeadbee;
6855 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6857 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6860 r = MsiDoAction( hpkg, "CostFinalize");
6861 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6863 state = 0xdeadbee;
6864 action = 0xdeadbee;
6865 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6867 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6868 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6870 state = 0xdeadbee;
6871 action = 0xdeadbee;
6872 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6874 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6875 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6877 state = 0xdeadbee;
6878 action = 0xdeadbee;
6879 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6881 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6882 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6884 state = 0xdeadbee;
6885 action = 0xdeadbee;
6886 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6888 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6889 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6891 state = 0xdeadbee;
6892 action = 0xdeadbee;
6893 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6894 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6895 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6896 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6898 state = 0xdeadbee;
6899 action = 0xdeadbee;
6900 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6901 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6902 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6903 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6905 state = 0xdeadbee;
6906 action = 0xdeadbee;
6907 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6908 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6909 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6910 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6912 state = 0xdeadbee;
6913 action = 0xdeadbee;
6914 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6915 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6916 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6917 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6919 state = 0xdeadbee;
6920 action = 0xdeadbee;
6921 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6922 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6923 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6924 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6926 state = 0xdeadbee;
6927 action = 0xdeadbee;
6928 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6929 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6930 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6931 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6933 state = 0xdeadbee;
6934 action = 0xdeadbee;
6935 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6936 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6937 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6938 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6940 state = 0xdeadbee;
6941 action = 0xdeadbee;
6942 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6943 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6944 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6945 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6947 state = 0xdeadbee;
6948 action = 0xdeadbee;
6949 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6950 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6951 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6952 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6954 state = 0xdeadbee;
6955 action = 0xdeadbee;
6956 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6957 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6958 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6959 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6961 state = 0xdeadbee;
6962 action = 0xdeadbee;
6963 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6965 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6966 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6968 state = 0xdeadbee;
6969 action = 0xdeadbee;
6970 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6971 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6972 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6973 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6975 state = 0xdeadbee;
6976 action = 0xdeadbee;
6977 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6978 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6979 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6980 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6982 state = 0xdeadbee;
6983 action = 0xdeadbee;
6984 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6985 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6986 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6987 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6989 state = 0xdeadbee;
6990 action = 0xdeadbee;
6991 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6992 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6993 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6994 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6996 state = 0xdeadbee;
6997 action = 0xdeadbee;
6998 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6999 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7000 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7001 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7003 state = 0xdeadbee;
7004 action = 0xdeadbee;
7005 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7007 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7008 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7010 state = 0xdeadbee;
7011 action = 0xdeadbee;
7012 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7014 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7015 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7017 state = 0xdeadbee;
7018 action = 0xdeadbee;
7019 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7021 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7022 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7024 state = 0xdeadbee;
7025 action = 0xdeadbee;
7026 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7027 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7028 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7029 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7031 state = 0xdeadbee;
7032 action = 0xdeadbee;
7033 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7035 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7036 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7038 state = 0xdeadbee;
7039 action = 0xdeadbee;
7040 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7042 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7043 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7045 state = 0xdeadbee;
7046 action = 0xdeadbee;
7047 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7049 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7050 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7052 state = 0xdeadbee;
7053 action = 0xdeadbee;
7054 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7056 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7057 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7059 state = 0xdeadbee;
7060 action = 0xdeadbee;
7061 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7063 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7064 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7066 state = 0xdeadbee;
7067 action = 0xdeadbee;
7068 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7070 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7071 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7073 state = 0xdeadbee;
7074 action = 0xdeadbee;
7075 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7077 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7078 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7080 MsiCloseHandle(hpkg);
7082 /* uninstall the product */
7083 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7086 DeleteFileA(msifile);
7087 DeleteFileA(msifile2);
7088 DeleteFileA(msifile3);
7089 DeleteFileA(msifile4);
7092 static void test_getproperty(void)
7094 MSIHANDLE hPackage = 0;
7095 char prop[100];
7096 static CHAR empty[] = "";
7097 DWORD size;
7098 UINT r;
7100 hPackage = package_from_db(create_package_db());
7101 ok( hPackage != 0, " Failed to create package\n");
7103 /* set the property */
7104 r = MsiSetProperty(hPackage, "Name", "Value");
7105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7107 /* retrieve the size, NULL pointer */
7108 size = 0;
7109 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7111 ok( size == 5, "Expected 5, got %d\n", size);
7113 /* retrieve the size, empty string */
7114 size = 0;
7115 r = MsiGetProperty(hPackage, "Name", empty, &size);
7116 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7117 ok( size == 5, "Expected 5, got %d\n", size);
7119 /* don't change size */
7120 r = MsiGetProperty(hPackage, "Name", prop, &size);
7121 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7122 ok( size == 5, "Expected 5, got %d\n", size);
7123 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7125 /* increase the size by 1 */
7126 size++;
7127 r = MsiGetProperty(hPackage, "Name", prop, &size);
7128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7129 ok( size == 5, "Expected 5, got %d\n", size);
7130 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7132 r = MsiCloseHandle( hPackage);
7133 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7134 DeleteFile(msifile);
7137 static void test_removefiles(void)
7139 MSIHANDLE hpkg;
7140 UINT r;
7141 MSIHANDLE hdb;
7143 hdb = create_package_db();
7144 ok ( hdb, "failed to create package database\n" );
7146 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7147 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7149 r = create_feature_table( hdb );
7150 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7152 r = create_component_table( hdb );
7153 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7155 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7156 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7158 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7159 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7161 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7162 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7164 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7165 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7167 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7168 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7170 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7171 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7173 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7174 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7176 r = create_feature_components_table( hdb );
7177 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7179 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7180 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7182 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7183 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7185 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7186 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7188 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7189 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7191 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7192 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7194 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7195 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7197 r = create_file_table( hdb );
7198 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7200 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7201 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7203 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7204 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7206 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7207 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7209 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7210 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7212 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7213 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7215 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7216 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7218 r = create_remove_file_table( hdb );
7219 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7221 hpkg = package_from_db( hdb );
7222 ok( hpkg, "failed to create package\n");
7224 MsiCloseHandle( hdb );
7226 create_test_file( "hydrogen.txt" );
7227 create_test_file( "helium.txt" );
7228 create_test_file( "lithium.txt" );
7229 create_test_file( "beryllium.txt" );
7230 create_test_file( "boron.txt" );
7231 create_test_file( "carbon.txt" );
7233 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7234 ok( r == ERROR_SUCCESS, "set property failed\n");
7236 r = MsiDoAction( hpkg, "CostInitialize");
7237 ok( r == ERROR_SUCCESS, "cost init failed\n");
7239 r = MsiDoAction( hpkg, "FileCost");
7240 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7242 r = MsiDoAction( hpkg, "CostFinalize");
7243 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7245 r = MsiDoAction( hpkg, "InstallValidate");
7246 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7248 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7249 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7251 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7252 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7254 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7255 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7257 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7258 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7260 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7261 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7263 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7264 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7266 r = MsiDoAction( hpkg, "RemoveFiles");
7267 ok( r == ERROR_SUCCESS, "remove files failed\n");
7269 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7270 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7271 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7272 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7273 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7274 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7276 MsiCloseHandle( hpkg );
7277 DeleteFileA(msifile);
7280 static void test_appsearch(void)
7282 MSIHANDLE hpkg;
7283 UINT r;
7284 MSIHANDLE hdb;
7285 CHAR prop[MAX_PATH];
7286 DWORD size = MAX_PATH;
7288 hdb = create_package_db();
7289 ok ( hdb, "failed to create package database\n" );
7291 r = create_appsearch_table( hdb );
7292 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7294 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7295 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7297 r = create_reglocator_table( hdb );
7298 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7300 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7301 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7303 r = create_signature_table( hdb );
7304 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7306 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7307 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7309 hpkg = package_from_db( hdb );
7310 ok( hpkg, "failed to create package\n");
7312 MsiCloseHandle( hdb );
7314 r = MsiDoAction( hpkg, "AppSearch" );
7315 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7317 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7318 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7319 todo_wine
7321 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7324 MsiCloseHandle( hpkg );
7325 DeleteFileA(msifile);
7328 static void test_appsearch_complocator(void)
7330 MSIHANDLE hpkg, hdb;
7331 CHAR path[MAX_PATH];
7332 CHAR prop[MAX_PATH];
7333 LPSTR usersid;
7334 DWORD size;
7335 UINT r;
7337 get_user_sid(&usersid);
7338 if (!usersid)
7340 skip("ConvertSidToStringSidA is not available\n");
7341 return;
7344 create_test_file("FileName1");
7345 create_test_file("FileName4");
7346 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7347 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7349 create_test_file("FileName2");
7350 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7351 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7353 create_test_file("FileName3");
7354 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7355 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7357 create_test_file("FileName5");
7358 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7359 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7361 create_test_file("FileName6");
7362 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7363 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7365 create_test_file("FileName7");
7366 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7367 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7369 /* dir is FALSE, but we're pretending it's a directory */
7370 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7371 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7373 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7374 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7375 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7377 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7378 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7379 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7381 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7382 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7383 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7385 hdb = create_package_db();
7386 ok(hdb, "Expected a valid database handle\n");
7388 r = create_appsearch_table(hdb);
7389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7391 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7394 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7397 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7400 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7403 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7406 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7409 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7412 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7415 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7418 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7421 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7424 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7427 r = create_complocator_table(hdb);
7428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7430 /* published component, machine, file, signature, misdbLocatorTypeFile */
7431 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7434 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7435 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7438 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7439 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7442 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7443 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7446 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7447 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7450 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7451 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7452 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7454 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7455 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7458 /* unpublished component, no signature, misdbLocatorTypeDir */
7459 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7462 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7463 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7466 /* published component, signature w/ ver, misdbLocatorTypeFile */
7467 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7470 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7471 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7474 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7475 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7476 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7478 r = create_signature_table(hdb);
7479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7481 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7484 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7487 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7488 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7490 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7493 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7494 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7496 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7499 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7502 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7505 hpkg = package_from_db(hdb);
7506 ok(hpkg, "Expected a valid package handle\n");
7508 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7511 r = MsiDoAction(hpkg, "AppSearch");
7512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7514 size = MAX_PATH;
7515 sprintf(path, "%s\\FileName1", CURR_DIR);
7516 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7518 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7520 size = MAX_PATH;
7521 sprintf(path, "%s\\FileName2", CURR_DIR);
7522 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7524 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7526 size = MAX_PATH;
7527 sprintf(path, "%s\\FileName3", CURR_DIR);
7528 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7530 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7532 size = MAX_PATH;
7533 sprintf(path, "%s\\FileName4", CURR_DIR);
7534 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7536 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7538 size = MAX_PATH;
7539 sprintf(path, "%s\\FileName5", CURR_DIR);
7540 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7542 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7544 size = MAX_PATH;
7545 sprintf(path, "%s\\", CURR_DIR);
7546 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7548 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7550 size = MAX_PATH;
7551 sprintf(path, "%s\\", CURR_DIR);
7552 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7554 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7556 size = MAX_PATH;
7557 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7559 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7561 size = MAX_PATH;
7562 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7564 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7566 size = MAX_PATH;
7567 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7568 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7570 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7572 size = MAX_PATH;
7573 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7575 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7577 size = MAX_PATH;
7578 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7579 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7580 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7581 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7583 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7584 MSIINSTALLCONTEXT_MACHINE, NULL);
7585 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7586 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7587 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7588 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7589 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7590 MSIINSTALLCONTEXT_MACHINE, NULL);
7591 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7592 MSIINSTALLCONTEXT_MACHINE, NULL);
7593 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7594 MSIINSTALLCONTEXT_MACHINE, NULL);
7595 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7596 MSIINSTALLCONTEXT_MACHINE, NULL);
7597 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7598 MSIINSTALLCONTEXT_MACHINE, NULL);
7599 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7600 MSIINSTALLCONTEXT_MACHINE, NULL);
7601 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7602 MSIINSTALLCONTEXT_MACHINE, NULL);
7604 DeleteFileA("FileName1");
7605 DeleteFileA("FileName2");
7606 DeleteFileA("FileName3");
7607 DeleteFileA("FileName4");
7608 DeleteFileA("FileName5");
7609 DeleteFileA("FileName6");
7610 DeleteFileA("FileName7");
7611 DeleteFileA("FileName8.dll");
7612 DeleteFileA("FileName9.dll");
7613 DeleteFileA("FileName10.dll");
7614 MsiCloseHandle(hpkg);
7615 DeleteFileA(msifile);
7618 static void test_appsearch_reglocator(void)
7620 MSIHANDLE hpkg, hdb;
7621 CHAR path[MAX_PATH];
7622 CHAR prop[MAX_PATH];
7623 DWORD binary[2];
7624 DWORD size, val;
7625 BOOL space, version;
7626 HKEY hklm, classes;
7627 HKEY hkcu, users;
7628 LPSTR pathdata;
7629 LPSTR pathvar;
7630 LPCSTR str;
7631 LPSTR ptr;
7632 LONG res;
7633 UINT r;
7635 version = TRUE;
7636 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7637 version = FALSE;
7639 DeleteFileA("test.dll");
7641 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7642 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7644 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7645 (const BYTE *)"regszdata", 10);
7646 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7648 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7649 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7651 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7652 (const BYTE *)"regszdata", 10);
7653 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7655 users = 0;
7656 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7657 ok(res == ERROR_SUCCESS ||
7658 broken(res == ERROR_INVALID_PARAMETER),
7659 "Expected ERROR_SUCCESS, got %d\n", res);
7661 if (res == ERROR_SUCCESS)
7663 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7664 (const BYTE *)"regszdata", 10);
7665 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7668 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7669 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7671 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7672 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7674 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7675 (const BYTE *)"regszdata", 10);
7676 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7678 val = 42;
7679 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7680 (const BYTE *)&val, sizeof(DWORD));
7681 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7683 val = -42;
7684 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7685 (const BYTE *)&val, sizeof(DWORD));
7686 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7688 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7689 (const BYTE *)"%PATH%", 7);
7690 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7692 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7693 (const BYTE *)"my%NOVAR%", 10);
7694 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7696 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7697 (const BYTE *)"one\0two\0", 9);
7698 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7700 binary[0] = 0x1234abcd;
7701 binary[1] = 0x567890ef;
7702 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7703 (const BYTE *)binary, sizeof(binary));
7704 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7706 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7707 (const BYTE *)"#regszdata", 11);
7708 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7710 create_test_file("FileName1");
7711 sprintf(path, "%s\\FileName1", CURR_DIR);
7712 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7713 (const BYTE *)path, lstrlenA(path) + 1);
7714 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7716 sprintf(path, "%s\\FileName2", CURR_DIR);
7717 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7718 (const BYTE *)path, lstrlenA(path) + 1);
7719 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7721 lstrcpyA(path, CURR_DIR);
7722 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7723 (const BYTE *)path, lstrlenA(path) + 1);
7724 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7726 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
7727 (const BYTE *)"", 1);
7728 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7730 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7731 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7732 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
7733 (const BYTE *)path, lstrlenA(path) + 1);
7734 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7736 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7737 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
7738 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
7739 (const BYTE *)path, lstrlenA(path) + 1);
7740 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7742 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7743 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7744 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
7745 (const BYTE *)path, lstrlenA(path) + 1);
7746 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7748 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
7749 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
7750 (const BYTE *)path, lstrlenA(path) + 1);
7752 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
7753 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
7754 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
7755 (const BYTE *)path, lstrlenA(path) + 1);
7757 hdb = create_package_db();
7758 ok(hdb, "Expected a valid database handle\n");
7760 r = create_appsearch_table(hdb);
7761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7763 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7766 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7769 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7772 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7775 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7776 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7778 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7781 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7784 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7787 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7790 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7793 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7796 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7799 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
7800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7802 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
7803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7805 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
7806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7808 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
7809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7811 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
7812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7814 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
7815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7817 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
7818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7820 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
7821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7823 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
7824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7826 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
7827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7829 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
7830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7832 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
7833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7835 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
7836 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7838 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
7839 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7841 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
7842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7844 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
7845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7847 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
7848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7850 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
7851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7853 r = create_reglocator_table(hdb);
7854 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7856 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7857 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7858 r = add_reglocator_entry(hdb, str);
7859 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7861 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7862 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7863 r = add_reglocator_entry(hdb, str);
7864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7866 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7867 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7868 r = add_reglocator_entry(hdb, str);
7869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7871 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7872 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7873 r = add_reglocator_entry(hdb, str);
7874 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7876 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7877 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7878 r = add_reglocator_entry(hdb, str);
7879 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7881 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7882 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7883 r = add_reglocator_entry(hdb, str);
7884 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7886 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7887 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7888 r = add_reglocator_entry(hdb, str);
7889 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7891 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7892 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7893 r = add_reglocator_entry(hdb, str);
7894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7896 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7897 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7898 r = add_reglocator_entry(hdb, str);
7899 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7901 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7902 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7903 r = add_reglocator_entry(hdb, str);
7904 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7906 /* HKLM, msidbLocatorTypeFileName, no signature */
7907 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7908 r = add_reglocator_entry(hdb, str);
7909 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7911 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7912 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7913 r = add_reglocator_entry(hdb, str);
7914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7916 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7917 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7918 r = add_reglocator_entry(hdb, str);
7919 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7921 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
7922 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
7923 r = add_reglocator_entry(hdb, str);
7924 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7926 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
7927 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
7928 r = add_reglocator_entry(hdb, str);
7929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7931 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
7932 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
7933 r = add_reglocator_entry(hdb, str);
7934 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7936 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
7937 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
7938 r = add_reglocator_entry(hdb, str);
7939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7941 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
7942 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
7943 r = add_reglocator_entry(hdb, str);
7944 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7946 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
7947 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
7948 r = add_reglocator_entry(hdb, str);
7949 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7951 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
7952 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
7953 r = add_reglocator_entry(hdb, str);
7954 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7956 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
7957 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
7958 r = add_reglocator_entry(hdb, str);
7959 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7961 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
7962 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
7963 r = add_reglocator_entry(hdb, str);
7964 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7966 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
7967 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
7968 r = add_reglocator_entry(hdb, str);
7969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7971 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
7972 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
7973 r = add_reglocator_entry(hdb, str);
7974 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7976 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
7977 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
7978 r = add_reglocator_entry(hdb, str);
7979 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7981 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
7982 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
7983 r = add_reglocator_entry(hdb, str);
7984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7986 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
7987 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
7988 r = add_reglocator_entry(hdb, str);
7989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7991 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
7992 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
7993 r = add_reglocator_entry(hdb, str);
7994 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7996 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
7997 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
7998 r = add_reglocator_entry(hdb, str);
7999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8001 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8002 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
8003 r = add_reglocator_entry(hdb, str);
8004 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8006 r = create_signature_table(hdb);
8007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8009 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8010 r = add_signature_entry(hdb, str);
8011 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8013 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8014 r = add_signature_entry(hdb, str);
8015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8017 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8018 r = add_signature_entry(hdb, str);
8019 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8021 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8022 r = add_signature_entry(hdb, str);
8023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8025 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8026 r = add_signature_entry(hdb, str);
8027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8029 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8030 r = add_signature_entry(hdb, str);
8031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8033 ptr = strrchr(CURR_DIR, '\\') + 1;
8034 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8035 r = add_signature_entry(hdb, path);
8036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8038 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8039 r = add_signature_entry(hdb, str);
8040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8042 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8043 r = add_signature_entry(hdb, str);
8044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8046 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8047 r = add_signature_entry(hdb, str);
8048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8050 hpkg = package_from_db(hdb);
8051 ok(hpkg, "Expected a valid package handle\n");
8053 r = MsiDoAction(hpkg, "AppSearch");
8054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8056 size = MAX_PATH;
8057 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8059 ok(!lstrcmpA(prop, "regszdata"),
8060 "Expected \"regszdata\", got \"%s\"\n", prop);
8062 size = MAX_PATH;
8063 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8065 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8067 size = MAX_PATH;
8068 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8070 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8072 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8073 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8075 /* Workaround for Win95 */
8076 CHAR tempbuf[1];
8077 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8079 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8080 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8082 size = 0;
8083 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8086 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8087 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8089 ok(!lstrcmpA(pathdata, pathvar),
8090 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8092 HeapFree(GetProcessHeap(), 0, pathvar);
8093 HeapFree(GetProcessHeap(), 0, pathdata);
8095 size = MAX_PATH;
8096 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8098 ok(!lstrcmpA(prop,
8099 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8101 size = MAX_PATH;
8102 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8104 todo_wine
8106 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8107 "Expected \"\\0one\\0two\\0\\0\"\n");
8110 size = MAX_PATH;
8111 lstrcpyA(path, "#xCDAB3412EF907856");
8112 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8114 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8116 size = MAX_PATH;
8117 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8119 ok(!lstrcmpA(prop, "##regszdata"),
8120 "Expected \"##regszdata\", got \"%s\"\n", prop);
8122 size = MAX_PATH;
8123 sprintf(path, "%s\\FileName1", CURR_DIR);
8124 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8126 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8128 size = MAX_PATH;
8129 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8131 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8133 size = MAX_PATH;
8134 sprintf(path, "%s\\", CURR_DIR);
8135 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8137 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8139 size = MAX_PATH;
8140 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8142 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8144 size = MAX_PATH;
8145 sprintf(path, "%s\\", CURR_DIR);
8146 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8148 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8150 size = MAX_PATH;
8151 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8152 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8153 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8155 size = MAX_PATH;
8156 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8158 ok(!lstrcmpA(prop, "regszdata"),
8159 "Expected \"regszdata\", got \"%s\"\n", prop);
8161 size = MAX_PATH;
8162 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8163 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8164 ok(!lstrcmpA(prop, "regszdata"),
8165 "Expected \"regszdata\", got \"%s\"\n", prop);
8167 if (users)
8169 size = MAX_PATH;
8170 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8172 ok(!lstrcmpA(prop, "regszdata"),
8173 "Expected \"regszdata\", got \"%s\"\n", prop);
8176 size = MAX_PATH;
8177 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8179 ok(!lstrcmpA(prop, "defvalue"),
8180 "Expected \"defvalue\", got \"%s\"\n", prop);
8182 size = MAX_PATH;
8183 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8185 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8187 size = MAX_PATH;
8188 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8190 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8192 if (version)
8194 size = MAX_PATH;
8195 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8196 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8197 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8198 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8200 size = MAX_PATH;
8201 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8203 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8205 size = MAX_PATH;
8206 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8207 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8209 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8212 size = MAX_PATH;
8213 lstrcpyA(path, CURR_DIR);
8214 ptr = strrchr(path, '\\') + 1;
8215 *ptr = '\0';
8216 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8218 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8220 size = MAX_PATH;
8221 sprintf(path, "%s\\", CURR_DIR);
8222 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8223 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8224 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8226 size = MAX_PATH;
8227 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8228 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8229 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8231 size = MAX_PATH;
8232 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8233 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8234 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8236 size = MAX_PATH;
8237 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8239 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8241 size = MAX_PATH;
8242 sprintf(path, "%s\\FileName1", CURR_DIR);
8243 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8245 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8247 size = MAX_PATH;
8248 sprintf(path, "%s\\FileName1", CURR_DIR);
8249 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8251 if (space)
8252 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8253 else
8254 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8256 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8257 RegDeleteValueA(hklm, "Value1");
8258 RegDeleteValueA(hklm, "Value2");
8259 RegDeleteValueA(hklm, "Value3");
8260 RegDeleteValueA(hklm, "Value4");
8261 RegDeleteValueA(hklm, "Value5");
8262 RegDeleteValueA(hklm, "Value6");
8263 RegDeleteValueA(hklm, "Value7");
8264 RegDeleteValueA(hklm, "Value8");
8265 RegDeleteValueA(hklm, "Value9");
8266 RegDeleteValueA(hklm, "Value10");
8267 RegDeleteValueA(hklm, "Value11");
8268 RegDeleteValueA(hklm, "Value12");
8269 RegDeleteValueA(hklm, "Value13");
8270 RegDeleteValueA(hklm, "Value14");
8271 RegDeleteValueA(hklm, "Value15");
8272 RegDeleteValueA(hklm, "Value16");
8273 RegDeleteValueA(hklm, "Value17");
8274 RegDeleteKeyA(hklm, "");
8275 RegCloseKey(hklm);
8277 RegDeleteValueA(classes, "Value1");
8278 RegDeleteKeyA(classes, "");
8279 RegCloseKey(classes);
8281 RegDeleteValueA(hkcu, "Value1");
8282 RegDeleteKeyA(hkcu, "");
8283 RegCloseKey(hkcu);
8285 RegDeleteValueA(users, "Value1");
8286 RegDeleteKeyA(users, "");
8287 RegCloseKey(users);
8289 DeleteFileA("FileName1");
8290 DeleteFileA("FileName3.dll");
8291 DeleteFileA("FileName4.dll");
8292 DeleteFileA("FileName5.dll");
8293 MsiCloseHandle(hpkg);
8294 DeleteFileA(msifile);
8297 static void delete_win_ini(LPCSTR file)
8299 CHAR path[MAX_PATH];
8301 GetWindowsDirectoryA(path, MAX_PATH);
8302 lstrcatA(path, "\\");
8303 lstrcatA(path, file);
8305 DeleteFileA(path);
8308 static void test_appsearch_inilocator(void)
8310 MSIHANDLE hpkg, hdb;
8311 CHAR path[MAX_PATH];
8312 CHAR prop[MAX_PATH];
8313 BOOL version;
8314 LPCSTR str;
8315 LPSTR ptr;
8316 DWORD size;
8317 UINT r;
8319 version = TRUE;
8320 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8321 version = FALSE;
8323 DeleteFileA("test.dll");
8325 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8327 create_test_file("FileName1");
8328 sprintf(path, "%s\\FileName1", CURR_DIR);
8329 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8331 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8333 sprintf(path, "%s\\IDontExist", CURR_DIR);
8334 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8336 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8337 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8338 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8340 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8341 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8342 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8344 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8345 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8346 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8348 hdb = create_package_db();
8349 ok(hdb, "Expected a valid database handle\n");
8351 r = create_appsearch_table(hdb);
8352 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8354 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8355 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8357 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8358 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8360 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8363 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8366 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8369 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8370 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8372 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8373 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8375 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8378 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8381 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8384 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8387 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8390 r = create_inilocator_table(hdb);
8391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8393 /* msidbLocatorTypeRawValue, field 1 */
8394 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8395 r = add_inilocator_entry(hdb, str);
8396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8398 /* msidbLocatorTypeRawValue, field 2 */
8399 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8400 r = add_inilocator_entry(hdb, str);
8401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8403 /* msidbLocatorTypeRawValue, entire field */
8404 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8405 r = add_inilocator_entry(hdb, str);
8406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8408 /* msidbLocatorTypeFile */
8409 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8410 r = add_inilocator_entry(hdb, str);
8411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8413 /* msidbLocatorTypeDirectory, file */
8414 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8415 r = add_inilocator_entry(hdb, str);
8416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8418 /* msidbLocatorTypeDirectory, directory */
8419 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8420 r = add_inilocator_entry(hdb, str);
8421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8423 /* msidbLocatorTypeFile, file, no signature */
8424 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8425 r = add_inilocator_entry(hdb, str);
8426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8428 /* msidbLocatorTypeFile, dir, no signature */
8429 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8430 r = add_inilocator_entry(hdb, str);
8431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8433 /* msidbLocatorTypeFile, file does not exist */
8434 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8435 r = add_inilocator_entry(hdb, str);
8436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8438 /* msidbLocatorTypeFile, signature with version */
8439 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8440 r = add_inilocator_entry(hdb, str);
8441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8443 /* msidbLocatorTypeFile, signature with version, ver > max */
8444 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8445 r = add_inilocator_entry(hdb, str);
8446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8448 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8449 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8450 r = add_inilocator_entry(hdb, str);
8451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8453 r = create_signature_table(hdb);
8454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8456 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8459 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8462 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8468 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 hpkg = package_from_db(hdb);
8472 ok(hpkg, "Expected a valid package handle\n");
8474 r = MsiDoAction(hpkg, "AppSearch");
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8477 size = MAX_PATH;
8478 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8480 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8482 size = MAX_PATH;
8483 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8485 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8487 size = MAX_PATH;
8488 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8490 ok(!lstrcmpA(prop, "keydata,field2"),
8491 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8493 size = MAX_PATH;
8494 sprintf(path, "%s\\FileName1", CURR_DIR);
8495 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8497 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8499 size = MAX_PATH;
8500 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8502 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8504 size = MAX_PATH;
8505 sprintf(path, "%s\\", CURR_DIR);
8506 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8508 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8510 size = MAX_PATH;
8511 sprintf(path, "%s\\", CURR_DIR);
8512 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8514 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8516 size = MAX_PATH;
8517 lstrcpyA(path, CURR_DIR);
8518 ptr = strrchr(path, '\\');
8519 *(ptr + 1) = '\0';
8520 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8522 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8524 size = MAX_PATH;
8525 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8527 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8529 if (version)
8531 size = MAX_PATH;
8532 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8533 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8535 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8537 size = MAX_PATH;
8538 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8540 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8542 size = MAX_PATH;
8543 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8544 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8546 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8549 delete_win_ini("IniFile.ini");
8550 DeleteFileA("FileName1");
8551 DeleteFileA("FileName2.dll");
8552 DeleteFileA("FileName3.dll");
8553 DeleteFileA("FileName4.dll");
8554 MsiCloseHandle(hpkg);
8555 DeleteFileA(msifile);
8559 * MSI AppSearch action on DrLocator table always returns absolute paths.
8560 * If a relative path was set, it returns the first absolute path that
8561 * matches or an empty string if it didn't find anything.
8562 * This helper function replicates this behaviour.
8564 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
8566 int i, size;
8567 DWORD attr, drives;
8569 size = lstrlenA(relative);
8570 drives = GetLogicalDrives();
8571 lstrcpyA(absolute, "A:\\");
8572 for (i = 0; i < 26; absolute[0] = '\0', i++)
8574 if (!(drives & (1 << i)))
8575 continue;
8577 absolute[0] = 'A' + i;
8578 if (GetDriveType(absolute) != DRIVE_FIXED)
8579 continue;
8581 lstrcpynA(absolute + 3, relative, size + 1);
8582 attr = GetFileAttributesA(absolute);
8583 if (attr != INVALID_FILE_ATTRIBUTES &&
8584 (attr & FILE_ATTRIBUTE_DIRECTORY))
8586 if (absolute[3 + size - 1] != '\\')
8587 lstrcatA(absolute, "\\");
8588 break;
8590 absolute[3] = '\0';
8594 static void test_appsearch_drlocator(void)
8596 MSIHANDLE hpkg, hdb;
8597 CHAR path[MAX_PATH];
8598 CHAR prop[MAX_PATH];
8599 BOOL version;
8600 LPCSTR str;
8601 DWORD size;
8602 UINT r;
8604 version = TRUE;
8605 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8606 version = FALSE;
8608 DeleteFileA("test.dll");
8610 create_test_file("FileName1");
8611 CreateDirectoryA("one", NULL);
8612 CreateDirectoryA("one\\two", NULL);
8613 CreateDirectoryA("one\\two\\three", NULL);
8614 create_test_file("one\\two\\three\\FileName2");
8615 CreateDirectoryA("another", NULL);
8616 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8617 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8618 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8620 hdb = create_package_db();
8621 ok(hdb, "Expected a valid database handle\n");
8623 r = create_appsearch_table(hdb);
8624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8626 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8629 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8632 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8635 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8638 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8641 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8644 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8647 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8650 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8653 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8656 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8659 r = create_drlocator_table(hdb);
8660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8662 /* no parent, full path, depth 0, signature */
8663 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8664 r = add_drlocator_entry(hdb, path);
8665 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8667 /* no parent, full path, depth 0, no signature */
8668 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8669 r = add_drlocator_entry(hdb, path);
8670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8672 /* no parent, relative path, depth 0, no signature */
8673 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8674 r = add_drlocator_entry(hdb, path);
8675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8677 /* no parent, full path, depth 2, signature */
8678 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8679 r = add_drlocator_entry(hdb, path);
8680 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8682 /* no parent, full path, depth 3, signature */
8683 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8684 r = add_drlocator_entry(hdb, path);
8685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8687 /* no parent, full path, depth 1, signature is dir */
8688 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8689 r = add_drlocator_entry(hdb, path);
8690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8692 /* parent is in DrLocator, relative path, depth 0, signature */
8693 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8694 r = add_drlocator_entry(hdb, path);
8695 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8697 /* no parent, full path, depth 0, signature w/ version */
8698 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8699 r = add_drlocator_entry(hdb, path);
8700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8702 /* no parent, full path, depth 0, signature w/ version, ver > max */
8703 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8704 r = add_drlocator_entry(hdb, path);
8705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8707 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8708 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8709 r = add_drlocator_entry(hdb, path);
8710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8712 /* no parent, relative empty path, depth 0, no signature */
8713 sprintf(path, "'NewSignature11', '', '', 0");
8714 r = add_drlocator_entry(hdb, path);
8715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8717 r = create_signature_table(hdb);
8718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8720 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8721 r = add_signature_entry(hdb, str);
8722 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8724 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8725 r = add_signature_entry(hdb, str);
8726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8728 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8729 r = add_signature_entry(hdb, str);
8730 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8732 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8733 r = add_signature_entry(hdb, str);
8734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8736 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8737 r = add_signature_entry(hdb, str);
8738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8740 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8741 r = add_signature_entry(hdb, str);
8742 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8744 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8745 r = add_signature_entry(hdb, str);
8746 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8748 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8749 r = add_signature_entry(hdb, str);
8750 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8752 hpkg = package_from_db(hdb);
8753 ok(hpkg, "Expected a valid package handle\n");
8755 r = MsiDoAction(hpkg, "AppSearch");
8756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8758 size = MAX_PATH;
8759 sprintf(path, "%s\\FileName1", CURR_DIR);
8760 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8762 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8764 size = MAX_PATH;
8765 sprintf(path, "%s\\", CURR_DIR);
8766 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8768 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8770 size = MAX_PATH;
8771 search_absolute_directory(path, CURR_DIR + 3);
8772 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8774 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8776 size = MAX_PATH;
8777 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8779 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8781 size = MAX_PATH;
8782 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8783 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8785 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8787 size = MAX_PATH;
8788 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8790 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8792 size = MAX_PATH;
8793 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8794 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8796 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8798 if (version)
8800 size = MAX_PATH;
8801 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8802 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8804 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8806 size = MAX_PATH;
8807 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8808 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8809 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8811 size = MAX_PATH;
8812 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8813 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8814 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8817 size = MAX_PATH;
8818 search_absolute_directory(path, "");
8819 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8820 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8821 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8823 DeleteFileA("FileName1");
8824 DeleteFileA("FileName3.dll");
8825 DeleteFileA("FileName4.dll");
8826 DeleteFileA("FileName5.dll");
8827 DeleteFileA("one\\two\\three\\FileName2");
8828 RemoveDirectoryA("one\\two\\three");
8829 RemoveDirectoryA("one\\two");
8830 RemoveDirectoryA("one");
8831 RemoveDirectoryA("another");
8832 MsiCloseHandle(hpkg);
8833 DeleteFileA(msifile);
8836 static void test_featureparents(void)
8838 MSIHANDLE hpkg;
8839 UINT r;
8840 MSIHANDLE hdb;
8841 INSTALLSTATE state, action;
8843 hdb = create_package_db();
8844 ok ( hdb, "failed to create package database\n" );
8846 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
8847 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
8849 r = create_feature_table( hdb );
8850 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
8852 r = create_component_table( hdb );
8853 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
8855 r = create_feature_components_table( hdb );
8856 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
8858 r = create_file_table( hdb );
8859 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
8861 /* msidbFeatureAttributesFavorLocal */
8862 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
8863 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8865 /* msidbFeatureAttributesFavorSource */
8866 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
8867 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8869 /* msidbFeatureAttributesFavorLocal */
8870 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
8871 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8873 /* disabled because of install level */
8874 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
8875 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8877 /* child feature of disabled feature */
8878 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8879 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8881 /* component of disabled feature (install level) */
8882 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8883 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8885 /* component of disabled child feature (install level) */
8886 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8887 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8889 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8890 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8891 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8893 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8894 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8895 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8897 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8898 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8899 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8901 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8902 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8903 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8905 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8906 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8907 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8909 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8910 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8911 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8913 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8914 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8915 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8917 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8918 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8919 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8921 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8922 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
8924 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
8925 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8927 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
8928 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8930 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
8931 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8933 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
8934 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8936 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
8937 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8939 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
8940 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8942 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
8943 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8945 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
8946 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8948 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
8949 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8951 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
8952 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8954 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
8955 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8957 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
8958 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8960 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
8961 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8963 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
8964 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8966 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
8967 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8969 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
8970 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8972 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
8973 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8975 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
8976 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8978 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
8979 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8981 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
8982 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8984 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
8985 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8987 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
8988 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8990 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
8991 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8993 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
8994 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8996 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
8997 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8999 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9000 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9002 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9003 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9005 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9006 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9008 hpkg = package_from_db( hdb );
9009 ok( hpkg, "failed to create package\n");
9011 MsiCloseHandle( hdb );
9013 r = MsiDoAction( hpkg, "CostInitialize");
9014 ok( r == ERROR_SUCCESS, "cost init failed\n");
9016 r = MsiDoAction( hpkg, "FileCost");
9017 ok( r == ERROR_SUCCESS, "file cost failed\n");
9019 r = MsiDoAction( hpkg, "CostFinalize");
9020 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9022 state = 0xdeadbee;
9023 action = 0xdeadbee;
9024 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9025 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9026 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9027 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9029 state = 0xdeadbee;
9030 action = 0xdeadbee;
9031 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9032 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9033 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9034 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9036 state = 0xdeadbee;
9037 action = 0xdeadbee;
9038 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9039 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9040 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9041 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9043 state = 0xdeadbee;
9044 action = 0xdeadbee;
9045 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9046 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9047 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9048 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9050 state = 0xdeadbee;
9051 action = 0xdeadbee;
9052 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9054 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9055 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9057 state = 0xdeadbee;
9058 action = 0xdeadbee;
9059 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9060 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9061 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9062 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9064 state = 0xdeadbee;
9065 action = 0xdeadbee;
9066 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9067 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9068 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9069 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9071 state = 0xdeadbee;
9072 action = 0xdeadbee;
9073 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9075 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9076 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9078 state = 0xdeadbee;
9079 action = 0xdeadbee;
9080 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9081 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9082 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9083 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9085 state = 0xdeadbee;
9086 action = 0xdeadbee;
9087 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9088 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9089 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9090 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9092 state = 0xdeadbee;
9093 action = 0xdeadbee;
9094 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9095 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9096 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9097 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9099 state = 0xdeadbee;
9100 action = 0xdeadbee;
9101 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9103 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9104 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9106 state = 0xdeadbee;
9107 action = 0xdeadbee;
9108 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9109 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9110 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9111 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9113 state = 0xdeadbee;
9114 action = 0xdeadbee;
9115 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9116 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9117 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9118 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9120 state = 0xdeadbee;
9121 action = 0xdeadbee;
9122 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9124 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9125 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9127 state = 0xdeadbee;
9128 action = 0xdeadbee;
9129 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9131 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9132 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9134 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9135 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9137 state = 0xdeadbee;
9138 action = 0xdeadbee;
9139 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9141 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9142 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9144 state = 0xdeadbee;
9145 action = 0xdeadbee;
9146 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9148 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9149 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9151 state = 0xdeadbee;
9152 action = 0xdeadbee;
9153 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9155 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9156 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9158 state = 0xdeadbee;
9159 action = 0xdeadbee;
9160 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9162 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9163 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9165 state = 0xdeadbee;
9166 action = 0xdeadbee;
9167 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9169 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9170 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9172 state = 0xdeadbee;
9173 action = 0xdeadbee;
9174 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9175 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9176 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9177 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9179 state = 0xdeadbee;
9180 action = 0xdeadbee;
9181 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9182 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9183 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9184 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9186 state = 0xdeadbee;
9187 action = 0xdeadbee;
9188 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9189 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9190 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9191 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9193 state = 0xdeadbee;
9194 action = 0xdeadbee;
9195 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9196 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9197 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9198 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9200 state = 0xdeadbee;
9201 action = 0xdeadbee;
9202 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9203 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9204 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9205 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9207 state = 0xdeadbee;
9208 action = 0xdeadbee;
9209 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9210 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9211 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9212 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9214 state = 0xdeadbee;
9215 action = 0xdeadbee;
9216 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9217 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9218 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9219 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9221 state = 0xdeadbee;
9222 action = 0xdeadbee;
9223 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9224 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9225 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9226 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9228 state = 0xdeadbee;
9229 action = 0xdeadbee;
9230 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9231 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9232 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9233 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9235 MsiCloseHandle(hpkg);
9236 DeleteFileA(msifile);
9239 static void test_installprops(void)
9241 MSIHANDLE hpkg, hdb;
9242 CHAR path[MAX_PATH];
9243 CHAR buf[MAX_PATH];
9244 DWORD size, type;
9245 LANGID langid;
9246 HKEY hkey1, hkey2;
9247 int res;
9248 UINT r;
9250 GetCurrentDirectory(MAX_PATH, path);
9251 lstrcat(path, "\\");
9252 lstrcat(path, msifile);
9254 hdb = create_package_db();
9255 ok( hdb, "failed to create database\n");
9257 hpkg = package_from_db(hdb);
9258 ok( hpkg, "failed to create package\n");
9260 MsiCloseHandle(hdb);
9262 size = MAX_PATH;
9263 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9264 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9265 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9267 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9269 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
9271 size = MAX_PATH;
9272 type = REG_SZ;
9273 *path = '\0';
9274 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9276 size = MAX_PATH;
9277 type = REG_SZ;
9278 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9281 /* win9x doesn't set this */
9282 if (*path)
9284 size = MAX_PATH;
9285 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9286 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9287 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9290 size = MAX_PATH;
9291 type = REG_SZ;
9292 *path = '\0';
9293 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9295 size = MAX_PATH;
9296 type = REG_SZ;
9297 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9300 if (*path)
9302 size = MAX_PATH;
9303 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9304 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9305 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9308 size = MAX_PATH;
9309 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9310 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9311 trace("VersionDatabase = %s\n", buf);
9313 size = MAX_PATH;
9314 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9315 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9316 trace("VersionMsi = %s\n", buf);
9318 size = MAX_PATH;
9319 r = MsiGetProperty(hpkg, "Date", buf, &size);
9320 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9321 trace("Date = %s\n", buf);
9323 size = MAX_PATH;
9324 r = MsiGetProperty(hpkg, "Time", buf, &size);
9325 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9326 trace("Time = %s\n", buf);
9328 size = MAX_PATH;
9329 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9330 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9331 trace("PackageCode = %s\n", buf);
9333 langid = GetUserDefaultLangID();
9334 sprintf(path, "%d", langid);
9336 size = MAX_PATH;
9337 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9339 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9341 res = GetSystemMetrics(SM_CXSCREEN);
9342 size = MAX_PATH;
9343 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9344 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9346 res = GetSystemMetrics(SM_CYSCREEN);
9347 size = MAX_PATH;
9348 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9349 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9351 CloseHandle(hkey1);
9352 CloseHandle(hkey2);
9353 MsiCloseHandle(hpkg);
9354 DeleteFile(msifile);
9357 static void test_launchconditions(void)
9359 MSIHANDLE hpkg;
9360 MSIHANDLE hdb;
9361 UINT r;
9363 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9365 hdb = create_package_db();
9366 ok( hdb, "failed to create package database\n" );
9368 r = create_launchcondition_table( hdb );
9369 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9371 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9372 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9374 /* invalid condition */
9375 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9376 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9378 hpkg = package_from_db( hdb );
9379 ok( hpkg, "failed to create package\n");
9381 MsiCloseHandle( hdb );
9383 r = MsiSetProperty( hpkg, "X", "1" );
9384 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9386 /* invalid conditions are ignored */
9387 r = MsiDoAction( hpkg, "LaunchConditions" );
9388 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9390 /* verify LaunchConditions still does some verification */
9391 r = MsiSetProperty( hpkg, "X", "2" );
9392 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9394 r = MsiDoAction( hpkg, "LaunchConditions" );
9395 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9397 MsiCloseHandle( hpkg );
9398 DeleteFile( msifile );
9401 static void test_ccpsearch(void)
9403 MSIHANDLE hdb, hpkg;
9404 CHAR prop[MAX_PATH];
9405 DWORD size = MAX_PATH;
9406 UINT r;
9408 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9410 hdb = create_package_db();
9411 ok(hdb, "failed to create package database\n");
9413 r = create_ccpsearch_table(hdb);
9414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9416 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9419 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9422 r = create_reglocator_table(hdb);
9423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9425 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9428 r = create_drlocator_table(hdb);
9429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9431 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9434 r = create_signature_table(hdb);
9435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9437 hpkg = package_from_db(hdb);
9438 ok(hpkg, "failed to create package\n");
9440 MsiCloseHandle(hdb);
9442 r = MsiDoAction(hpkg, "CCPSearch");
9443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9445 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9447 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9449 MsiCloseHandle(hpkg);
9450 DeleteFileA(msifile);
9453 static void test_complocator(void)
9455 MSIHANDLE hdb, hpkg;
9456 UINT r;
9457 CHAR prop[MAX_PATH];
9458 CHAR expected[MAX_PATH];
9459 DWORD size = MAX_PATH;
9461 hdb = create_package_db();
9462 ok(hdb, "failed to create package database\n");
9464 r = create_appsearch_table(hdb);
9465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9467 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9470 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9473 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9476 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9479 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9482 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9485 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9488 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9491 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9494 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9497 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9500 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9503 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9506 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9509 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9512 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9515 r = create_complocator_table(hdb);
9516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9518 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9521 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9524 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9527 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9530 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9533 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9536 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9539 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9542 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9545 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9548 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9551 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9554 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9557 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9560 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9563 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9566 r = create_signature_table(hdb);
9567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9569 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9572 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9575 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9578 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9581 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9584 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9587 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9590 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9593 hpkg = package_from_db(hdb);
9594 ok(hpkg, "failed to create package\n");
9596 MsiCloseHandle(hdb);
9598 create_test_file("abelisaurus");
9599 create_test_file("bactrosaurus");
9600 create_test_file("camelotia");
9601 create_test_file("diclonius");
9602 create_test_file("echinodon");
9603 create_test_file("falcarius");
9604 create_test_file("gallimimus");
9605 create_test_file("hagryphus");
9606 CreateDirectoryA("iguanodon", NULL);
9607 CreateDirectoryA("jobaria", NULL);
9608 CreateDirectoryA("kakuru", NULL);
9609 CreateDirectoryA("labocania", NULL);
9610 CreateDirectoryA("megaraptor", NULL);
9611 CreateDirectoryA("neosodon", NULL);
9612 CreateDirectoryA("olorotitan", NULL);
9613 CreateDirectoryA("pantydraco", NULL);
9615 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9616 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9617 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9618 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9619 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9620 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9621 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9622 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9623 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9624 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9625 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9626 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9627 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9628 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9629 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9630 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
9632 r = MsiDoAction(hpkg, "AppSearch");
9633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9635 size = MAX_PATH;
9636 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
9637 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9639 lstrcpyA(expected, CURR_DIR);
9640 lstrcatA(expected, "\\abelisaurus");
9641 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9642 "Expected %s or empty string, got %s\n", expected, prop);
9644 size = MAX_PATH;
9645 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
9646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9647 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9649 size = MAX_PATH;
9650 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
9651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9652 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9654 size = MAX_PATH;
9655 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
9656 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9657 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9659 size = MAX_PATH;
9660 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
9661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9663 lstrcpyA(expected, CURR_DIR);
9664 lstrcatA(expected, "\\");
9665 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9666 "Expected %s or empty string, got %s\n", expected, prop);
9668 size = MAX_PATH;
9669 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
9670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9671 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9673 size = MAX_PATH;
9674 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
9675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9676 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9678 size = MAX_PATH;
9679 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
9680 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9681 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9683 size = MAX_PATH;
9684 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
9685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9686 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9688 size = MAX_PATH;
9689 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
9690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9691 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9693 size = MAX_PATH;
9694 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
9695 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9696 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9698 size = MAX_PATH;
9699 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
9700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9701 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9703 size = MAX_PATH;
9704 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
9705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9707 lstrcpyA(expected, CURR_DIR);
9708 lstrcatA(expected, "\\");
9709 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9710 "Expected %s or empty string, got %s\n", expected, prop);
9712 size = MAX_PATH;
9713 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
9714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9716 lstrcpyA(expected, CURR_DIR);
9717 lstrcatA(expected, "\\neosodon\\");
9718 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9719 "Expected %s or empty string, got %s\n", expected, prop);
9721 size = MAX_PATH;
9722 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
9723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9724 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9726 size = MAX_PATH;
9727 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
9728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9729 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9731 MsiCloseHandle(hpkg);
9732 DeleteFileA("abelisaurus");
9733 DeleteFileA("bactrosaurus");
9734 DeleteFileA("camelotia");
9735 DeleteFileA("diclonius");
9736 DeleteFileA("echinodon");
9737 DeleteFileA("falcarius");
9738 DeleteFileA("gallimimus");
9739 DeleteFileA("hagryphus");
9740 RemoveDirectoryA("iguanodon");
9741 RemoveDirectoryA("jobaria");
9742 RemoveDirectoryA("kakuru");
9743 RemoveDirectoryA("labocania");
9744 RemoveDirectoryA("megaraptor");
9745 RemoveDirectoryA("neosodon");
9746 RemoveDirectoryA("olorotitan");
9747 RemoveDirectoryA("pantydraco");
9748 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9749 MSIINSTALLCONTEXT_MACHINE, NULL);
9750 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9751 MSIINSTALLCONTEXT_MACHINE, NULL);
9752 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9753 MSIINSTALLCONTEXT_MACHINE, NULL);
9754 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9755 MSIINSTALLCONTEXT_MACHINE, NULL);
9756 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9757 MSIINSTALLCONTEXT_MACHINE, NULL);
9758 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9759 MSIINSTALLCONTEXT_MACHINE, NULL);
9760 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9761 MSIINSTALLCONTEXT_MACHINE, NULL);
9762 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9763 MSIINSTALLCONTEXT_MACHINE, NULL);
9764 DeleteFileA(msifile);
9767 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
9769 MSIHANDLE summary;
9770 UINT r;
9772 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
9773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9775 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
9776 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9778 r = MsiSummaryInfoPersist(summary);
9779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9781 MsiCloseHandle(summary);
9784 static void test_MsiGetSourcePath(void)
9786 MSIHANDLE hdb, hpkg;
9787 CHAR path[MAX_PATH];
9788 CHAR cwd[MAX_PATH];
9789 CHAR subsrc[MAX_PATH];
9790 CHAR sub2[MAX_PATH];
9791 DWORD size;
9792 UINT r;
9794 lstrcpyA(cwd, CURR_DIR);
9795 lstrcatA(cwd, "\\");
9797 lstrcpyA(subsrc, cwd);
9798 lstrcatA(subsrc, "subsource");
9799 lstrcatA(subsrc, "\\");
9801 lstrcpyA(sub2, subsrc);
9802 lstrcatA(sub2, "sub2");
9803 lstrcatA(sub2, "\\");
9805 /* uncompressed source */
9807 hdb = create_package_db();
9808 ok( hdb, "failed to create database\n");
9810 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9812 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9813 ok(r == S_OK, "failed\n");
9815 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9816 ok(r == S_OK, "failed\n");
9818 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
9819 ok(r == S_OK, "failed\n");
9821 r = MsiDatabaseCommit(hdb);
9822 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
9824 hpkg = package_from_db(hdb);
9825 ok(hpkg, "failed to create package\n");
9827 MsiCloseHandle(hdb);
9829 /* invalid database handle */
9830 size = MAX_PATH;
9831 lstrcpyA(path, "kiwi");
9832 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
9833 ok(r == ERROR_INVALID_HANDLE,
9834 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
9835 ok(!lstrcmpA(path, "kiwi"),
9836 "Expected path to be unchanged, got \"%s\"\n", path);
9837 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9839 /* NULL szFolder */
9840 size = MAX_PATH;
9841 lstrcpyA(path, "kiwi");
9842 r = MsiGetSourcePath(hpkg, NULL, path, &size);
9843 ok(r == ERROR_INVALID_PARAMETER,
9844 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9845 ok(!lstrcmpA(path, "kiwi"),
9846 "Expected path to be unchanged, got \"%s\"\n", path);
9847 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9849 /* empty szFolder */
9850 size = MAX_PATH;
9851 lstrcpyA(path, "kiwi");
9852 r = MsiGetSourcePath(hpkg, "", path, &size);
9853 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9854 ok(!lstrcmpA(path, "kiwi"),
9855 "Expected path to be unchanged, got \"%s\"\n", path);
9856 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9858 /* try TARGETDIR */
9859 size = MAX_PATH;
9860 lstrcpyA(path, "kiwi");
9861 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9862 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9863 ok(!lstrcmpA(path, "kiwi"),
9864 "Expected path to be unchanged, got \"%s\"\n", path);
9865 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9867 /* try SourceDir */
9868 size = MAX_PATH;
9869 lstrcpyA(path, "kiwi");
9870 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9871 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9872 ok(!lstrcmpA(path, "kiwi"),
9873 "Expected path to be unchanged, got \"%s\"\n", path);
9874 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9876 /* try SOURCEDIR */
9877 size = MAX_PATH;
9878 lstrcpyA(path, "kiwi");
9879 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9880 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9881 ok(!lstrcmpA(path, "kiwi"),
9882 "Expected path to be unchanged, got \"%s\"\n", path);
9883 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9885 /* source path does not exist, but the property exists */
9886 size = MAX_PATH;
9887 lstrcpyA(path, "kiwi");
9888 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9889 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9890 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9891 ok(size == 0, "Expected 0, got %d\n", size);
9893 /* try SubDir */
9894 size = MAX_PATH;
9895 lstrcpyA(path, "kiwi");
9896 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9897 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9898 ok(!lstrcmpA(path, "kiwi"),
9899 "Expected path to be unchanged, got \"%s\"\n", path);
9900 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9902 /* try SubDir2 */
9903 size = MAX_PATH;
9904 lstrcpyA(path, "kiwi");
9905 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9906 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9907 ok(!lstrcmpA(path, "kiwi"),
9908 "Expected path to be unchanged, got \"%s\"\n", path);
9909 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9911 r = MsiDoAction(hpkg, "CostInitialize");
9912 ok(r == ERROR_SUCCESS, "cost init failed\n");
9914 /* try TARGETDIR after CostInitialize */
9915 size = MAX_PATH;
9916 lstrcpyA(path, "kiwi");
9917 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9918 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9919 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9920 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9922 /* try SourceDir after CostInitialize */
9923 size = MAX_PATH;
9924 lstrcpyA(path, "kiwi");
9925 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9926 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9927 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9928 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9930 /* try SOURCEDIR after CostInitialize */
9931 size = MAX_PATH;
9932 lstrcpyA(path, "kiwi");
9933 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9934 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9935 ok(!lstrcmpA(path, "kiwi"),
9936 "Expected path to be unchanged, got \"%s\"\n", path);
9937 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9939 /* source path does not exist, but the property exists */
9940 size = MAX_PATH;
9941 lstrcpyA(path, "kiwi");
9942 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9943 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9944 todo_wine
9946 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9947 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9950 /* try SubDir after CostInitialize */
9951 size = MAX_PATH;
9952 lstrcpyA(path, "kiwi");
9953 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9954 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9955 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9956 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9958 /* try SubDir2 after CostInitialize */
9959 size = MAX_PATH;
9960 lstrcpyA(path, "kiwi");
9961 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9963 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9964 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9966 r = MsiDoAction(hpkg, "ResolveSource");
9967 ok(r == ERROR_SUCCESS, "file cost failed\n");
9969 /* try TARGETDIR after ResolveSource */
9970 size = MAX_PATH;
9971 lstrcpyA(path, "kiwi");
9972 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9973 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9974 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9975 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9977 /* try SourceDir after ResolveSource */
9978 size = MAX_PATH;
9979 lstrcpyA(path, "kiwi");
9980 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9981 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9982 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9983 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9985 /* try SOURCEDIR after ResolveSource */
9986 size = MAX_PATH;
9987 lstrcpyA(path, "kiwi");
9988 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9989 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9990 ok(!lstrcmpA(path, "kiwi"),
9991 "Expected path to be unchanged, got \"%s\"\n", path);
9992 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9994 /* source path does not exist, but the property exists */
9995 size = MAX_PATH;
9996 lstrcpyA(path, "kiwi");
9997 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9998 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9999 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10000 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10002 /* try SubDir after ResolveSource */
10003 size = MAX_PATH;
10004 lstrcpyA(path, "kiwi");
10005 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10006 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10007 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10008 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10010 /* try SubDir2 after ResolveSource */
10011 size = MAX_PATH;
10012 lstrcpyA(path, "kiwi");
10013 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10015 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10016 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10018 r = MsiDoAction(hpkg, "FileCost");
10019 ok(r == ERROR_SUCCESS, "file cost failed\n");
10021 /* try TARGETDIR after FileCost */
10022 size = MAX_PATH;
10023 lstrcpyA(path, "kiwi");
10024 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10026 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10027 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10029 /* try SourceDir after FileCost */
10030 size = MAX_PATH;
10031 lstrcpyA(path, "kiwi");
10032 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10034 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10035 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10037 /* try SOURCEDIR after FileCost */
10038 size = MAX_PATH;
10039 lstrcpyA(path, "kiwi");
10040 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10041 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10042 ok(!lstrcmpA(path, "kiwi"),
10043 "Expected path to be unchanged, got \"%s\"\n", path);
10044 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10046 /* try SubDir after FileCost */
10047 size = MAX_PATH;
10048 lstrcpyA(path, "kiwi");
10049 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10051 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10052 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10054 /* try SubDir2 after FileCost */
10055 size = MAX_PATH;
10056 lstrcpyA(path, "kiwi");
10057 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10059 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10060 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10062 r = MsiDoAction(hpkg, "CostFinalize");
10063 ok(r == ERROR_SUCCESS, "file cost failed\n");
10065 /* try TARGETDIR after CostFinalize */
10066 size = MAX_PATH;
10067 lstrcpyA(path, "kiwi");
10068 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10070 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10071 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10073 /* try SourceDir after CostFinalize */
10074 size = MAX_PATH;
10075 lstrcpyA(path, "kiwi");
10076 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10078 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10079 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10081 /* try SOURCEDIR after CostFinalize */
10082 size = MAX_PATH;
10083 lstrcpyA(path, "kiwi");
10084 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10085 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10086 ok(!lstrcmpA(path, "kiwi"),
10087 "Expected path to be unchanged, got \"%s\"\n", path);
10088 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10090 /* try SubDir after CostFinalize */
10091 size = MAX_PATH;
10092 lstrcpyA(path, "kiwi");
10093 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10095 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10096 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10098 /* try SubDir2 after CostFinalize */
10099 size = MAX_PATH;
10100 lstrcpyA(path, "kiwi");
10101 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10103 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10104 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10106 /* nonexistent directory */
10107 size = MAX_PATH;
10108 lstrcpyA(path, "kiwi");
10109 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
10110 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10111 ok(!lstrcmpA(path, "kiwi"),
10112 "Expected path to be unchanged, got \"%s\"\n", path);
10113 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10115 /* NULL szPathBuf */
10116 size = MAX_PATH;
10117 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
10118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10119 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10121 /* NULL pcchPathBuf */
10122 lstrcpyA(path, "kiwi");
10123 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
10124 ok(r == ERROR_INVALID_PARAMETER,
10125 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10126 ok(!lstrcmpA(path, "kiwi"),
10127 "Expected path to be unchanged, got \"%s\"\n", path);
10129 /* pcchPathBuf is 0 */
10130 size = 0;
10131 lstrcpyA(path, "kiwi");
10132 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10133 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10134 ok(!lstrcmpA(path, "kiwi"),
10135 "Expected path to be unchanged, got \"%s\"\n", path);
10136 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10138 /* pcchPathBuf does not have room for NULL terminator */
10139 size = lstrlenA(cwd);
10140 lstrcpyA(path, "kiwi");
10141 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10142 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
10143 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
10144 "Expected path with no backslash, got \"%s\"\n", path);
10145 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10147 /* pcchPathBuf has room for NULL terminator */
10148 size = lstrlenA(cwd) + 1;
10149 lstrcpyA(path, "kiwi");
10150 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10152 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10153 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10155 MsiCloseHandle(hpkg);
10157 /* compressed source */
10159 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10162 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
10164 hpkg = package_from_db(hdb);
10165 ok(hpkg, "failed to create package\n");
10167 r = MsiDoAction(hpkg, "CostInitialize");
10168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10169 r = MsiDoAction(hpkg, "FileCost");
10170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10171 r = MsiDoAction(hpkg, "CostFinalize");
10172 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10174 /* try TARGETDIR after CostFinalize */
10175 size = MAX_PATH;
10176 lstrcpyA(path, "kiwi");
10177 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10179 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10180 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10182 /* try SourceDir after CostFinalize */
10183 size = MAX_PATH;
10184 lstrcpyA(path, "kiwi");
10185 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10186 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10187 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10188 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10190 /* try SOURCEDIR after CostFinalize */
10191 size = MAX_PATH;
10192 lstrcpyA(path, "kiwi");
10193 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10194 todo_wine
10196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10197 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10198 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10201 /* try SubDir after CostFinalize */
10202 size = MAX_PATH;
10203 lstrcpyA(path, "kiwi");
10204 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10206 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10207 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10209 /* try SubDir2 after CostFinalize */
10210 size = MAX_PATH;
10211 lstrcpyA(path, "kiwi");
10212 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10214 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10215 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10217 MsiCloseHandle(hpkg);
10218 DeleteFile(msifile);
10221 static void test_shortlongsource(void)
10223 MSIHANDLE hdb, hpkg;
10224 CHAR path[MAX_PATH];
10225 CHAR cwd[MAX_PATH];
10226 CHAR subsrc[MAX_PATH];
10227 DWORD size;
10228 UINT r;
10230 lstrcpyA(cwd, CURR_DIR);
10231 lstrcatA(cwd, "\\");
10233 lstrcpyA(subsrc, cwd);
10234 lstrcatA(subsrc, "long");
10235 lstrcatA(subsrc, "\\");
10237 /* long file names */
10239 hdb = create_package_db();
10240 ok( hdb, "failed to create database\n");
10242 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10244 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10245 ok(r == S_OK, "failed\n");
10247 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
10248 ok(r == S_OK, "failed\n");
10250 /* CostInitialize:short */
10251 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
10252 ok(r == S_OK, "failed\n");
10254 /* CostInitialize:long */
10255 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
10256 ok(r == S_OK, "failed\n");
10258 /* FileCost:short */
10259 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
10260 ok(r == S_OK, "failed\n");
10262 /* FileCost:long */
10263 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10264 ok(r == S_OK, "failed\n");
10266 /* CostFinalize:short */
10267 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10268 ok(r == S_OK, "failed\n");
10270 /* CostFinalize:long */
10271 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10272 ok(r == S_OK, "failed\n");
10274 MsiDatabaseCommit(hdb);
10276 hpkg = package_from_db(hdb);
10277 ok(hpkg, "failed to create package\n");
10279 MsiCloseHandle(hdb);
10281 CreateDirectoryA("one", NULL);
10282 CreateDirectoryA("four", NULL);
10284 r = MsiDoAction(hpkg, "CostInitialize");
10285 ok(r == ERROR_SUCCESS, "file cost failed\n");
10287 CreateDirectory("five", NULL);
10288 CreateDirectory("eight", NULL);
10290 r = MsiDoAction(hpkg, "FileCost");
10291 ok(r == ERROR_SUCCESS, "file cost failed\n");
10293 CreateDirectory("nine", NULL);
10294 CreateDirectory("twelve", NULL);
10296 r = MsiDoAction(hpkg, "CostFinalize");
10297 ok(r == ERROR_SUCCESS, "file cost failed\n");
10299 /* neither short nor long source directories exist */
10300 size = MAX_PATH;
10301 lstrcpyA(path, "kiwi");
10302 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10303 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10304 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10305 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10307 CreateDirectoryA("short", NULL);
10309 /* short source directory exists */
10310 size = MAX_PATH;
10311 lstrcpyA(path, "kiwi");
10312 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10313 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10314 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10315 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10317 CreateDirectoryA("long", NULL);
10319 /* both short and long source directories exist */
10320 size = MAX_PATH;
10321 lstrcpyA(path, "kiwi");
10322 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10324 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10325 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10327 lstrcpyA(subsrc, cwd);
10328 lstrcatA(subsrc, "two");
10329 lstrcatA(subsrc, "\\");
10331 /* short dir exists before CostInitialize */
10332 size = MAX_PATH;
10333 lstrcpyA(path, "kiwi");
10334 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10336 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10337 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10339 lstrcpyA(subsrc, cwd);
10340 lstrcatA(subsrc, "four");
10341 lstrcatA(subsrc, "\\");
10343 /* long dir exists before CostInitialize */
10344 size = MAX_PATH;
10345 lstrcpyA(path, "kiwi");
10346 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10347 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10348 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10349 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10351 lstrcpyA(subsrc, cwd);
10352 lstrcatA(subsrc, "six");
10353 lstrcatA(subsrc, "\\");
10355 /* short dir exists before FileCost */
10356 size = MAX_PATH;
10357 lstrcpyA(path, "kiwi");
10358 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10360 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10361 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10363 lstrcpyA(subsrc, cwd);
10364 lstrcatA(subsrc, "eight");
10365 lstrcatA(subsrc, "\\");
10367 /* long dir exists before FileCost */
10368 size = MAX_PATH;
10369 lstrcpyA(path, "kiwi");
10370 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10372 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10373 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10375 lstrcpyA(subsrc, cwd);
10376 lstrcatA(subsrc, "ten");
10377 lstrcatA(subsrc, "\\");
10379 /* short dir exists before CostFinalize */
10380 size = MAX_PATH;
10381 lstrcpyA(path, "kiwi");
10382 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10384 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10385 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10387 lstrcpyA(subsrc, cwd);
10388 lstrcatA(subsrc, "twelve");
10389 lstrcatA(subsrc, "\\");
10391 /* long dir exists before CostFinalize */
10392 size = MAX_PATH;
10393 lstrcpyA(path, "kiwi");
10394 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10396 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10397 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10399 MsiCloseHandle(hpkg);
10400 RemoveDirectoryA("short");
10401 RemoveDirectoryA("long");
10402 RemoveDirectoryA("one");
10403 RemoveDirectoryA("four");
10404 RemoveDirectoryA("five");
10405 RemoveDirectoryA("eight");
10406 RemoveDirectoryA("nine");
10407 RemoveDirectoryA("twelve");
10409 /* short file names */
10411 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10414 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
10416 hpkg = package_from_db(hdb);
10417 ok(hpkg, "failed to create package\n");
10419 MsiCloseHandle(hdb);
10421 CreateDirectoryA("one", NULL);
10422 CreateDirectoryA("four", NULL);
10424 r = MsiDoAction(hpkg, "CostInitialize");
10425 ok(r == ERROR_SUCCESS, "file cost failed\n");
10427 CreateDirectory("five", NULL);
10428 CreateDirectory("eight", NULL);
10430 r = MsiDoAction(hpkg, "FileCost");
10431 ok(r == ERROR_SUCCESS, "file cost failed\n");
10433 CreateDirectory("nine", NULL);
10434 CreateDirectory("twelve", NULL);
10436 r = MsiDoAction(hpkg, "CostFinalize");
10437 ok(r == ERROR_SUCCESS, "file cost failed\n");
10439 lstrcpyA(subsrc, cwd);
10440 lstrcatA(subsrc, "short");
10441 lstrcatA(subsrc, "\\");
10443 /* neither short nor long source directories exist */
10444 size = MAX_PATH;
10445 lstrcpyA(path, "kiwi");
10446 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10448 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10449 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10451 CreateDirectoryA("short", NULL);
10453 /* short source directory exists */
10454 size = MAX_PATH;
10455 lstrcpyA(path, "kiwi");
10456 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10458 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10459 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10461 CreateDirectoryA("long", NULL);
10463 /* both short and long source directories exist */
10464 size = MAX_PATH;
10465 lstrcpyA(path, "kiwi");
10466 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10468 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10469 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10471 lstrcpyA(subsrc, cwd);
10472 lstrcatA(subsrc, "one");
10473 lstrcatA(subsrc, "\\");
10475 /* short dir exists before CostInitialize */
10476 size = MAX_PATH;
10477 lstrcpyA(path, "kiwi");
10478 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10480 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10481 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10483 lstrcpyA(subsrc, cwd);
10484 lstrcatA(subsrc, "three");
10485 lstrcatA(subsrc, "\\");
10487 /* long dir exists before CostInitialize */
10488 size = MAX_PATH;
10489 lstrcpyA(path, "kiwi");
10490 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10492 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10493 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10495 lstrcpyA(subsrc, cwd);
10496 lstrcatA(subsrc, "five");
10497 lstrcatA(subsrc, "\\");
10499 /* short dir exists before FileCost */
10500 size = MAX_PATH;
10501 lstrcpyA(path, "kiwi");
10502 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10504 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10505 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10507 lstrcpyA(subsrc, cwd);
10508 lstrcatA(subsrc, "seven");
10509 lstrcatA(subsrc, "\\");
10511 /* long dir exists before FileCost */
10512 size = MAX_PATH;
10513 lstrcpyA(path, "kiwi");
10514 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10516 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10517 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10519 lstrcpyA(subsrc, cwd);
10520 lstrcatA(subsrc, "nine");
10521 lstrcatA(subsrc, "\\");
10523 /* short dir exists before CostFinalize */
10524 size = MAX_PATH;
10525 lstrcpyA(path, "kiwi");
10526 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10528 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10529 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10531 lstrcpyA(subsrc, cwd);
10532 lstrcatA(subsrc, "eleven");
10533 lstrcatA(subsrc, "\\");
10535 /* long dir exists before CostFinalize */
10536 size = MAX_PATH;
10537 lstrcpyA(path, "kiwi");
10538 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10540 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10541 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10543 MsiCloseHandle(hpkg);
10544 RemoveDirectoryA("short");
10545 RemoveDirectoryA("long");
10546 RemoveDirectoryA("one");
10547 RemoveDirectoryA("four");
10548 RemoveDirectoryA("five");
10549 RemoveDirectoryA("eight");
10550 RemoveDirectoryA("nine");
10551 RemoveDirectoryA("twelve");
10552 DeleteFileA(msifile);
10555 static void test_sourcedir(void)
10557 MSIHANDLE hdb, hpkg;
10558 CHAR package[10];
10559 CHAR path[MAX_PATH];
10560 CHAR cwd[MAX_PATH];
10561 CHAR subsrc[MAX_PATH];
10562 DWORD size;
10563 UINT r;
10565 lstrcpyA(cwd, CURR_DIR);
10566 lstrcatA(cwd, "\\");
10568 lstrcpyA(subsrc, cwd);
10569 lstrcatA(subsrc, "long");
10570 lstrcatA(subsrc, "\\");
10572 hdb = create_package_db();
10573 ok( hdb, "failed to create database\n");
10575 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10576 ok(r == S_OK, "failed\n");
10578 sprintf(package, "#%i", hdb);
10579 r = MsiOpenPackage(package, &hpkg);
10580 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10582 /* properties only */
10584 /* SourceDir prop */
10585 size = MAX_PATH;
10586 lstrcpyA(path, "kiwi");
10587 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10589 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10590 ok(size == 0, "Expected 0, got %d\n", size);
10592 /* SOURCEDIR prop */
10593 size = MAX_PATH;
10594 lstrcpyA(path, "kiwi");
10595 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10596 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10597 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10598 ok(size == 0, "Expected 0, got %d\n", size);
10600 r = MsiDoAction(hpkg, "CostInitialize");
10601 ok(r == ERROR_SUCCESS, "file cost failed\n");
10603 /* SourceDir after CostInitialize */
10604 size = MAX_PATH;
10605 lstrcpyA(path, "kiwi");
10606 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10608 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10609 ok(size == 0, "Expected 0, got %d\n", size);
10611 /* SOURCEDIR after CostInitialize */
10612 size = MAX_PATH;
10613 lstrcpyA(path, "kiwi");
10614 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10616 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10617 ok(size == 0, "Expected 0, got %d\n", size);
10619 r = MsiDoAction(hpkg, "FileCost");
10620 ok(r == ERROR_SUCCESS, "file cost failed\n");
10622 /* SourceDir after FileCost */
10623 size = MAX_PATH;
10624 lstrcpyA(path, "kiwi");
10625 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10627 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10628 ok(size == 0, "Expected 0, got %d\n", size);
10630 /* SOURCEDIR after FileCost */
10631 size = MAX_PATH;
10632 lstrcpyA(path, "kiwi");
10633 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10635 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10636 ok(size == 0, "Expected 0, got %d\n", size);
10638 r = MsiDoAction(hpkg, "CostFinalize");
10639 ok(r == ERROR_SUCCESS, "file cost failed\n");
10641 /* SourceDir after CostFinalize */
10642 size = MAX_PATH;
10643 lstrcpyA(path, "kiwi");
10644 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10646 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10647 ok(size == 0, "Expected 0, got %d\n", size);
10649 /* SOURCEDIR after CostFinalize */
10650 size = MAX_PATH;
10651 lstrcpyA(path, "kiwi");
10652 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10654 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10655 ok(size == 0, "Expected 0, got %d\n", size);
10657 r = MsiDoAction(hpkg, "ResolveSource");
10658 ok(r == ERROR_SUCCESS, "file cost failed\n");
10660 /* SourceDir after ResolveSource */
10661 size = MAX_PATH;
10662 lstrcpyA(path, "kiwi");
10663 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10665 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10666 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10668 /* SOURCEDIR after ResolveSource */
10669 size = MAX_PATH;
10670 lstrcpyA(path, "kiwi");
10671 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10672 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10673 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10674 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10676 /* random casing */
10677 size = MAX_PATH;
10678 lstrcpyA(path, "kiwi");
10679 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
10680 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10681 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10682 ok(size == 0, "Expected 0, got %d\n", size);
10684 MsiCloseHandle(hpkg);
10686 /* reset the package state */
10687 sprintf(package, "#%i", hdb);
10688 r = MsiOpenPackage(package, &hpkg);
10689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10691 /* test how MsiGetSourcePath affects the properties */
10693 /* SourceDir prop */
10694 size = MAX_PATH;
10695 lstrcpyA(path, "kiwi");
10696 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10697 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10698 todo_wine
10700 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10701 ok(size == 0, "Expected 0, got %d\n", size);
10704 size = MAX_PATH;
10705 lstrcpyA(path, "kiwi");
10706 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10707 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10708 ok(!lstrcmpA(path, "kiwi"),
10709 "Expected path to be unchanged, got \"%s\"\n", path);
10710 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10712 /* SourceDir after MsiGetSourcePath */
10713 size = MAX_PATH;
10714 lstrcpyA(path, "kiwi");
10715 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10716 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10717 todo_wine
10719 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10720 ok(size == 0, "Expected 0, got %d\n", size);
10723 /* SOURCEDIR prop */
10724 size = MAX_PATH;
10725 lstrcpyA(path, "kiwi");
10726 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10727 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10728 todo_wine
10730 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10731 ok(size == 0, "Expected 0, got %d\n", size);
10734 size = MAX_PATH;
10735 lstrcpyA(path, "kiwi");
10736 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10737 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10738 ok(!lstrcmpA(path, "kiwi"),
10739 "Expected path to be unchanged, got \"%s\"\n", path);
10740 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10742 /* SOURCEDIR prop after MsiGetSourcePath */
10743 size = MAX_PATH;
10744 lstrcpyA(path, "kiwi");
10745 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10746 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10747 todo_wine
10749 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10750 ok(size == 0, "Expected 0, got %d\n", size);
10753 r = MsiDoAction(hpkg, "CostInitialize");
10754 ok(r == ERROR_SUCCESS, "file cost failed\n");
10756 /* SourceDir after CostInitialize */
10757 size = MAX_PATH;
10758 lstrcpyA(path, "kiwi");
10759 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10761 todo_wine
10763 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10764 ok(size == 0, "Expected 0, got %d\n", size);
10767 size = MAX_PATH;
10768 lstrcpyA(path, "kiwi");
10769 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10771 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10772 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10774 /* SourceDir after MsiGetSourcePath */
10775 size = MAX_PATH;
10776 lstrcpyA(path, "kiwi");
10777 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10779 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10780 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10782 /* SOURCEDIR after CostInitialize */
10783 size = MAX_PATH;
10784 lstrcpyA(path, "kiwi");
10785 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10786 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10787 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10788 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10790 /* SOURCEDIR source path still does not exist */
10791 size = MAX_PATH;
10792 lstrcpyA(path, "kiwi");
10793 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10794 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10795 ok(!lstrcmpA(path, "kiwi"),
10796 "Expected path to be unchanged, got \"%s\"\n", path);
10797 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10799 r = MsiDoAction(hpkg, "FileCost");
10800 ok(r == ERROR_SUCCESS, "file cost failed\n");
10802 /* SourceDir after FileCost */
10803 size = MAX_PATH;
10804 lstrcpyA(path, "kiwi");
10805 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10807 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10808 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10810 /* SOURCEDIR after FileCost */
10811 size = MAX_PATH;
10812 lstrcpyA(path, "kiwi");
10813 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10815 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10816 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10818 /* SOURCEDIR source path still does not exist */
10819 size = MAX_PATH;
10820 lstrcpyA(path, "kiwi");
10821 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10822 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10823 ok(!lstrcmpA(path, "kiwi"),
10824 "Expected path to be unchanged, got \"%s\"\n", path);
10825 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10827 r = MsiDoAction(hpkg, "CostFinalize");
10828 ok(r == ERROR_SUCCESS, "file cost failed\n");
10830 /* SourceDir after CostFinalize */
10831 size = MAX_PATH;
10832 lstrcpyA(path, "kiwi");
10833 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10835 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10836 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10838 /* SOURCEDIR after CostFinalize */
10839 size = MAX_PATH;
10840 lstrcpyA(path, "kiwi");
10841 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10843 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10844 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10846 /* SOURCEDIR source path still does not exist */
10847 size = MAX_PATH;
10848 lstrcpyA(path, "kiwi");
10849 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10850 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10851 ok(!lstrcmpA(path, "kiwi"),
10852 "Expected path to be unchanged, got \"%s\"\n", path);
10853 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10855 r = MsiDoAction(hpkg, "ResolveSource");
10856 ok(r == ERROR_SUCCESS, "file cost failed\n");
10858 /* SourceDir after ResolveSource */
10859 size = MAX_PATH;
10860 lstrcpyA(path, "kiwi");
10861 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10863 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10864 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10866 /* SOURCEDIR after ResolveSource */
10867 size = MAX_PATH;
10868 lstrcpyA(path, "kiwi");
10869 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10871 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10872 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10874 /* SOURCEDIR source path still does not exist */
10875 size = MAX_PATH;
10876 lstrcpyA(path, "kiwi");
10877 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10878 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10879 ok(!lstrcmpA(path, "kiwi"),
10880 "Expected path to be unchanged, got \"%s\"\n", path);
10881 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10883 MsiCloseHandle(hdb);
10884 MsiCloseHandle(hpkg);
10885 DeleteFileA(msifile);
10888 struct access_res
10890 BOOL gothandle;
10891 DWORD lasterr;
10892 BOOL ignore;
10895 static const struct access_res create[16] =
10897 { TRUE, ERROR_SUCCESS, TRUE },
10898 { TRUE, ERROR_SUCCESS, TRUE },
10899 { TRUE, ERROR_SUCCESS, FALSE },
10900 { TRUE, ERROR_SUCCESS, FALSE },
10901 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10902 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10903 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10904 { TRUE, ERROR_SUCCESS, FALSE },
10905 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10906 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10907 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10908 { TRUE, ERROR_SUCCESS, TRUE },
10909 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10910 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10911 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10912 { TRUE, ERROR_SUCCESS, TRUE }
10915 static const struct access_res create_commit[16] =
10917 { TRUE, ERROR_SUCCESS, TRUE },
10918 { TRUE, ERROR_SUCCESS, TRUE },
10919 { TRUE, ERROR_SUCCESS, FALSE },
10920 { TRUE, ERROR_SUCCESS, FALSE },
10921 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10922 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10923 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10924 { TRUE, ERROR_SUCCESS, FALSE },
10925 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10926 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10927 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10928 { TRUE, ERROR_SUCCESS, TRUE },
10929 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10930 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10931 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10932 { TRUE, ERROR_SUCCESS, TRUE }
10935 static const struct access_res create_close[16] =
10937 { TRUE, ERROR_SUCCESS, FALSE },
10938 { TRUE, ERROR_SUCCESS, FALSE },
10939 { TRUE, ERROR_SUCCESS, FALSE },
10940 { TRUE, ERROR_SUCCESS, FALSE },
10941 { TRUE, ERROR_SUCCESS, FALSE },
10942 { TRUE, ERROR_SUCCESS, FALSE },
10943 { TRUE, ERROR_SUCCESS, FALSE },
10944 { TRUE, ERROR_SUCCESS, FALSE },
10945 { TRUE, ERROR_SUCCESS, FALSE },
10946 { TRUE, ERROR_SUCCESS, FALSE },
10947 { TRUE, ERROR_SUCCESS, FALSE },
10948 { TRUE, ERROR_SUCCESS, FALSE },
10949 { TRUE, ERROR_SUCCESS, FALSE },
10950 { TRUE, ERROR_SUCCESS, FALSE },
10951 { TRUE, ERROR_SUCCESS, FALSE },
10952 { TRUE, ERROR_SUCCESS }
10955 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
10957 DWORD access = 0, share = 0;
10958 DWORD lasterr;
10959 HANDLE hfile;
10960 int i, j, idx = 0;
10962 for (i = 0; i < 4; i++)
10964 if (i == 0) access = 0;
10965 if (i == 1) access = GENERIC_READ;
10966 if (i == 2) access = GENERIC_WRITE;
10967 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
10969 for (j = 0; j < 4; j++)
10971 if (ares[idx].ignore)
10972 continue;
10974 if (j == 0) share = 0;
10975 if (j == 1) share = FILE_SHARE_READ;
10976 if (j == 2) share = FILE_SHARE_WRITE;
10977 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
10979 SetLastError(0xdeadbeef);
10980 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
10981 FILE_ATTRIBUTE_NORMAL, 0);
10982 lasterr = GetLastError();
10984 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
10985 "(%d, handle, %d): Expected %d, got %d\n",
10986 line, idx, ares[idx].gothandle,
10987 (hfile != INVALID_HANDLE_VALUE));
10989 ok(lasterr == ares[idx].lasterr ||
10990 lasterr == 0xdeadbeef, /* win9x */
10991 "(%d, lasterr, %d): Expected %d, got %d\n",
10992 line, idx, ares[idx].lasterr, lasterr);
10994 CloseHandle(hfile);
10995 idx++;
11000 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11002 static void test_access(void)
11004 MSIHANDLE hdb;
11005 UINT r;
11007 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
11008 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11010 test_file_access(msifile, create);
11012 r = MsiDatabaseCommit(hdb);
11013 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11015 test_file_access(msifile, create_commit);
11017 MsiCloseHandle(hdb);
11019 test_file_access(msifile, create_close);
11021 DeleteFileA(msifile);
11023 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
11024 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11026 test_file_access(msifile, create);
11028 r = MsiDatabaseCommit(hdb);
11029 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11031 test_file_access(msifile, create_commit);
11033 MsiCloseHandle(hdb);
11035 test_file_access(msifile, create_close);
11037 DeleteFileA(msifile);
11040 static void test_emptypackage(void)
11042 MSIHANDLE hpkg, hdb, hsuminfo;
11043 MSIHANDLE hview, hrec;
11044 MSICONDITION condition;
11045 CHAR buffer[MAX_PATH];
11046 DWORD size;
11047 UINT r;
11049 r = MsiOpenPackageA("", &hpkg);
11050 todo_wine
11052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11055 hdb = MsiGetActiveDatabase(hpkg);
11056 todo_wine
11058 ok(hdb != 0, "Expected a valid database handle\n");
11061 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
11062 todo_wine
11064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11066 r = MsiViewExecute(hview, 0);
11067 todo_wine
11069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11072 r = MsiViewFetch(hview, &hrec);
11073 todo_wine
11075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11078 size = MAX_PATH;
11079 r = MsiRecordGetString(hrec, 1, buffer, &size);
11080 todo_wine
11082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11083 ok(!lstrcmpA(buffer, "_Property"),
11084 "Expected \"_Property\", got \"%s\"\n", buffer);
11087 MsiCloseHandle(hrec);
11089 r = MsiViewFetch(hview, &hrec);
11090 todo_wine
11092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11095 size = MAX_PATH;
11096 r = MsiRecordGetString(hrec, 1, buffer, &size);
11097 todo_wine
11099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11100 ok(!lstrcmpA(buffer, "#_FolderCache"),
11101 "Expected \"_Property\", got \"%s\"\n", buffer);
11104 MsiCloseHandle(hrec);
11105 MsiViewClose(hview);
11106 MsiCloseHandle(hview);
11108 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
11109 todo_wine
11111 ok(condition == MSICONDITION_FALSE,
11112 "Expected MSICONDITION_FALSE, got %d\n", condition);
11115 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
11116 todo_wine
11118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11120 r = MsiViewExecute(hview, 0);
11121 todo_wine
11123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11126 /* _Property table is not empty */
11127 r = MsiViewFetch(hview, &hrec);
11128 todo_wine
11130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11133 MsiCloseHandle(hrec);
11134 MsiViewClose(hview);
11135 MsiCloseHandle(hview);
11137 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
11138 todo_wine
11140 ok(condition == MSICONDITION_FALSE,
11141 "Expected MSICONDITION_FALSE, got %d\n", condition);
11144 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
11145 todo_wine
11147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11149 r = MsiViewExecute(hview, 0);
11150 todo_wine
11152 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11155 /* #_FolderCache is not empty */
11156 r = MsiViewFetch(hview, &hrec);
11157 todo_wine
11159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11162 MsiCloseHandle(hrec);
11163 MsiViewClose(hview);
11164 MsiCloseHandle(hview);
11166 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
11167 todo_wine
11169 ok(r == ERROR_BAD_QUERY_SYNTAX,
11170 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11173 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
11174 todo_wine
11176 ok(r == ERROR_BAD_QUERY_SYNTAX,
11177 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11180 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
11181 todo_wine
11183 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
11184 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
11187 MsiCloseHandle(hsuminfo);
11189 r = MsiDatabaseCommit(hdb);
11190 todo_wine
11192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11195 MsiCloseHandle(hdb);
11196 MsiCloseHandle(hpkg);
11199 static void test_MsiGetProductProperty(void)
11201 MSIHANDLE hprod, hdb;
11202 CHAR val[MAX_PATH];
11203 CHAR path[MAX_PATH];
11204 CHAR query[MAX_PATH];
11205 CHAR keypath[MAX_PATH*2];
11206 CHAR prodcode[MAX_PATH];
11207 CHAR prod_squashed[MAX_PATH];
11208 HKEY prodkey, userkey, props;
11209 LPSTR usersid;
11210 DWORD size;
11211 LONG res;
11212 UINT r;
11213 SC_HANDLE scm;
11215 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
11216 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
11218 win_skip("Different registry keys on Win9x and WinMe\n");
11219 return;
11221 CloseServiceHandle(scm);
11223 GetCurrentDirectoryA(MAX_PATH, path);
11224 lstrcatA(path, "\\");
11226 create_test_guid(prodcode, prod_squashed);
11227 get_user_sid(&usersid);
11229 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
11230 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11232 r = MsiDatabaseCommit(hdb);
11233 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11235 r = set_summary_info(hdb);
11236 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11238 r = run_query(hdb,
11239 "CREATE TABLE `Directory` ( "
11240 "`Directory` CHAR(255) NOT NULL, "
11241 "`Directory_Parent` CHAR(255), "
11242 "`DefaultDir` CHAR(255) NOT NULL "
11243 "PRIMARY KEY `Directory`)");
11244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11246 r = run_query(hdb,
11247 "CREATE TABLE `Property` ( "
11248 "`Property` CHAR(72) NOT NULL, "
11249 "`Value` CHAR(255) "
11250 "PRIMARY KEY `Property`)");
11251 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11253 sprintf(query, "INSERT INTO `Property` "
11254 "(`Property`, `Value`) "
11255 "VALUES( 'ProductCode', '%s' )", prodcode);
11256 r = run_query(hdb, query);
11257 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11259 r = MsiDatabaseCommit(hdb);
11260 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11262 MsiCloseHandle(hdb);
11264 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
11265 lstrcatA(keypath, prod_squashed);
11267 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &prodkey);
11268 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11270 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11271 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
11272 lstrcatA(keypath, prod_squashed);
11274 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
11275 if (res == ERROR_ACCESS_DENIED)
11277 skip("Not enough rights to perform tests\n");
11278 RegDeleteKeyA(prodkey, "");
11279 RegCloseKey(prodkey);
11280 return;
11282 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11284 res = RegCreateKeyA(userkey, "InstallProperties", &props);
11285 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11287 lstrcpyA(val, path);
11288 lstrcatA(val, "\\winetest.msi");
11289 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
11290 (const BYTE *)val, lstrlenA(val) + 1);
11291 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
11293 hprod = 0xdeadbeef;
11294 r = MsiOpenProductA(prodcode, &hprod);
11295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11296 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
11298 /* hProduct is invalid */
11299 size = MAX_PATH;
11300 lstrcpyA(val, "apple");
11301 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
11302 ok(r == ERROR_INVALID_HANDLE,
11303 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11304 ok(!lstrcmpA(val, "apple"),
11305 "Expected val to be unchanged, got \"%s\"\n", val);
11306 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11308 /* szProperty is NULL */
11309 size = MAX_PATH;
11310 lstrcpyA(val, "apple");
11311 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
11312 ok(r == ERROR_INVALID_PARAMETER,
11313 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11314 ok(!lstrcmpA(val, "apple"),
11315 "Expected val to be unchanged, got \"%s\"\n", val);
11316 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11318 /* szProperty is empty */
11319 size = MAX_PATH;
11320 lstrcpyA(val, "apple");
11321 r = MsiGetProductPropertyA(hprod, "", val, &size);
11322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11323 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11324 ok(size == 0, "Expected 0, got %d\n", size);
11326 /* get the property */
11327 size = MAX_PATH;
11328 lstrcpyA(val, "apple");
11329 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11331 ok(!lstrcmpA(val, prodcode),
11332 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11333 ok(size == lstrlenA(prodcode),
11334 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11336 /* lpValueBuf is NULL */
11337 size = MAX_PATH;
11338 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
11339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11340 ok(size == lstrlenA(prodcode),
11341 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11343 /* pcchValueBuf is NULL */
11344 lstrcpyA(val, "apple");
11345 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
11346 ok(r == ERROR_INVALID_PARAMETER,
11347 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11348 ok(!lstrcmpA(val, "apple"),
11349 "Expected val to be unchanged, got \"%s\"\n", val);
11350 ok(size == lstrlenA(prodcode),
11351 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11353 /* pcchValueBuf is too small */
11354 size = 4;
11355 lstrcpyA(val, "apple");
11356 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11357 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11358 ok(!strncmp(val, prodcode, 3),
11359 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
11360 ok(size == lstrlenA(prodcode),
11361 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11363 /* pcchValueBuf does not leave room for NULL terminator */
11364 size = lstrlenA(prodcode);
11365 lstrcpyA(val, "apple");
11366 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11367 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11368 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
11369 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
11370 ok(size == lstrlenA(prodcode),
11371 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11373 /* pcchValueBuf has enough room for NULL terminator */
11374 size = lstrlenA(prodcode) + 1;
11375 lstrcpyA(val, "apple");
11376 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11378 ok(!lstrcmpA(val, prodcode),
11379 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11380 ok(size == lstrlenA(prodcode),
11381 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11383 /* nonexistent property */
11384 size = MAX_PATH;
11385 lstrcpyA(val, "apple");
11386 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
11387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11388 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11389 ok(size == 0, "Expected 0, got %d\n", size);
11391 r = MsiSetPropertyA(hprod, "NewProperty", "value");
11392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11394 /* non-product property set */
11395 size = MAX_PATH;
11396 lstrcpyA(val, "apple");
11397 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
11398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11399 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11400 ok(size == 0, "Expected 0, got %d\n", size);
11402 r = MsiSetPropertyA(hprod, "ProductCode", "value");
11403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11405 /* non-product property that is also a product property set */
11406 size = MAX_PATH;
11407 lstrcpyA(val, "apple");
11408 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11409 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11410 ok(!lstrcmpA(val, prodcode),
11411 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11412 ok(size == lstrlenA(prodcode),
11413 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11415 MsiCloseHandle(hprod);
11417 RegDeleteValueA(props, "LocalPackage");
11418 RegDeleteKeyA(props, "");
11419 RegCloseKey(props);
11420 RegDeleteKeyA(userkey, "");
11421 RegCloseKey(userkey);
11422 RegDeleteKeyA(prodkey, "");
11423 RegCloseKey(prodkey);
11424 DeleteFileA(msifile);
11427 static void test_MsiSetProperty(void)
11429 MSIHANDLE hpkg, hdb, hrec;
11430 CHAR buf[MAX_PATH];
11431 LPCSTR query;
11432 DWORD size;
11433 UINT r;
11435 hpkg = package_from_db(create_package_db());
11436 ok(hpkg != 0, "Expected a valid package\n");
11438 /* invalid hInstall */
11439 r = MsiSetPropertyA(0, "Prop", "Val");
11440 ok(r == ERROR_INVALID_HANDLE,
11441 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11443 /* invalid hInstall */
11444 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
11445 ok(r == ERROR_INVALID_HANDLE,
11446 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
11448 /* szName is NULL */
11449 r = MsiSetPropertyA(hpkg, NULL, "Val");
11450 ok(r == ERROR_INVALID_PARAMETER,
11451 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11453 /* both szName and szValue are NULL */
11454 r = MsiSetPropertyA(hpkg, NULL, NULL);
11455 ok(r == ERROR_INVALID_PARAMETER,
11456 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11458 /* szName is empty */
11459 r = MsiSetPropertyA(hpkg, "", "Val");
11460 ok(r == ERROR_FUNCTION_FAILED,
11461 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
11463 /* szName is empty and szValue is NULL */
11464 r = MsiSetPropertyA(hpkg, "", NULL);
11465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11467 /* set a property */
11468 r = MsiSetPropertyA(hpkg, "Prop", "Val");
11469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11471 /* get the property */
11472 size = MAX_PATH;
11473 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11475 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
11476 ok(size == 3, "Expected 3, got %d\n", size);
11478 /* update the property */
11479 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
11480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11482 /* get the property */
11483 size = MAX_PATH;
11484 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11486 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
11487 ok(size == 4, "Expected 4, got %d\n", size);
11489 hdb = MsiGetActiveDatabase(hpkg);
11490 ok(hdb != 0, "Expected a valid database handle\n");
11492 /* set prop is not in the _Property table */
11493 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
11494 r = do_query(hdb, query, &hrec);
11495 ok(r == ERROR_BAD_QUERY_SYNTAX,
11496 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11498 /* set prop is not in the Property table */
11499 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
11500 r = do_query(hdb, query, &hrec);
11501 ok(r == ERROR_BAD_QUERY_SYNTAX,
11502 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
11504 MsiCloseHandle(hdb);
11506 /* szValue is an empty string */
11507 r = MsiSetPropertyA(hpkg, "Prop", "");
11508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11510 /* try to get the property */
11511 size = MAX_PATH;
11512 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11514 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11515 ok(size == 0, "Expected 0, got %d\n", size);
11517 /* reset the property */
11518 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
11519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11521 /* delete the property */
11522 r = MsiSetPropertyA(hpkg, "Prop", NULL);
11523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11525 /* try to get the property */
11526 size = MAX_PATH;
11527 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
11528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11529 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
11530 ok(size == 0, "Expected 0, got %d\n", size);
11532 MsiCloseHandle(hpkg);
11533 DeleteFileA(msifile);
11536 START_TEST(package)
11538 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
11540 test_createpackage();
11541 test_doaction();
11542 test_gettargetpath_bad();
11543 test_settargetpath();
11544 test_props();
11545 test_property_table();
11546 test_condition();
11547 test_msipackage();
11548 test_formatrecord2();
11549 test_states();
11550 test_getproperty();
11551 test_removefiles();
11552 test_appsearch();
11553 test_appsearch_complocator();
11554 test_appsearch_reglocator();
11555 test_appsearch_inilocator();
11556 test_appsearch_drlocator();
11557 test_featureparents();
11558 test_installprops();
11559 test_launchconditions();
11560 test_ccpsearch();
11561 test_complocator();
11562 test_MsiGetSourcePath();
11563 test_shortlongsource();
11564 test_sourcedir();
11565 test_access();
11566 test_emptypackage();
11567 test_MsiGetProductProperty();
11568 test_MsiSetProperty();