push eb25bf65c4616aa55a810ed5c29198b1a080b208
[wine/hacks.git] / dlls / msi / tests / package.c
blobee8af39959462f2b2652d87447423963e70f93ca
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, "not \"A\"");
1076 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1078 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1079 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1081 r = MsiEvaluateCondition(hpkg, "\"0\"");
1082 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1084 r = MsiEvaluateCondition(hpkg, "1 and 2");
1085 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1087 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1088 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1090 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1091 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1093 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1094 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1096 r = MsiEvaluateCondition(hpkg, "(0)");
1097 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1099 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1100 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1102 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1103 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1105 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1106 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1108 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1109 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1111 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1112 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1114 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1115 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1117 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1118 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1120 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1121 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1123 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1124 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1126 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1127 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1129 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1130 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1132 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1133 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1135 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1136 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1138 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1139 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1141 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1142 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1144 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1145 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1147 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1148 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1150 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1151 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1153 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1154 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1156 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1157 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1159 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1160 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1162 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1163 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1165 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1166 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1168 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1169 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1171 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1172 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1174 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1175 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1178 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1180 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1181 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1183 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1184 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1186 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1187 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1189 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1190 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1192 MsiSetProperty(hpkg, "mm", "5" );
1194 r = MsiEvaluateCondition(hpkg, "mm = 5");
1195 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1197 r = MsiEvaluateCondition(hpkg, "mm < 6");
1198 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1200 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1201 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1203 r = MsiEvaluateCondition(hpkg, "mm > 4");
1204 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, "mm < 12");
1207 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1210 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1212 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1213 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1215 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1216 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1218 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1219 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1221 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1222 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1224 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1225 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1228 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1230 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1231 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1234 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1237 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1239 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1240 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1242 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1243 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1246 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1249 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1252 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1254 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1255 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1257 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1258 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1260 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1261 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1263 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1264 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1266 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1267 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1269 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1270 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1272 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1273 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1275 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1276 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1278 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1279 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1281 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1282 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1284 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1285 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1287 MsiSetProperty(hpkg, "bandalmael", "0" );
1288 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1289 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1291 MsiSetProperty(hpkg, "bandalmael", "" );
1292 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1293 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1295 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1296 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1297 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1299 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1300 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1301 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1303 MsiSetProperty(hpkg, "bandalmael", "0 " );
1304 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1305 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1307 MsiSetProperty(hpkg, "bandalmael", "-0" );
1308 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1309 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1311 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1312 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1313 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1315 MsiSetProperty(hpkg, "bandalmael", "--0" );
1316 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1317 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1319 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1320 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1321 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1323 MsiSetProperty(hpkg, "bandalmael", "-" );
1324 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1325 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1327 MsiSetProperty(hpkg, "bandalmael", "+0" );
1328 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1329 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1331 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1332 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1333 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1334 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1335 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1337 MsiSetProperty(hpkg, "one", "hi");
1338 MsiSetProperty(hpkg, "two", "hithere");
1339 r = MsiEvaluateCondition(hpkg, "one >< two");
1340 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1342 MsiSetProperty(hpkg, "one", "hithere");
1343 MsiSetProperty(hpkg, "two", "hi");
1344 r = MsiEvaluateCondition(hpkg, "one >< two");
1345 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1347 MsiSetProperty(hpkg, "one", "hello");
1348 MsiSetProperty(hpkg, "two", "hi");
1349 r = MsiEvaluateCondition(hpkg, "one >< two");
1350 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1352 MsiSetProperty(hpkg, "one", "hellohithere");
1353 MsiSetProperty(hpkg, "two", "hi");
1354 r = MsiEvaluateCondition(hpkg, "one >< two");
1355 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1357 MsiSetProperty(hpkg, "one", "");
1358 MsiSetProperty(hpkg, "two", "hi");
1359 r = MsiEvaluateCondition(hpkg, "one >< two");
1360 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1362 MsiSetProperty(hpkg, "one", "hi");
1363 MsiSetProperty(hpkg, "two", "");
1364 r = MsiEvaluateCondition(hpkg, "one >< two");
1365 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1367 MsiSetProperty(hpkg, "one", "");
1368 MsiSetProperty(hpkg, "two", "");
1369 r = MsiEvaluateCondition(hpkg, "one >< two");
1370 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1372 MsiSetProperty(hpkg, "one", "1234");
1373 MsiSetProperty(hpkg, "two", "1");
1374 r = MsiEvaluateCondition(hpkg, "one >< two");
1375 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1377 MsiSetProperty(hpkg, "one", "one 1234");
1378 MsiSetProperty(hpkg, "two", "1");
1379 r = MsiEvaluateCondition(hpkg, "one >< two");
1380 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1382 MsiSetProperty(hpkg, "one", "hithere");
1383 MsiSetProperty(hpkg, "two", "hi");
1384 r = MsiEvaluateCondition(hpkg, "one << two");
1385 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1387 MsiSetProperty(hpkg, "one", "hi");
1388 MsiSetProperty(hpkg, "two", "hithere");
1389 r = MsiEvaluateCondition(hpkg, "one << two");
1390 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1392 MsiSetProperty(hpkg, "one", "hi");
1393 MsiSetProperty(hpkg, "two", "hi");
1394 r = MsiEvaluateCondition(hpkg, "one << two");
1395 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1397 MsiSetProperty(hpkg, "one", "abcdhithere");
1398 MsiSetProperty(hpkg, "two", "hi");
1399 r = MsiEvaluateCondition(hpkg, "one << two");
1400 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1402 MsiSetProperty(hpkg, "one", "");
1403 MsiSetProperty(hpkg, "two", "hi");
1404 r = MsiEvaluateCondition(hpkg, "one << two");
1405 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1407 MsiSetProperty(hpkg, "one", "hithere");
1408 MsiSetProperty(hpkg, "two", "");
1409 r = MsiEvaluateCondition(hpkg, "one << two");
1410 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1412 MsiSetProperty(hpkg, "one", "");
1413 MsiSetProperty(hpkg, "two", "");
1414 r = MsiEvaluateCondition(hpkg, "one << two");
1415 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1417 MsiSetProperty(hpkg, "one", "1234");
1418 MsiSetProperty(hpkg, "two", "1");
1419 r = MsiEvaluateCondition(hpkg, "one << two");
1420 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1422 MsiSetProperty(hpkg, "one", "1234 one");
1423 MsiSetProperty(hpkg, "two", "1");
1424 r = MsiEvaluateCondition(hpkg, "one << two");
1425 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1427 MsiSetProperty(hpkg, "one", "hithere");
1428 MsiSetProperty(hpkg, "two", "there");
1429 r = MsiEvaluateCondition(hpkg, "one >> two");
1430 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1432 MsiSetProperty(hpkg, "one", "hithere");
1433 MsiSetProperty(hpkg, "two", "hi");
1434 r = MsiEvaluateCondition(hpkg, "one >> two");
1435 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1437 MsiSetProperty(hpkg, "one", "there");
1438 MsiSetProperty(hpkg, "two", "hithere");
1439 r = MsiEvaluateCondition(hpkg, "one >> two");
1440 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1442 MsiSetProperty(hpkg, "one", "there");
1443 MsiSetProperty(hpkg, "two", "there");
1444 r = MsiEvaluateCondition(hpkg, "one >> two");
1445 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1447 MsiSetProperty(hpkg, "one", "abcdhithere");
1448 MsiSetProperty(hpkg, "two", "hi");
1449 r = MsiEvaluateCondition(hpkg, "one >> two");
1450 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1452 MsiSetProperty(hpkg, "one", "");
1453 MsiSetProperty(hpkg, "two", "there");
1454 r = MsiEvaluateCondition(hpkg, "one >> two");
1455 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1457 MsiSetProperty(hpkg, "one", "there");
1458 MsiSetProperty(hpkg, "two", "");
1459 r = MsiEvaluateCondition(hpkg, "one >> two");
1460 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1462 MsiSetProperty(hpkg, "one", "");
1463 MsiSetProperty(hpkg, "two", "");
1464 r = MsiEvaluateCondition(hpkg, "one >> two");
1465 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1467 MsiSetProperty(hpkg, "one", "1234");
1468 MsiSetProperty(hpkg, "two", "4");
1469 r = MsiEvaluateCondition(hpkg, "one >> two");
1470 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1472 MsiSetProperty(hpkg, "one", "one 1234");
1473 MsiSetProperty(hpkg, "two", "4");
1474 r = MsiEvaluateCondition(hpkg, "one >> two");
1475 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1477 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1479 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1480 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1482 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1483 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1485 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1486 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1488 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1489 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1491 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1492 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1494 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1495 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1497 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1498 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1500 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1501 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1503 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1504 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1506 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1507 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1509 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1510 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1512 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1513 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1515 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1516 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1518 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1519 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1521 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1522 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1524 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1525 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1527 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1528 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1530 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1531 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1533 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1534 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1536 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1537 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1539 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1540 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1542 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1543 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1545 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1546 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1548 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1549 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1551 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1552 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1554 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1555 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1557 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1558 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1560 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1561 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1563 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1564 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1566 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1567 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1569 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1570 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1572 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1573 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1575 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1576 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1578 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1579 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1581 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1582 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1584 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1585 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1587 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1588 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1590 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1591 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1592 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1594 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1595 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1597 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1598 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1600 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1601 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1603 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1604 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1606 MsiSetProperty(hpkg, "one", "1");
1607 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1608 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1610 MsiSetProperty(hpkg, "X", "5.0");
1612 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1613 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1615 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1616 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1618 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1619 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1621 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1622 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1624 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1625 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1627 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1628 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1630 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1631 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1633 /* feature doesn't exist */
1634 r = MsiEvaluateCondition(hpkg, "&nofeature");
1635 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1637 MsiSetProperty(hpkg, "A", "2");
1638 MsiSetProperty(hpkg, "X", "50");
1640 r = MsiEvaluateCondition(hpkg, "2 <= X");
1641 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1643 r = MsiEvaluateCondition(hpkg, "A <= X");
1644 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1646 r = MsiEvaluateCondition(hpkg, "A <= 50");
1647 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1649 MsiSetProperty(hpkg, "X", "50val");
1651 r = MsiEvaluateCondition(hpkg, "2 <= X");
1652 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1654 r = MsiEvaluateCondition(hpkg, "A <= X");
1655 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1657 MsiSetProperty(hpkg, "A", "7");
1658 MsiSetProperty(hpkg, "X", "50");
1660 r = MsiEvaluateCondition(hpkg, "7 <= X");
1661 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1663 r = MsiEvaluateCondition(hpkg, "A <= X");
1664 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1666 r = MsiEvaluateCondition(hpkg, "A <= 50");
1667 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1669 MsiSetProperty(hpkg, "X", "50val");
1671 r = MsiEvaluateCondition(hpkg, "2 <= X");
1672 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1674 r = MsiEvaluateCondition(hpkg, "A <= X");
1675 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1677 MsiCloseHandle( hpkg );
1678 DeleteFile(msifile);
1681 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1683 UINT r;
1684 DWORD sz;
1685 char buffer[2];
1687 sz = sizeof buffer;
1688 strcpy(buffer,"x");
1689 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1690 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1693 static void test_props(void)
1695 MSIHANDLE hpkg, hdb;
1696 UINT r;
1697 DWORD sz;
1698 char buffer[0x100];
1700 hdb = create_package_db();
1701 r = run_query( hdb,
1702 "CREATE TABLE `Property` ( "
1703 "`Property` CHAR(255) NOT NULL, "
1704 "`Value` CHAR(255) "
1705 "PRIMARY KEY `Property`)" );
1706 ok( r == ERROR_SUCCESS , "Failed\n" );
1708 r = run_query(hdb,
1709 "INSERT INTO `Property` "
1710 "(`Property`, `Value`) "
1711 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1712 ok( r == ERROR_SUCCESS , "Failed\n" );
1714 hpkg = package_from_db( hdb );
1715 ok( hpkg, "failed to create package\n");
1717 /* test invalid values */
1718 r = MsiGetProperty( 0, NULL, NULL, NULL );
1719 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1721 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1722 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1724 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1725 ok( r == ERROR_SUCCESS, "wrong return val\n");
1727 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1728 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1730 /* test retrieving an empty/nonexistent property */
1731 sz = sizeof buffer;
1732 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1733 ok( r == ERROR_SUCCESS, "wrong return val\n");
1734 ok( sz == 0, "wrong size returned\n");
1736 check_prop_empty( hpkg, "boo");
1737 sz = 0;
1738 strcpy(buffer,"x");
1739 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1740 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1741 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1742 ok( sz == 0, "wrong size returned\n");
1744 sz = 1;
1745 strcpy(buffer,"x");
1746 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1747 ok( r == ERROR_SUCCESS, "wrong return val\n");
1748 ok( buffer[0] == 0, "buffer was not changed\n");
1749 ok( sz == 0, "wrong size returned\n");
1751 /* set the property to something */
1752 r = MsiSetProperty( 0, NULL, NULL );
1753 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1755 r = MsiSetProperty( hpkg, NULL, NULL );
1756 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1758 r = MsiSetProperty( hpkg, "", NULL );
1759 ok( r == ERROR_SUCCESS, "wrong return val\n");
1761 /* try set and get some illegal property identifiers */
1762 r = MsiSetProperty( hpkg, "", "asdf" );
1763 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1765 r = MsiSetProperty( hpkg, "=", "asdf" );
1766 ok( r == ERROR_SUCCESS, "wrong return val\n");
1768 r = MsiSetProperty( hpkg, " ", "asdf" );
1769 ok( r == ERROR_SUCCESS, "wrong return val\n");
1771 r = MsiSetProperty( hpkg, "'", "asdf" );
1772 ok( r == ERROR_SUCCESS, "wrong return val\n");
1774 sz = sizeof buffer;
1775 buffer[0]=0;
1776 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1777 ok( r == ERROR_SUCCESS, "wrong return val\n");
1778 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1780 /* set empty values */
1781 r = MsiSetProperty( hpkg, "boo", NULL );
1782 ok( r == ERROR_SUCCESS, "wrong return val\n");
1783 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1785 r = MsiSetProperty( hpkg, "boo", "" );
1786 ok( r == ERROR_SUCCESS, "wrong return val\n");
1787 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1789 /* set a non-empty value */
1790 r = MsiSetProperty( hpkg, "boo", "xyz" );
1791 ok( r == ERROR_SUCCESS, "wrong return val\n");
1793 sz = 1;
1794 strcpy(buffer,"x");
1795 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1796 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1797 ok( buffer[0] == 0, "buffer was not changed\n");
1798 ok( sz == 3, "wrong size returned\n");
1800 sz = 4;
1801 strcpy(buffer,"x");
1802 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1803 ok( r == ERROR_SUCCESS, "wrong return val\n");
1804 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1805 ok( sz == 3, "wrong size returned\n");
1807 sz = 3;
1808 strcpy(buffer,"x");
1809 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1810 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1811 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1812 ok( sz == 3, "wrong size returned\n");
1814 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1815 ok( r == ERROR_SUCCESS, "wrong return val\n");
1817 sz = 4;
1818 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1819 ok( r == ERROR_SUCCESS, "wrong return val\n");
1820 ok( !strcmp(buffer,""), "buffer wrong\n");
1821 ok( sz == 0, "wrong size returned\n");
1823 sz = 4;
1824 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1825 ok( r == ERROR_SUCCESS, "wrong return val\n");
1826 ok( !strcmp(buffer,""), "buffer wrong\n");
1827 ok( sz == 0, "wrong size returned\n");
1829 sz = 4;
1830 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1831 ok( r == ERROR_SUCCESS, "wrong return val\n");
1832 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1833 ok( sz == 3, "wrong size returned\n");
1835 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1836 ok( r == ERROR_SUCCESS, "wrong return val\n");
1838 sz = 0;
1839 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1840 ok( r == ERROR_SUCCESS, "return wrong\n");
1841 ok( sz == 13, "size wrong (%d)\n", sz);
1843 sz = 13;
1844 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1845 ok( r == ERROR_MORE_DATA, "return wrong\n");
1846 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1848 r = MsiSetProperty(hpkg, "property", "value");
1849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1851 sz = 6;
1852 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1853 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1854 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1856 r = MsiSetProperty(hpkg, "property", NULL);
1857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1859 sz = 6;
1860 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1861 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1862 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1864 MsiCloseHandle( hpkg );
1865 DeleteFile(msifile);
1868 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1870 MSIHANDLE hview, hrec;
1871 BOOL found;
1872 CHAR buffer[MAX_PATH];
1873 DWORD sz;
1874 UINT r;
1876 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1877 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1878 r = MsiViewExecute(hview, 0);
1879 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1881 found = FALSE;
1882 while (r == ERROR_SUCCESS && !found)
1884 r = MsiViewFetch(hview, &hrec);
1885 if (r != ERROR_SUCCESS) break;
1887 sz = MAX_PATH;
1888 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1889 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1891 sz = MAX_PATH;
1892 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1893 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1894 found = TRUE;
1897 MsiCloseHandle(hrec);
1900 MsiViewClose(hview);
1901 MsiCloseHandle(hview);
1903 return found;
1906 static void test_property_table(void)
1908 const char *query;
1909 UINT r;
1910 MSIHANDLE hpkg, hdb, hrec;
1911 char buffer[MAX_PATH];
1912 DWORD sz;
1913 BOOL found;
1915 hdb = create_package_db();
1916 ok( hdb, "failed to create package\n");
1918 hpkg = package_from_db(hdb);
1919 ok( hpkg, "failed to create package\n");
1921 MsiCloseHandle(hdb);
1923 hdb = MsiGetActiveDatabase(hpkg);
1925 query = "CREATE TABLE `_Property` ( "
1926 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1927 r = run_query(hdb, query);
1928 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1930 MsiCloseHandle(hdb);
1931 MsiCloseHandle(hpkg);
1932 DeleteFile(msifile);
1934 hdb = create_package_db();
1935 ok( hdb, "failed to create package\n");
1937 query = "CREATE TABLE `_Property` ( "
1938 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1939 r = run_query(hdb, query);
1940 ok(r == ERROR_SUCCESS, "failed to create table\n");
1942 query = "ALTER `_Property` ADD `foo` INTEGER";
1943 r = run_query(hdb, query);
1944 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1946 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1947 r = run_query(hdb, query);
1948 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1950 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1951 r = run_query(hdb, query);
1952 ok(r == ERROR_SUCCESS, "failed to add column\n");
1954 hpkg = package_from_db(hdb);
1955 todo_wine
1957 ok(!hpkg, "package should not be created\n");
1960 MsiCloseHandle(hdb);
1961 MsiCloseHandle(hpkg);
1962 DeleteFile(msifile);
1964 hdb = create_package_db();
1965 ok (hdb, "failed to create package database\n");
1967 r = create_property_table(hdb);
1968 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
1970 r = add_property_entry(hdb, "'prop', 'val'");
1971 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1973 hpkg = package_from_db(hdb);
1974 ok(hpkg, "failed to create package\n");
1976 MsiCloseHandle(hdb);
1978 sz = MAX_PATH;
1979 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
1980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1981 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
1983 hdb = MsiGetActiveDatabase(hpkg);
1985 found = find_prop_in_property(hdb, "prop", "val");
1986 ok(found, "prop should be in the _Property table\n");
1988 r = add_property_entry(hdb, "'dantes', 'mercedes'");
1989 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1991 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1992 r = do_query(hdb, query, &hrec);
1993 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1995 found = find_prop_in_property(hdb, "dantes", "mercedes");
1996 ok(found == FALSE, "dantes should not be in the _Property table\n");
1998 sz = MAX_PATH;
1999 lstrcpy(buffer, "aaa");
2000 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2001 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2002 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2004 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2007 found = find_prop_in_property(hdb, "dantes", "mercedes");
2008 ok(found == TRUE, "dantes should be in the _Property table\n");
2010 MsiCloseHandle(hdb);
2011 MsiCloseHandle(hpkg);
2012 DeleteFile(msifile);
2015 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2017 MSIHANDLE htab = 0;
2018 UINT res;
2020 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2021 if( res == ERROR_SUCCESS )
2023 UINT r;
2025 r = MsiViewExecute( htab, hrec );
2026 if( r != ERROR_SUCCESS )
2028 res = r;
2029 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2032 r = MsiViewClose( htab );
2033 if( r != ERROR_SUCCESS )
2034 res = r;
2036 r = MsiCloseHandle( htab );
2037 if( r != ERROR_SUCCESS )
2038 res = r;
2040 return res;
2043 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2045 return try_query_param( hdb, szQuery, 0 );
2048 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2050 MSIHANDLE summary;
2051 UINT r;
2053 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2056 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2059 r = MsiSummaryInfoPersist(summary);
2060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2062 MsiCloseHandle(summary);
2065 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2067 MSIHANDLE summary;
2068 UINT r;
2070 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2073 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2076 r = MsiSummaryInfoPersist(summary);
2077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2079 MsiCloseHandle(summary);
2082 static void test_msipackage(void)
2084 MSIHANDLE hdb = 0, hpack = 100;
2085 UINT r;
2086 const char *query;
2087 char name[10];
2089 /* NULL szPackagePath */
2090 r = MsiOpenPackage(NULL, &hpack);
2091 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2093 /* empty szPackagePath */
2094 r = MsiOpenPackage("", &hpack);
2095 todo_wine
2097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2100 if (r == ERROR_SUCCESS)
2101 MsiCloseHandle(hpack);
2103 /* nonexistent szPackagePath */
2104 r = MsiOpenPackage("nonexistent", &hpack);
2105 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2107 /* NULL hProduct */
2108 r = MsiOpenPackage(msifile, NULL);
2109 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2111 name[0]='#';
2112 name[1]=0;
2113 r = MsiOpenPackage(name, &hpack);
2114 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2116 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2119 /* database exists, but is emtpy */
2120 sprintf(name, "#%d", hdb);
2121 r = MsiOpenPackage(name, &hpack);
2122 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2123 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2125 query = "CREATE TABLE `Property` ( "
2126 "`Property` CHAR(72), `Value` CHAR(0) "
2127 "PRIMARY KEY `Property`)";
2128 r = try_query(hdb, query);
2129 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2131 query = "CREATE TABLE `InstallExecuteSequence` ("
2132 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2133 "PRIMARY KEY `Action`)";
2134 r = try_query(hdb, query);
2135 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2137 /* a few key tables exist */
2138 sprintf(name, "#%d", hdb);
2139 r = MsiOpenPackage(name, &hpack);
2140 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2141 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2143 MsiCloseHandle(hdb);
2144 DeleteFile(msifile);
2146 /* start with a clean database to show what constitutes a valid package */
2147 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2150 sprintf(name, "#%d", hdb);
2152 /* The following summary information props must exist:
2153 * - PID_REVNUMBER
2154 * - PID_PAGECOUNT
2157 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2158 r = MsiOpenPackage(name, &hpack);
2159 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2160 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2162 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2163 r = MsiOpenPackage(name, &hpack);
2164 ok(r == ERROR_SUCCESS,
2165 "Expected ERROR_SUCCESS, got %d\n", r);
2167 MsiCloseHandle(hpack);
2168 MsiCloseHandle(hdb);
2169 DeleteFile(msifile);
2172 static void test_formatrecord2(void)
2174 MSIHANDLE hpkg, hrec ;
2175 char buffer[0x100];
2176 DWORD sz;
2177 UINT r;
2179 hpkg = package_from_db(create_package_db());
2180 ok( hpkg, "failed to create package\n");
2182 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2183 ok( r == ERROR_SUCCESS, "set property failed\n");
2185 hrec = MsiCreateRecord(2);
2186 ok(hrec, "create record failed\n");
2188 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2189 ok( r == ERROR_SUCCESS, "format record failed\n");
2191 buffer[0] = 0;
2192 sz = sizeof buffer;
2193 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2195 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2196 r = MsiRecordSetString(hrec, 1, "hoo");
2197 sz = sizeof buffer;
2198 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2199 ok( sz == 3, "size wrong\n");
2200 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2201 ok( r == ERROR_SUCCESS, "format failed\n");
2203 r = MsiRecordSetString(hrec, 0, "x[~]x");
2204 sz = sizeof buffer;
2205 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2206 ok( sz == 3, "size wrong\n");
2207 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2208 ok( r == ERROR_SUCCESS, "format failed\n");
2210 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2211 r = MsiRecordSetString(hrec, 1, "hoo");
2212 sz = sizeof buffer;
2213 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2214 ok( sz == 3, "size wrong\n");
2215 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2216 ok( r == ERROR_SUCCESS, "format failed\n");
2218 r = MsiRecordSetString(hrec, 0, "[\\[]");
2219 sz = sizeof buffer;
2220 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2221 ok( sz == 1, "size wrong\n");
2222 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2223 ok( r == ERROR_SUCCESS, "format failed\n");
2225 SetEnvironmentVariable("FOO", "BAR");
2226 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2227 sz = sizeof buffer;
2228 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2229 ok( sz == 3, "size wrong\n");
2230 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2231 ok( r == ERROR_SUCCESS, "format failed\n");
2233 r = MsiRecordSetString(hrec, 0, "[[1]]");
2234 r = MsiRecordSetString(hrec, 1, "%FOO");
2235 sz = sizeof buffer;
2236 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2237 ok( sz == 3, "size wrong\n");
2238 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2239 ok( r == ERROR_SUCCESS, "format failed\n");
2241 MsiCloseHandle( hrec );
2242 MsiCloseHandle( hpkg );
2243 DeleteFile(msifile);
2246 static void test_states(void)
2248 MSIHANDLE hpkg;
2249 UINT r;
2250 MSIHANDLE hdb;
2251 INSTALLSTATE state, action;
2253 static const CHAR msifile2[] = "winetest2.msi";
2254 static const CHAR msifile3[] = "winetest3.msi";
2255 static const CHAR msifile4[] = "winetest4.msi";
2257 hdb = create_package_db();
2258 ok ( hdb, "failed to create package database\n" );
2260 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2261 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2263 r = create_property_table( hdb );
2264 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2266 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2267 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2269 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2270 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2272 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2273 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2275 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2276 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2278 r = create_install_execute_sequence_table( hdb );
2279 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2281 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2282 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2284 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2285 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2287 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2288 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2290 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2291 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2293 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2294 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2296 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2297 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2299 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2300 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2302 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2303 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2305 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2306 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2308 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2309 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2311 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2312 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2314 r = create_media_table( hdb );
2315 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2317 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2318 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2320 r = create_feature_table( hdb );
2321 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2323 r = create_component_table( hdb );
2324 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2326 /* msidbFeatureAttributesFavorLocal */
2327 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2328 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2330 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2331 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2332 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2334 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2335 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2336 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2338 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2339 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2340 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2342 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2343 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2344 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2346 /* msidbFeatureAttributesFavorSource */
2347 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2348 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2350 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2351 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2352 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2354 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2355 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2356 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2358 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2359 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2360 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2362 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2363 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2364 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2366 /* msidbFeatureAttributesFavorSource */
2367 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2368 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2370 /* msidbFeatureAttributesFavorLocal */
2371 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2372 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2374 /* disabled */
2375 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2376 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2378 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2379 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2380 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2382 /* no feature parent:msidbComponentAttributesLocalOnly */
2383 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2384 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2386 /* msidbFeatureAttributesFavorLocal:removed */
2387 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2388 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2390 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2391 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2392 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2394 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2395 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2396 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2398 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2399 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2400 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2402 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2403 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2404 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2406 /* msidbFeatureAttributesFavorSource:removed */
2407 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2408 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2410 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2411 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2412 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2414 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2415 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2416 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2418 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2419 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2420 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2422 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2423 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2424 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2426 /* msidbFeatureAttributesFavorLocal */
2427 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2428 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2430 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2431 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2433 /* msidbFeatureAttributesFavorSource */
2434 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2435 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2437 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2438 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2440 r = create_feature_components_table( hdb );
2441 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2443 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2444 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2446 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2447 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2449 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2450 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2452 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2453 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2455 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2456 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2458 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2459 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2461 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2462 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2464 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2465 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2467 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2468 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2470 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2471 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2473 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2474 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2476 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2477 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2479 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2480 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2482 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2483 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2485 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2486 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2488 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2489 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2491 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2492 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2494 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2495 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2497 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2498 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2500 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2501 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2503 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2504 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2506 r = create_file_table( hdb );
2507 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2509 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2510 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2512 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2513 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2515 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2516 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2518 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2519 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2521 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2522 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2524 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2525 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2527 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2528 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2530 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2531 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2533 /* compressed file */
2534 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2535 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2537 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2538 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2540 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2541 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2543 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2544 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2546 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2547 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2549 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2550 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2552 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2553 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2555 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2556 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2558 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2559 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2561 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2562 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2564 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2565 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2567 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2568 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2570 MsiDatabaseCommit(hdb);
2572 /* these properties must not be in the saved msi file */
2573 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2574 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2576 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2577 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2579 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2580 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2582 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine'");
2583 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2585 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2586 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2588 hpkg = package_from_db( hdb );
2589 ok( hpkg, "failed to create package\n");
2591 MsiCloseHandle(hdb);
2593 CopyFileA(msifile, msifile2, FALSE);
2594 CopyFileA(msifile, msifile3, FALSE);
2595 CopyFileA(msifile, msifile4, FALSE);
2597 state = 0xdeadbee;
2598 action = 0xdeadbee;
2599 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2600 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2601 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2602 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2604 state = 0xdeadbee;
2605 action = 0xdeadbee;
2606 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2607 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2608 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2609 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2611 state = 0xdeadbee;
2612 action = 0xdeadbee;
2613 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2614 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2615 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2616 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2618 state = 0xdeadbee;
2619 action = 0xdeadbee;
2620 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2621 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2622 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2623 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2625 state = 0xdeadbee;
2626 action = 0xdeadbee;
2627 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2628 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2629 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2630 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2632 state = 0xdeadbee;
2633 action = 0xdeadbee;
2634 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2635 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2636 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2637 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2639 state = 0xdeadbee;
2640 action = 0xdeadbee;
2641 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2642 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2643 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2644 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2646 state = 0xdeadbee;
2647 action = 0xdeadbee;
2648 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2649 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2650 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2651 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2653 state = 0xdeadbee;
2654 action = 0xdeadbee;
2655 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2656 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2657 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2658 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2660 state = 0xdeadbee;
2661 action = 0xdeadbee;
2662 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2663 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2664 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2665 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2667 state = 0xdeadbee;
2668 action = 0xdeadbee;
2669 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2670 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2671 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2672 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2674 state = 0xdeadbee;
2675 action = 0xdeadbee;
2676 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2677 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2678 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2679 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2681 state = 0xdeadbee;
2682 action = 0xdeadbee;
2683 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2684 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2685 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2686 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2688 state = 0xdeadbee;
2689 action = 0xdeadbee;
2690 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2691 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2692 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2693 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2695 state = 0xdeadbee;
2696 action = 0xdeadbee;
2697 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2698 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2699 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2700 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2702 state = 0xdeadbee;
2703 action = 0xdeadbee;
2704 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2705 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2706 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2707 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2709 state = 0xdeadbee;
2710 action = 0xdeadbee;
2711 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2712 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2713 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2714 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2716 state = 0xdeadbee;
2717 action = 0xdeadbee;
2718 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2719 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2720 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2721 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2723 state = 0xdeadbee;
2724 action = 0xdeadbee;
2725 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2726 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2727 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2728 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2730 state = 0xdeadbee;
2731 action = 0xdeadbee;
2732 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2733 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2734 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2735 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2737 state = 0xdeadbee;
2738 action = 0xdeadbee;
2739 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2740 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2741 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2742 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2744 state = 0xdeadbee;
2745 action = 0xdeadbee;
2746 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2747 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2748 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2749 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2751 state = 0xdeadbee;
2752 action = 0xdeadbee;
2753 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2754 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2755 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2756 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2758 state = 0xdeadbee;
2759 action = 0xdeadbee;
2760 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2761 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2762 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2763 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2765 state = 0xdeadbee;
2766 action = 0xdeadbee;
2767 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2768 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2769 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2770 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2772 state = 0xdeadbee;
2773 action = 0xdeadbee;
2774 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2775 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2776 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2777 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2779 state = 0xdeadbee;
2780 action = 0xdeadbee;
2781 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2782 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2783 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2784 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2786 state = 0xdeadbee;
2787 action = 0xdeadbee;
2788 r = MsiGetComponentState(hpkg, "tau", &state, &action);
2789 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2790 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2791 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2793 state = 0xdeadbee;
2794 action = 0xdeadbee;
2795 r = MsiGetComponentState(hpkg, "phi", &state, &action);
2796 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2797 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2798 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2800 r = MsiDoAction( hpkg, "CostInitialize");
2801 ok( r == ERROR_SUCCESS, "cost init failed\n");
2803 state = 0xdeadbee;
2804 action = 0xdeadbee;
2805 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2807 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2808 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2810 state = 0xdeadbee;
2811 action = 0xdeadbee;
2812 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2814 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2815 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2817 state = 0xdeadbee;
2818 action = 0xdeadbee;
2819 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2821 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2822 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2824 state = 0xdeadbee;
2825 action = 0xdeadbee;
2826 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2828 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2829 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2831 state = 0xdeadbee;
2832 action = 0xdeadbee;
2833 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2835 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2836 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2838 state = 0xdeadbee;
2839 action = 0xdeadbee;
2840 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2842 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2843 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2845 state = 0xdeadbee;
2846 action = 0xdeadbee;
2847 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2849 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2850 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2852 state = 0xdeadbee;
2853 action = 0xdeadbee;
2854 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2856 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2857 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2859 state = 0xdeadbee;
2860 action = 0xdeadbee;
2861 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2863 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2864 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2866 state = 0xdeadbee;
2867 action = 0xdeadbee;
2868 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2870 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2871 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2873 state = 0xdeadbee;
2874 action = 0xdeadbee;
2875 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2877 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2878 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2880 state = 0xdeadbee;
2881 action = 0xdeadbee;
2882 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2883 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2884 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2885 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2887 state = 0xdeadbee;
2888 action = 0xdeadbee;
2889 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2891 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2892 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2894 state = 0xdeadbee;
2895 action = 0xdeadbee;
2896 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2898 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2899 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2901 state = 0xdeadbee;
2902 action = 0xdeadbee;
2903 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2905 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2906 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2908 state = 0xdeadbee;
2909 action = 0xdeadbee;
2910 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2912 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2913 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2915 state = 0xdeadbee;
2916 action = 0xdeadbee;
2917 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2919 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2920 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2922 state = 0xdeadbee;
2923 action = 0xdeadbee;
2924 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2925 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2926 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2927 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2929 state = 0xdeadbee;
2930 action = 0xdeadbee;
2931 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2933 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2934 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2936 state = 0xdeadbee;
2937 action = 0xdeadbee;
2938 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2940 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2941 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2943 state = 0xdeadbee;
2944 action = 0xdeadbee;
2945 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2947 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2950 state = 0xdeadbee;
2951 action = 0xdeadbee;
2952 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2954 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2955 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2957 state = 0xdeadbee;
2958 action = 0xdeadbee;
2959 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2961 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2962 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2964 state = 0xdeadbee;
2965 action = 0xdeadbee;
2966 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2968 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2969 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2971 state = 0xdeadbee;
2972 action = 0xdeadbee;
2973 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2975 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2976 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2978 state = 0xdeadbee;
2979 action = 0xdeadbee;
2980 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2982 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2983 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2985 state = 0xdeadbee;
2986 action = 0xdeadbee;
2987 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2989 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2990 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2992 state = 0xdeadbee;
2993 action = 0xdeadbee;
2994 r = MsiGetComponentState(hpkg, "tau", &state, &action);
2995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2996 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2997 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2999 state = 0xdeadbee;
3000 action = 0xdeadbee;
3001 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3002 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3003 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3004 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3006 r = MsiDoAction( hpkg, "FileCost");
3007 ok( r == ERROR_SUCCESS, "file cost failed\n");
3009 state = 0xdeadbee;
3010 action = 0xdeadbee;
3011 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3012 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3013 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3014 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3016 state = 0xdeadbee;
3017 action = 0xdeadbee;
3018 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3019 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3020 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3021 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3023 state = 0xdeadbee;
3024 action = 0xdeadbee;
3025 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3026 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3027 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3028 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3030 state = 0xdeadbee;
3031 action = 0xdeadbee;
3032 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3033 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3034 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3035 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3037 state = 0xdeadbee;
3038 action = 0xdeadbee;
3039 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3040 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3041 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3042 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3044 state = 0xdeadbee;
3045 action = 0xdeadbee;
3046 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3047 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3048 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3049 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3051 state = 0xdeadbee;
3052 action = 0xdeadbee;
3053 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3054 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3055 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3056 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3058 state = 0xdeadbee;
3059 action = 0xdeadbee;
3060 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3061 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3062 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3063 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3065 state = 0xdeadbee;
3066 action = 0xdeadbee;
3067 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3068 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3069 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3070 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3072 state = 0xdeadbee;
3073 action = 0xdeadbee;
3074 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3075 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3076 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3077 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3079 state = 0xdeadbee;
3080 action = 0xdeadbee;
3081 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3082 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3083 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3084 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3086 state = 0xdeadbee;
3087 action = 0xdeadbee;
3088 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3090 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3091 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3093 state = 0xdeadbee;
3094 action = 0xdeadbee;
3095 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3097 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3098 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3100 state = 0xdeadbee;
3101 action = 0xdeadbee;
3102 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3103 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3104 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3105 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3107 state = 0xdeadbee;
3108 action = 0xdeadbee;
3109 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3111 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3112 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3114 state = 0xdeadbee;
3115 action = 0xdeadbee;
3116 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3117 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3118 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3119 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3121 state = 0xdeadbee;
3122 action = 0xdeadbee;
3123 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3124 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3125 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3126 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3128 state = 0xdeadbee;
3129 action = 0xdeadbee;
3130 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3131 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3132 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3133 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3135 state = 0xdeadbee;
3136 action = 0xdeadbee;
3137 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3138 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3139 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3140 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3142 state = 0xdeadbee;
3143 action = 0xdeadbee;
3144 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3145 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3146 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3147 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3149 state = 0xdeadbee;
3150 action = 0xdeadbee;
3151 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3152 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3153 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3154 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3156 state = 0xdeadbee;
3157 action = 0xdeadbee;
3158 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3159 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3160 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3161 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3163 state = 0xdeadbee;
3164 action = 0xdeadbee;
3165 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3167 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3168 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3170 state = 0xdeadbee;
3171 action = 0xdeadbee;
3172 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3173 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3174 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3175 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3177 state = 0xdeadbee;
3178 action = 0xdeadbee;
3179 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3181 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3182 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3184 state = 0xdeadbee;
3185 action = 0xdeadbee;
3186 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3188 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3189 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3191 state = 0xdeadbee;
3192 action = 0xdeadbee;
3193 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3195 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3196 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3198 state = 0xdeadbee;
3199 action = 0xdeadbee;
3200 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3202 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3203 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3205 state = 0xdeadbee;
3206 action = 0xdeadbee;
3207 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3209 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3210 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3212 r = MsiDoAction( hpkg, "CostFinalize");
3213 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3215 state = 0xdeadbee;
3216 action = 0xdeadbee;
3217 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3219 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3220 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3222 state = 0xdeadbee;
3223 action = 0xdeadbee;
3224 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3226 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3227 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3229 state = 0xdeadbee;
3230 action = 0xdeadbee;
3231 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3233 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3234 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3236 state = 0xdeadbee;
3237 action = 0xdeadbee;
3238 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3240 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3241 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3243 state = 0xdeadbee;
3244 action = 0xdeadbee;
3245 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3247 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3250 state = 0xdeadbee;
3251 action = 0xdeadbee;
3252 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3254 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3255 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3257 state = 0xdeadbee;
3258 action = 0xdeadbee;
3259 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3261 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3264 state = 0xdeadbee;
3265 action = 0xdeadbee;
3266 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3268 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3269 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3271 state = 0xdeadbee;
3272 action = 0xdeadbee;
3273 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3275 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3276 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3278 state = 0xdeadbee;
3279 action = 0xdeadbee;
3280 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3282 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3283 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3285 state = 0xdeadbee;
3286 action = 0xdeadbee;
3287 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3288 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3289 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3290 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3292 state = 0xdeadbee;
3293 action = 0xdeadbee;
3294 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3295 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3296 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3297 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3299 state = 0xdeadbee;
3300 action = 0xdeadbee;
3301 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3302 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3303 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3304 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3306 state = 0xdeadbee;
3307 action = 0xdeadbee;
3308 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3309 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3310 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3311 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3313 state = 0xdeadbee;
3314 action = 0xdeadbee;
3315 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3316 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3317 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3318 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3320 state = 0xdeadbee;
3321 action = 0xdeadbee;
3322 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3323 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3324 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3325 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3327 state = 0xdeadbee;
3328 action = 0xdeadbee;
3329 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3330 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3331 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3332 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3334 state = 0xdeadbee;
3335 action = 0xdeadbee;
3336 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3337 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3338 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3339 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3341 state = 0xdeadbee;
3342 action = 0xdeadbee;
3343 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3344 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3345 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3346 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3348 state = 0xdeadbee;
3349 action = 0xdeadbee;
3350 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3351 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3352 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3353 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3355 state = 0xdeadbee;
3356 action = 0xdeadbee;
3357 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3358 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3359 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3360 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3362 state = 0xdeadbee;
3363 action = 0xdeadbee;
3364 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3365 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3366 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3367 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3369 state = 0xdeadbee;
3370 action = 0xdeadbee;
3371 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3372 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3373 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3374 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3376 state = 0xdeadbee;
3377 action = 0xdeadbee;
3378 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3379 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3380 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3381 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3383 state = 0xdeadbee;
3384 action = 0xdeadbee;
3385 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3386 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3387 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3388 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3390 state = 0xdeadbee;
3391 action = 0xdeadbee;
3392 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3393 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3394 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3395 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3397 state = 0xdeadbee;
3398 action = 0xdeadbee;
3399 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3400 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3401 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3402 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3404 state = 0xdeadbee;
3405 action = 0xdeadbee;
3406 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3408 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3409 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3411 state = 0xdeadbee;
3412 action = 0xdeadbee;
3413 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3415 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3416 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3418 MsiCloseHandle( hpkg );
3420 /* publish the features and components */
3421 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine");
3422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3424 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3425 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3427 /* these properties must not be in the saved msi file */
3428 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3429 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3431 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3432 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3434 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3435 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3437 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine'");
3438 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3440 hpkg = package_from_db( hdb );
3441 ok( hpkg, "failed to create package\n");
3443 MsiCloseHandle(hdb);
3445 state = 0xdeadbee;
3446 action = 0xdeadbee;
3447 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3448 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3449 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3450 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3452 state = 0xdeadbee;
3453 action = 0xdeadbee;
3454 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3455 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3456 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3457 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3459 state = 0xdeadbee;
3460 action = 0xdeadbee;
3461 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3462 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3463 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3464 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3466 state = 0xdeadbee;
3467 action = 0xdeadbee;
3468 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3469 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3470 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3471 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3473 state = 0xdeadbee;
3474 action = 0xdeadbee;
3475 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3476 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3477 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3478 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3480 state = 0xdeadbee;
3481 action = 0xdeadbee;
3482 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3483 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3484 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3485 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3487 state = 0xdeadbee;
3488 action = 0xdeadbee;
3489 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3490 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3491 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3492 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3494 state = 0xdeadbee;
3495 action = 0xdeadbee;
3496 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3497 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3498 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3499 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3501 state = 0xdeadbee;
3502 action = 0xdeadbee;
3503 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3504 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3505 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3506 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3508 state = 0xdeadbee;
3509 action = 0xdeadbee;
3510 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3511 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3512 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3513 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3515 state = 0xdeadbee;
3516 action = 0xdeadbee;
3517 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3518 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3519 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3520 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3522 state = 0xdeadbee;
3523 action = 0xdeadbee;
3524 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3525 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3526 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3527 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3529 state = 0xdeadbee;
3530 action = 0xdeadbee;
3531 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3532 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3533 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3534 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3536 state = 0xdeadbee;
3537 action = 0xdeadbee;
3538 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3539 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3540 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3541 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3543 state = 0xdeadbee;
3544 action = 0xdeadbee;
3545 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3546 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3547 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3548 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3550 state = 0xdeadbee;
3551 action = 0xdeadbee;
3552 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3553 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3554 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3555 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3557 state = 0xdeadbee;
3558 action = 0xdeadbee;
3559 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3560 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3561 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3562 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3564 state = 0xdeadbee;
3565 action = 0xdeadbee;
3566 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3567 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3568 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3569 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3571 state = 0xdeadbee;
3572 action = 0xdeadbee;
3573 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3574 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3575 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3576 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3578 state = 0xdeadbee;
3579 action = 0xdeadbee;
3580 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3581 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3582 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3583 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3585 state = 0xdeadbee;
3586 action = 0xdeadbee;
3587 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3588 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3589 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3590 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3592 state = 0xdeadbee;
3593 action = 0xdeadbee;
3594 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3595 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3596 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3597 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3599 state = 0xdeadbee;
3600 action = 0xdeadbee;
3601 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3602 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3603 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3604 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3606 state = 0xdeadbee;
3607 action = 0xdeadbee;
3608 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3609 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3610 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3611 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3613 state = 0xdeadbee;
3614 action = 0xdeadbee;
3615 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3616 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3617 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3618 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3620 state = 0xdeadbee;
3621 action = 0xdeadbee;
3622 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3623 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3624 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3625 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3627 state = 0xdeadbee;
3628 action = 0xdeadbee;
3629 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3630 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3631 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3632 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3634 state = 0xdeadbee;
3635 action = 0xdeadbee;
3636 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3637 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3638 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3639 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3641 state = 0xdeadbee;
3642 action = 0xdeadbee;
3643 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3644 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3645 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3646 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3648 r = MsiDoAction( hpkg, "CostInitialize");
3649 ok( r == ERROR_SUCCESS, "cost init failed\n");
3651 state = 0xdeadbee;
3652 action = 0xdeadbee;
3653 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3655 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3656 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3658 state = 0xdeadbee;
3659 action = 0xdeadbee;
3660 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3662 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3663 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3665 state = 0xdeadbee;
3666 action = 0xdeadbee;
3667 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3669 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3670 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3672 state = 0xdeadbee;
3673 action = 0xdeadbee;
3674 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3676 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3677 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3679 state = 0xdeadbee;
3680 action = 0xdeadbee;
3681 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3683 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3684 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3686 state = 0xdeadbee;
3687 action = 0xdeadbee;
3688 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3690 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3691 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3693 state = 0xdeadbee;
3694 action = 0xdeadbee;
3695 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3697 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3698 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3700 state = 0xdeadbee;
3701 action = 0xdeadbee;
3702 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3704 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3705 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3707 state = 0xdeadbee;
3708 action = 0xdeadbee;
3709 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3711 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3712 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3714 state = 0xdeadbee;
3715 action = 0xdeadbee;
3716 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3717 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3718 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3719 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3721 state = 0xdeadbee;
3722 action = 0xdeadbee;
3723 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3724 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3725 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3726 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3728 state = 0xdeadbee;
3729 action = 0xdeadbee;
3730 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3732 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3733 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3735 state = 0xdeadbee;
3736 action = 0xdeadbee;
3737 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3738 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3739 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3740 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3742 state = 0xdeadbee;
3743 action = 0xdeadbee;
3744 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3745 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3746 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3747 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3749 state = 0xdeadbee;
3750 action = 0xdeadbee;
3751 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3752 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3753 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3754 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3756 state = 0xdeadbee;
3757 action = 0xdeadbee;
3758 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3759 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3760 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3761 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3763 state = 0xdeadbee;
3764 action = 0xdeadbee;
3765 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3766 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3767 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3768 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3770 state = 0xdeadbee;
3771 action = 0xdeadbee;
3772 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3773 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3774 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3775 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3777 state = 0xdeadbee;
3778 action = 0xdeadbee;
3779 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3780 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3781 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3782 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3784 state = 0xdeadbee;
3785 action = 0xdeadbee;
3786 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3787 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3788 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3789 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3791 state = 0xdeadbee;
3792 action = 0xdeadbee;
3793 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3794 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3795 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3796 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3798 state = 0xdeadbee;
3799 action = 0xdeadbee;
3800 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3801 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3802 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3803 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3805 state = 0xdeadbee;
3806 action = 0xdeadbee;
3807 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3808 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3809 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3810 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3812 state = 0xdeadbee;
3813 action = 0xdeadbee;
3814 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3816 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3817 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3819 state = 0xdeadbee;
3820 action = 0xdeadbee;
3821 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3822 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3823 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3824 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3826 state = 0xdeadbee;
3827 action = 0xdeadbee;
3828 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3830 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3831 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3833 state = 0xdeadbee;
3834 action = 0xdeadbee;
3835 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3836 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3837 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3838 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3840 state = 0xdeadbee;
3841 action = 0xdeadbee;
3842 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3847 state = 0xdeadbee;
3848 action = 0xdeadbee;
3849 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3854 r = MsiDoAction( hpkg, "FileCost");
3855 ok( r == ERROR_SUCCESS, "file cost failed\n");
3857 state = 0xdeadbee;
3858 action = 0xdeadbee;
3859 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3860 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3861 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3862 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3864 state = 0xdeadbee;
3865 action = 0xdeadbee;
3866 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3868 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3869 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3871 state = 0xdeadbee;
3872 action = 0xdeadbee;
3873 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3874 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3875 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3876 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3878 state = 0xdeadbee;
3879 action = 0xdeadbee;
3880 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3881 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3882 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3883 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3885 state = 0xdeadbee;
3886 action = 0xdeadbee;
3887 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3888 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3889 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3890 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3892 state = 0xdeadbee;
3893 action = 0xdeadbee;
3894 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3895 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3896 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3897 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3899 state = 0xdeadbee;
3900 action = 0xdeadbee;
3901 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3903 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3904 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3906 state = 0xdeadbee;
3907 action = 0xdeadbee;
3908 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3910 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3911 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3913 state = 0xdeadbee;
3914 action = 0xdeadbee;
3915 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3917 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3920 state = 0xdeadbee;
3921 action = 0xdeadbee;
3922 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3924 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3925 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3927 state = 0xdeadbee;
3928 action = 0xdeadbee;
3929 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3930 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3931 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3932 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3934 state = 0xdeadbee;
3935 action = 0xdeadbee;
3936 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3937 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3938 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3939 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3941 state = 0xdeadbee;
3942 action = 0xdeadbee;
3943 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3945 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3946 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3948 state = 0xdeadbee;
3949 action = 0xdeadbee;
3950 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3951 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3952 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3953 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3955 state = 0xdeadbee;
3956 action = 0xdeadbee;
3957 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3958 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3959 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3960 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3962 state = 0xdeadbee;
3963 action = 0xdeadbee;
3964 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3965 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3966 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3967 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3969 state = 0xdeadbee;
3970 action = 0xdeadbee;
3971 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3972 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3973 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3974 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3976 state = 0xdeadbee;
3977 action = 0xdeadbee;
3978 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3979 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3980 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3981 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3983 state = 0xdeadbee;
3984 action = 0xdeadbee;
3985 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3986 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3987 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3988 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3990 state = 0xdeadbee;
3991 action = 0xdeadbee;
3992 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3994 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3995 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3997 state = 0xdeadbee;
3998 action = 0xdeadbee;
3999 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4001 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4002 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4004 state = 0xdeadbee;
4005 action = 0xdeadbee;
4006 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4008 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4009 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4011 state = 0xdeadbee;
4012 action = 0xdeadbee;
4013 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4015 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4016 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4018 state = 0xdeadbee;
4019 action = 0xdeadbee;
4020 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4022 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4025 state = 0xdeadbee;
4026 action = 0xdeadbee;
4027 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4029 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4030 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4032 state = 0xdeadbee;
4033 action = 0xdeadbee;
4034 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4036 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4037 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4039 state = 0xdeadbee;
4040 action = 0xdeadbee;
4041 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4042 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4043 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4044 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4046 state = 0xdeadbee;
4047 action = 0xdeadbee;
4048 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4049 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4050 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4051 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4053 state = 0xdeadbee;
4054 action = 0xdeadbee;
4055 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4057 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4058 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4060 r = MsiDoAction( hpkg, "CostFinalize");
4061 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4063 state = 0xdeadbee;
4064 action = 0xdeadbee;
4065 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4067 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4068 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4070 state = 0xdeadbee;
4071 action = 0xdeadbee;
4072 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4074 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4075 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4077 state = 0xdeadbee;
4078 action = 0xdeadbee;
4079 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4081 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4082 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4084 state = 0xdeadbee;
4085 action = 0xdeadbee;
4086 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4088 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4089 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4091 state = 0xdeadbee;
4092 action = 0xdeadbee;
4093 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4095 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4096 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4098 state = 0xdeadbee;
4099 action = 0xdeadbee;
4100 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4102 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4103 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4105 state = 0xdeadbee;
4106 action = 0xdeadbee;
4107 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4109 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4112 state = 0xdeadbee;
4113 action = 0xdeadbee;
4114 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4116 todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4117 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4119 state = 0xdeadbee;
4120 action = 0xdeadbee;
4121 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4123 todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4124 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4126 state = 0xdeadbee;
4127 action = 0xdeadbee;
4128 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4130 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4131 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4133 state = 0xdeadbee;
4134 action = 0xdeadbee;
4135 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4137 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4138 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4140 state = 0xdeadbee;
4141 action = 0xdeadbee;
4142 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4144 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4145 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4147 state = 0xdeadbee;
4148 action = 0xdeadbee;
4149 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4151 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4152 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4154 state = 0xdeadbee;
4155 action = 0xdeadbee;
4156 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4158 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4159 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4161 state = 0xdeadbee;
4162 action = 0xdeadbee;
4163 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4165 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4166 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4168 state = 0xdeadbee;
4169 action = 0xdeadbee;
4170 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4172 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4173 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4175 state = 0xdeadbee;
4176 action = 0xdeadbee;
4177 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4179 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4180 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4182 state = 0xdeadbee;
4183 action = 0xdeadbee;
4184 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4186 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4187 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4189 state = 0xdeadbee;
4190 action = 0xdeadbee;
4191 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4193 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4196 state = 0xdeadbee;
4197 action = 0xdeadbee;
4198 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4200 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4203 state = 0xdeadbee;
4204 action = 0xdeadbee;
4205 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4207 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4210 state = 0xdeadbee;
4211 action = 0xdeadbee;
4212 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4214 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4217 state = 0xdeadbee;
4218 action = 0xdeadbee;
4219 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4221 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4222 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4224 state = 0xdeadbee;
4225 action = 0xdeadbee;
4226 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4228 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4229 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4231 state = 0xdeadbee;
4232 action = 0xdeadbee;
4233 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4235 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4236 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4238 state = 0xdeadbee;
4239 action = 0xdeadbee;
4240 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4242 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4243 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4245 state = 0xdeadbee;
4246 action = 0xdeadbee;
4247 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4249 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4250 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4252 state = 0xdeadbee;
4253 action = 0xdeadbee;
4254 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4255 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4256 todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4257 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4259 state = 0xdeadbee;
4260 action = 0xdeadbee;
4261 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4262 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4263 todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4264 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4266 MsiCloseHandle(hpkg);
4268 /* uninstall the product */
4269 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4270 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4272 /* all features installed locally */
4273 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4274 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4276 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4277 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4279 /* these properties must not be in the saved msi file */
4280 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine'");
4281 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4283 hpkg = package_from_db( hdb );
4284 ok( hpkg, "failed to create package\n");
4286 state = 0xdeadbee;
4287 action = 0xdeadbee;
4288 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4289 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4290 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4291 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4293 state = 0xdeadbee;
4294 action = 0xdeadbee;
4295 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4296 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4297 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4298 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4300 state = 0xdeadbee;
4301 action = 0xdeadbee;
4302 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4303 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4304 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4305 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4307 state = 0xdeadbee;
4308 action = 0xdeadbee;
4309 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4310 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4311 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4312 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4314 state = 0xdeadbee;
4315 action = 0xdeadbee;
4316 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4317 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4318 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4319 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4321 state = 0xdeadbee;
4322 action = 0xdeadbee;
4323 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4324 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4325 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4326 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4328 state = 0xdeadbee;
4329 action = 0xdeadbee;
4330 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4331 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4332 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4333 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4335 state = 0xdeadbee;
4336 action = 0xdeadbee;
4337 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4338 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4339 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4340 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4342 state = 0xdeadbee;
4343 action = 0xdeadbee;
4344 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4345 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4346 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4347 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4349 state = 0xdeadbee;
4350 action = 0xdeadbee;
4351 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4352 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4353 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4354 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4356 state = 0xdeadbee;
4357 action = 0xdeadbee;
4358 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4359 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4360 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4361 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4363 state = 0xdeadbee;
4364 action = 0xdeadbee;
4365 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4366 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4367 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4368 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4370 state = 0xdeadbee;
4371 action = 0xdeadbee;
4372 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4373 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4374 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4375 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4377 state = 0xdeadbee;
4378 action = 0xdeadbee;
4379 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4380 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4381 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4382 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4384 state = 0xdeadbee;
4385 action = 0xdeadbee;
4386 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4387 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4388 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4389 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4391 state = 0xdeadbee;
4392 action = 0xdeadbee;
4393 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4394 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4395 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4396 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4398 state = 0xdeadbee;
4399 action = 0xdeadbee;
4400 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4401 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4402 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4403 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4405 state = 0xdeadbee;
4406 action = 0xdeadbee;
4407 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4408 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4409 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4410 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4412 state = 0xdeadbee;
4413 action = 0xdeadbee;
4414 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4415 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4416 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4417 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4419 state = 0xdeadbee;
4420 action = 0xdeadbee;
4421 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4422 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4423 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4424 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4426 state = 0xdeadbee;
4427 action = 0xdeadbee;
4428 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4429 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4430 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4431 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4433 state = 0xdeadbee;
4434 action = 0xdeadbee;
4435 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4436 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4437 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4438 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4440 state = 0xdeadbee;
4441 action = 0xdeadbee;
4442 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4443 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4444 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4445 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4447 state = 0xdeadbee;
4448 action = 0xdeadbee;
4449 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4450 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4451 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4452 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4454 state = 0xdeadbee;
4455 action = 0xdeadbee;
4456 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4457 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4458 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4459 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4461 state = 0xdeadbee;
4462 action = 0xdeadbee;
4463 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4464 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4465 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4466 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4468 state = 0xdeadbee;
4469 action = 0xdeadbee;
4470 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4471 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4472 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4473 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4475 state = 0xdeadbee;
4476 action = 0xdeadbee;
4477 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4478 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4479 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4480 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4482 state = 0xdeadbee;
4483 action = 0xdeadbee;
4484 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4485 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4486 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4487 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4489 r = MsiDoAction( hpkg, "CostInitialize");
4490 ok( r == ERROR_SUCCESS, "cost init failed\n");
4492 state = 0xdeadbee;
4493 action = 0xdeadbee;
4494 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4496 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4499 state = 0xdeadbee;
4500 action = 0xdeadbee;
4501 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4503 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4504 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4506 state = 0xdeadbee;
4507 action = 0xdeadbee;
4508 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4510 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4511 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4513 state = 0xdeadbee;
4514 action = 0xdeadbee;
4515 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4517 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4520 state = 0xdeadbee;
4521 action = 0xdeadbee;
4522 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4524 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4525 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4527 state = 0xdeadbee;
4528 action = 0xdeadbee;
4529 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4531 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4532 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4534 state = 0xdeadbee;
4535 action = 0xdeadbee;
4536 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4538 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4539 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4541 state = 0xdeadbee;
4542 action = 0xdeadbee;
4543 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4545 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4546 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4548 state = 0xdeadbee;
4549 action = 0xdeadbee;
4550 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4552 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4553 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4555 state = 0xdeadbee;
4556 action = 0xdeadbee;
4557 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4559 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4560 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4562 state = 0xdeadbee;
4563 action = 0xdeadbee;
4564 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4565 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4566 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4567 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4569 state = 0xdeadbee;
4570 action = 0xdeadbee;
4571 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4573 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4574 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4576 state = 0xdeadbee;
4577 action = 0xdeadbee;
4578 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4580 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4581 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4583 state = 0xdeadbee;
4584 action = 0xdeadbee;
4585 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4587 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4588 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4590 state = 0xdeadbee;
4591 action = 0xdeadbee;
4592 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4594 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4595 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4597 state = 0xdeadbee;
4598 action = 0xdeadbee;
4599 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4601 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4602 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4604 state = 0xdeadbee;
4605 action = 0xdeadbee;
4606 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4608 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4609 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4611 state = 0xdeadbee;
4612 action = 0xdeadbee;
4613 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4615 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4616 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4618 state = 0xdeadbee;
4619 action = 0xdeadbee;
4620 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4621 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4622 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4623 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4625 state = 0xdeadbee;
4626 action = 0xdeadbee;
4627 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4629 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4630 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4632 state = 0xdeadbee;
4633 action = 0xdeadbee;
4634 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4636 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4637 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4639 state = 0xdeadbee;
4640 action = 0xdeadbee;
4641 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4643 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4644 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4646 state = 0xdeadbee;
4647 action = 0xdeadbee;
4648 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4650 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4651 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4653 state = 0xdeadbee;
4654 action = 0xdeadbee;
4655 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4657 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4658 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4660 state = 0xdeadbee;
4661 action = 0xdeadbee;
4662 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4664 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4665 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4667 state = 0xdeadbee;
4668 action = 0xdeadbee;
4669 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4671 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4672 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4674 state = 0xdeadbee;
4675 action = 0xdeadbee;
4676 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4678 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4679 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4681 state = 0xdeadbee;
4682 action = 0xdeadbee;
4683 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4685 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4688 state = 0xdeadbee;
4689 action = 0xdeadbee;
4690 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4692 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4695 r = MsiDoAction( hpkg, "FileCost");
4696 ok( r == ERROR_SUCCESS, "file cost failed\n");
4698 state = 0xdeadbee;
4699 action = 0xdeadbee;
4700 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4702 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4703 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4705 state = 0xdeadbee;
4706 action = 0xdeadbee;
4707 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4709 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4710 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4712 state = 0xdeadbee;
4713 action = 0xdeadbee;
4714 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4716 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4717 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4719 state = 0xdeadbee;
4720 action = 0xdeadbee;
4721 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4723 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4724 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4726 state = 0xdeadbee;
4727 action = 0xdeadbee;
4728 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4730 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4731 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4733 state = 0xdeadbee;
4734 action = 0xdeadbee;
4735 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4737 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4738 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4740 state = 0xdeadbee;
4741 action = 0xdeadbee;
4742 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4744 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4745 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4747 state = 0xdeadbee;
4748 action = 0xdeadbee;
4749 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4751 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4752 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4754 state = 0xdeadbee;
4755 action = 0xdeadbee;
4756 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4758 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4759 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4761 state = 0xdeadbee;
4762 action = 0xdeadbee;
4763 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4764 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4765 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4766 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4768 state = 0xdeadbee;
4769 action = 0xdeadbee;
4770 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4771 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4772 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4773 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4775 state = 0xdeadbee;
4776 action = 0xdeadbee;
4777 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4778 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4779 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4780 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4782 state = 0xdeadbee;
4783 action = 0xdeadbee;
4784 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4786 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4787 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4789 state = 0xdeadbee;
4790 action = 0xdeadbee;
4791 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4792 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4793 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4794 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4796 state = 0xdeadbee;
4797 action = 0xdeadbee;
4798 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4800 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4801 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4803 state = 0xdeadbee;
4804 action = 0xdeadbee;
4805 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4807 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4808 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4810 state = 0xdeadbee;
4811 action = 0xdeadbee;
4812 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4814 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4815 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4817 state = 0xdeadbee;
4818 action = 0xdeadbee;
4819 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4821 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4822 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4824 state = 0xdeadbee;
4825 action = 0xdeadbee;
4826 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4828 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4829 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4831 state = 0xdeadbee;
4832 action = 0xdeadbee;
4833 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4835 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4836 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4838 state = 0xdeadbee;
4839 action = 0xdeadbee;
4840 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4842 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4843 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4845 state = 0xdeadbee;
4846 action = 0xdeadbee;
4847 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4849 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4850 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4852 state = 0xdeadbee;
4853 action = 0xdeadbee;
4854 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4856 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4857 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4859 state = 0xdeadbee;
4860 action = 0xdeadbee;
4861 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4863 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4864 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4866 state = 0xdeadbee;
4867 action = 0xdeadbee;
4868 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4870 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4871 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4873 state = 0xdeadbee;
4874 action = 0xdeadbee;
4875 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4877 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4878 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4880 state = 0xdeadbee;
4881 action = 0xdeadbee;
4882 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4883 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4884 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4885 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4887 state = 0xdeadbee;
4888 action = 0xdeadbee;
4889 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4891 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4892 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4894 state = 0xdeadbee;
4895 action = 0xdeadbee;
4896 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4898 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4899 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4901 r = MsiDoAction( hpkg, "CostFinalize");
4902 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4904 state = 0xdeadbee;
4905 action = 0xdeadbee;
4906 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4907 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4908 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4909 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4911 state = 0xdeadbee;
4912 action = 0xdeadbee;
4913 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4914 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4915 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4916 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4918 state = 0xdeadbee;
4919 action = 0xdeadbee;
4920 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4921 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4922 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4923 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4925 state = 0xdeadbee;
4926 action = 0xdeadbee;
4927 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4928 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4929 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4930 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4932 state = 0xdeadbee;
4933 action = 0xdeadbee;
4934 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4935 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4936 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4937 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4939 state = 0xdeadbee;
4940 action = 0xdeadbee;
4941 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4942 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4943 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4944 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4946 state = 0xdeadbee;
4947 action = 0xdeadbee;
4948 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4949 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4950 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4951 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4953 state = 0xdeadbee;
4954 action = 0xdeadbee;
4955 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4956 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4957 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4958 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4960 state = 0xdeadbee;
4961 action = 0xdeadbee;
4962 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4963 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4964 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4965 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4967 state = 0xdeadbee;
4968 action = 0xdeadbee;
4969 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4970 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4971 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4972 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4974 state = 0xdeadbee;
4975 action = 0xdeadbee;
4976 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4977 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4978 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4979 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4981 state = 0xdeadbee;
4982 action = 0xdeadbee;
4983 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4984 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4985 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4986 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4988 state = 0xdeadbee;
4989 action = 0xdeadbee;
4990 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4991 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4992 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4993 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4995 state = 0xdeadbee;
4996 action = 0xdeadbee;
4997 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4998 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4999 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5000 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5002 state = 0xdeadbee;
5003 action = 0xdeadbee;
5004 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5005 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5006 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5007 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5009 state = 0xdeadbee;
5010 action = 0xdeadbee;
5011 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5012 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5013 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5014 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5016 state = 0xdeadbee;
5017 action = 0xdeadbee;
5018 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5019 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5020 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5021 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5023 state = 0xdeadbee;
5024 action = 0xdeadbee;
5025 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5026 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5027 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5028 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5030 state = 0xdeadbee;
5031 action = 0xdeadbee;
5032 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5033 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5034 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5035 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5037 state = 0xdeadbee;
5038 action = 0xdeadbee;
5039 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5040 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5041 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5042 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5044 state = 0xdeadbee;
5045 action = 0xdeadbee;
5046 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5047 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5048 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5049 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5051 state = 0xdeadbee;
5052 action = 0xdeadbee;
5053 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5054 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5055 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5056 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5058 state = 0xdeadbee;
5059 action = 0xdeadbee;
5060 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5061 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5062 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5063 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5065 state = 0xdeadbee;
5066 action = 0xdeadbee;
5067 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5068 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5069 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5070 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5072 state = 0xdeadbee;
5073 action = 0xdeadbee;
5074 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5075 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5076 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5077 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5079 state = 0xdeadbee;
5080 action = 0xdeadbee;
5081 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5082 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5083 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5084 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5086 state = 0xdeadbee;
5087 action = 0xdeadbee;
5088 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5090 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5091 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5093 state = 0xdeadbee;
5094 action = 0xdeadbee;
5095 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5097 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5098 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5100 state = 0xdeadbee;
5101 action = 0xdeadbee;
5102 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5103 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5104 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5105 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5107 MsiCloseHandle(hpkg);
5109 /* uninstall the product */
5110 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5113 /* all features installed from source */
5114 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5117 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5118 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5120 /* this property must not be in the saved msi file */
5121 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine'");
5122 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5124 hpkg = package_from_db( hdb );
5125 ok( hpkg, "failed to create package\n");
5127 state = 0xdeadbee;
5128 action = 0xdeadbee;
5129 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5130 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5131 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5132 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5134 state = 0xdeadbee;
5135 action = 0xdeadbee;
5136 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5137 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5138 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5139 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5141 state = 0xdeadbee;
5142 action = 0xdeadbee;
5143 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5144 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5145 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5146 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5148 state = 0xdeadbee;
5149 action = 0xdeadbee;
5150 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5151 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5152 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5153 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5155 state = 0xdeadbee;
5156 action = 0xdeadbee;
5157 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5158 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5159 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5160 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5162 state = 0xdeadbee;
5163 action = 0xdeadbee;
5164 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5165 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5166 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5167 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5169 state = 0xdeadbee;
5170 action = 0xdeadbee;
5171 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5172 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5173 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5174 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5176 state = 0xdeadbee;
5177 action = 0xdeadbee;
5178 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5179 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5180 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5181 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5183 state = 0xdeadbee;
5184 action = 0xdeadbee;
5185 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5186 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5187 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5188 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5190 state = 0xdeadbee;
5191 action = 0xdeadbee;
5192 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5193 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5194 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5195 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5197 state = 0xdeadbee;
5198 action = 0xdeadbee;
5199 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5200 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5201 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5202 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5204 state = 0xdeadbee;
5205 action = 0xdeadbee;
5206 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5207 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5208 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5209 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5211 state = 0xdeadbee;
5212 action = 0xdeadbee;
5213 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5214 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5215 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5216 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5218 state = 0xdeadbee;
5219 action = 0xdeadbee;
5220 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5221 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5222 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5223 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5225 state = 0xdeadbee;
5226 action = 0xdeadbee;
5227 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5228 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5229 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5230 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5232 state = 0xdeadbee;
5233 action = 0xdeadbee;
5234 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5235 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5236 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5237 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5239 state = 0xdeadbee;
5240 action = 0xdeadbee;
5241 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5242 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5243 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5244 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5246 state = 0xdeadbee;
5247 action = 0xdeadbee;
5248 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5249 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5250 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5251 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5253 state = 0xdeadbee;
5254 action = 0xdeadbee;
5255 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5256 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5257 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5258 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5260 state = 0xdeadbee;
5261 action = 0xdeadbee;
5262 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5263 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5264 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5265 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5267 state = 0xdeadbee;
5268 action = 0xdeadbee;
5269 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5270 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5271 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5272 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5274 state = 0xdeadbee;
5275 action = 0xdeadbee;
5276 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5277 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5278 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5279 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5281 state = 0xdeadbee;
5282 action = 0xdeadbee;
5283 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5284 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5285 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5286 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5288 state = 0xdeadbee;
5289 action = 0xdeadbee;
5290 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5291 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5292 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5293 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5295 state = 0xdeadbee;
5296 action = 0xdeadbee;
5297 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5298 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5299 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5300 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5302 state = 0xdeadbee;
5303 action = 0xdeadbee;
5304 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5305 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5306 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5307 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5309 state = 0xdeadbee;
5310 action = 0xdeadbee;
5311 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5312 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5313 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5314 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5316 state = 0xdeadbee;
5317 action = 0xdeadbee;
5318 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5319 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5320 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5321 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5323 state = 0xdeadbee;
5324 action = 0xdeadbee;
5325 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5326 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5327 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5328 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5330 r = MsiDoAction( hpkg, "CostInitialize");
5331 ok( r == ERROR_SUCCESS, "cost init failed\n");
5333 state = 0xdeadbee;
5334 action = 0xdeadbee;
5335 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5337 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5340 state = 0xdeadbee;
5341 action = 0xdeadbee;
5342 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5344 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5345 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5347 state = 0xdeadbee;
5348 action = 0xdeadbee;
5349 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5351 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5352 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5354 state = 0xdeadbee;
5355 action = 0xdeadbee;
5356 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5358 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5359 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5361 state = 0xdeadbee;
5362 action = 0xdeadbee;
5363 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5368 state = 0xdeadbee;
5369 action = 0xdeadbee;
5370 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5375 state = 0xdeadbee;
5376 action = 0xdeadbee;
5377 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5382 state = 0xdeadbee;
5383 action = 0xdeadbee;
5384 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5389 state = 0xdeadbee;
5390 action = 0xdeadbee;
5391 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5396 state = 0xdeadbee;
5397 action = 0xdeadbee;
5398 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5403 state = 0xdeadbee;
5404 action = 0xdeadbee;
5405 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5410 state = 0xdeadbee;
5411 action = 0xdeadbee;
5412 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5414 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5417 state = 0xdeadbee;
5418 action = 0xdeadbee;
5419 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5421 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5424 state = 0xdeadbee;
5425 action = 0xdeadbee;
5426 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5428 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5431 state = 0xdeadbee;
5432 action = 0xdeadbee;
5433 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5435 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5438 state = 0xdeadbee;
5439 action = 0xdeadbee;
5440 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5442 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5445 state = 0xdeadbee;
5446 action = 0xdeadbee;
5447 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5449 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5452 state = 0xdeadbee;
5453 action = 0xdeadbee;
5454 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5456 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5459 state = 0xdeadbee;
5460 action = 0xdeadbee;
5461 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5463 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5466 state = 0xdeadbee;
5467 action = 0xdeadbee;
5468 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5470 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5473 state = 0xdeadbee;
5474 action = 0xdeadbee;
5475 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5477 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5478 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5480 state = 0xdeadbee;
5481 action = 0xdeadbee;
5482 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5484 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5485 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5487 state = 0xdeadbee;
5488 action = 0xdeadbee;
5489 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5491 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5492 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5494 state = 0xdeadbee;
5495 action = 0xdeadbee;
5496 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5498 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5499 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5501 state = 0xdeadbee;
5502 action = 0xdeadbee;
5503 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5505 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5506 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5508 state = 0xdeadbee;
5509 action = 0xdeadbee;
5510 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5512 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5515 state = 0xdeadbee;
5516 action = 0xdeadbee;
5517 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5519 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5522 state = 0xdeadbee;
5523 action = 0xdeadbee;
5524 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5526 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5527 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5529 state = 0xdeadbee;
5530 action = 0xdeadbee;
5531 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5533 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5534 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5536 r = MsiDoAction( hpkg, "FileCost");
5537 ok( r == ERROR_SUCCESS, "file cost failed\n");
5539 state = 0xdeadbee;
5540 action = 0xdeadbee;
5541 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5542 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5543 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5544 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5546 state = 0xdeadbee;
5547 action = 0xdeadbee;
5548 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5549 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5550 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5551 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5553 state = 0xdeadbee;
5554 action = 0xdeadbee;
5555 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5556 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5557 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5558 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5560 state = 0xdeadbee;
5561 action = 0xdeadbee;
5562 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5563 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5564 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5565 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5567 state = 0xdeadbee;
5568 action = 0xdeadbee;
5569 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5570 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5571 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5572 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5574 state = 0xdeadbee;
5575 action = 0xdeadbee;
5576 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5577 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5578 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5579 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5581 state = 0xdeadbee;
5582 action = 0xdeadbee;
5583 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5584 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5585 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5586 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5588 state = 0xdeadbee;
5589 action = 0xdeadbee;
5590 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5592 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5593 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5595 state = 0xdeadbee;
5596 action = 0xdeadbee;
5597 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5599 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5600 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5602 state = 0xdeadbee;
5603 action = 0xdeadbee;
5604 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5606 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5607 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5609 state = 0xdeadbee;
5610 action = 0xdeadbee;
5611 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5613 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5614 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5616 state = 0xdeadbee;
5617 action = 0xdeadbee;
5618 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5620 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5621 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5623 state = 0xdeadbee;
5624 action = 0xdeadbee;
5625 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5627 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5628 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5630 state = 0xdeadbee;
5631 action = 0xdeadbee;
5632 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5634 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5635 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5637 state = 0xdeadbee;
5638 action = 0xdeadbee;
5639 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5641 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5642 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5644 state = 0xdeadbee;
5645 action = 0xdeadbee;
5646 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5647 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5648 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5649 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5651 state = 0xdeadbee;
5652 action = 0xdeadbee;
5653 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5655 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5656 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5658 state = 0xdeadbee;
5659 action = 0xdeadbee;
5660 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5662 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5663 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5665 state = 0xdeadbee;
5666 action = 0xdeadbee;
5667 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5669 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5670 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5672 state = 0xdeadbee;
5673 action = 0xdeadbee;
5674 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5676 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5677 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5679 state = 0xdeadbee;
5680 action = 0xdeadbee;
5681 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5683 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5684 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5686 state = 0xdeadbee;
5687 action = 0xdeadbee;
5688 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5690 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5691 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5693 state = 0xdeadbee;
5694 action = 0xdeadbee;
5695 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5697 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5698 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5700 state = 0xdeadbee;
5701 action = 0xdeadbee;
5702 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5704 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5705 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5707 state = 0xdeadbee;
5708 action = 0xdeadbee;
5709 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5711 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5712 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5714 state = 0xdeadbee;
5715 action = 0xdeadbee;
5716 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5717 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5718 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5719 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5721 state = 0xdeadbee;
5722 action = 0xdeadbee;
5723 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5724 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5725 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5726 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5728 state = 0xdeadbee;
5729 action = 0xdeadbee;
5730 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5732 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5733 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5735 state = 0xdeadbee;
5736 action = 0xdeadbee;
5737 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5738 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5739 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5740 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5742 r = MsiDoAction( hpkg, "CostFinalize");
5743 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5745 state = 0xdeadbee;
5746 action = 0xdeadbee;
5747 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5748 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5749 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5750 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5752 state = 0xdeadbee;
5753 action = 0xdeadbee;
5754 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5755 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5756 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5757 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5759 state = 0xdeadbee;
5760 action = 0xdeadbee;
5761 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5763 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5764 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5766 state = 0xdeadbee;
5767 action = 0xdeadbee;
5768 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5770 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5771 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5773 state = 0xdeadbee;
5774 action = 0xdeadbee;
5775 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5777 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5778 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5780 state = 0xdeadbee;
5781 action = 0xdeadbee;
5782 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5784 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5785 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5787 state = 0xdeadbee;
5788 action = 0xdeadbee;
5789 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5791 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5792 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5794 state = 0xdeadbee;
5795 action = 0xdeadbee;
5796 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5798 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5799 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5801 state = 0xdeadbee;
5802 action = 0xdeadbee;
5803 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5805 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5806 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5808 state = 0xdeadbee;
5809 action = 0xdeadbee;
5810 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5811 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5812 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5813 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5815 state = 0xdeadbee;
5816 action = 0xdeadbee;
5817 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5818 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5819 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5820 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5822 state = 0xdeadbee;
5823 action = 0xdeadbee;
5824 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5825 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5826 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5827 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5829 state = 0xdeadbee;
5830 action = 0xdeadbee;
5831 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5832 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5833 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5834 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5836 state = 0xdeadbee;
5837 action = 0xdeadbee;
5838 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5839 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5840 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5841 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5843 state = 0xdeadbee;
5844 action = 0xdeadbee;
5845 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5846 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5847 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5848 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5850 state = 0xdeadbee;
5851 action = 0xdeadbee;
5852 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5853 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5854 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5855 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5857 state = 0xdeadbee;
5858 action = 0xdeadbee;
5859 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5860 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5861 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5862 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5864 state = 0xdeadbee;
5865 action = 0xdeadbee;
5866 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5868 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5869 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5871 state = 0xdeadbee;
5872 action = 0xdeadbee;
5873 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5874 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5875 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5876 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5878 state = 0xdeadbee;
5879 action = 0xdeadbee;
5880 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5881 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5882 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5883 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5885 state = 0xdeadbee;
5886 action = 0xdeadbee;
5887 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5888 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5889 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5890 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5892 state = 0xdeadbee;
5893 action = 0xdeadbee;
5894 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5895 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5896 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5897 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5899 state = 0xdeadbee;
5900 action = 0xdeadbee;
5901 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5903 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5904 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5906 state = 0xdeadbee;
5907 action = 0xdeadbee;
5908 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5910 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5911 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5913 state = 0xdeadbee;
5914 action = 0xdeadbee;
5915 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5917 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5920 state = 0xdeadbee;
5921 action = 0xdeadbee;
5922 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5924 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5925 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5927 state = 0xdeadbee;
5928 action = 0xdeadbee;
5929 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5930 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5931 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5932 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5934 state = 0xdeadbee;
5935 action = 0xdeadbee;
5936 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5937 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5938 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5939 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5941 state = 0xdeadbee;
5942 action = 0xdeadbee;
5943 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5945 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5946 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5948 MsiCloseHandle(hpkg);
5950 /* reinstall the product */
5951 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
5952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5954 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
5955 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5957 /* this property must not be in the saved msi file */
5958 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine'");
5959 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5961 hpkg = package_from_db( hdb );
5962 ok( hpkg, "failed to create package\n");
5964 state = 0xdeadbee;
5965 action = 0xdeadbee;
5966 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5967 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5968 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5969 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5971 state = 0xdeadbee;
5972 action = 0xdeadbee;
5973 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5974 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5975 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5976 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5978 state = 0xdeadbee;
5979 action = 0xdeadbee;
5980 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5981 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5982 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5983 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5985 state = 0xdeadbee;
5986 action = 0xdeadbee;
5987 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5988 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5989 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5990 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5992 state = 0xdeadbee;
5993 action = 0xdeadbee;
5994 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5995 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5996 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5997 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5999 state = 0xdeadbee;
6000 action = 0xdeadbee;
6001 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6002 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6003 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6004 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6006 state = 0xdeadbee;
6007 action = 0xdeadbee;
6008 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6009 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6010 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6011 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6013 state = 0xdeadbee;
6014 action = 0xdeadbee;
6015 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6016 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6017 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6018 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6020 state = 0xdeadbee;
6021 action = 0xdeadbee;
6022 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6023 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6024 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6025 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6027 state = 0xdeadbee;
6028 action = 0xdeadbee;
6029 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6030 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6031 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6032 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6034 state = 0xdeadbee;
6035 action = 0xdeadbee;
6036 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6037 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6038 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6039 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6041 state = 0xdeadbee;
6042 action = 0xdeadbee;
6043 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6044 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6045 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6046 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6048 state = 0xdeadbee;
6049 action = 0xdeadbee;
6050 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6051 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6052 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6053 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6055 state = 0xdeadbee;
6056 action = 0xdeadbee;
6057 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6058 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6059 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6060 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6062 state = 0xdeadbee;
6063 action = 0xdeadbee;
6064 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6065 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6066 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6067 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6069 state = 0xdeadbee;
6070 action = 0xdeadbee;
6071 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6072 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6073 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6074 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6076 state = 0xdeadbee;
6077 action = 0xdeadbee;
6078 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6079 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6080 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6081 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6083 state = 0xdeadbee;
6084 action = 0xdeadbee;
6085 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6086 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6087 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6088 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6090 state = 0xdeadbee;
6091 action = 0xdeadbee;
6092 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6093 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6094 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6095 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6097 state = 0xdeadbee;
6098 action = 0xdeadbee;
6099 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6100 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6101 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6102 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6104 state = 0xdeadbee;
6105 action = 0xdeadbee;
6106 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6107 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6108 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6109 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6111 state = 0xdeadbee;
6112 action = 0xdeadbee;
6113 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6114 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6115 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6116 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6118 state = 0xdeadbee;
6119 action = 0xdeadbee;
6120 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6121 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6122 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6123 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6125 state = 0xdeadbee;
6126 action = 0xdeadbee;
6127 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6128 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6129 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6130 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6132 state = 0xdeadbee;
6133 action = 0xdeadbee;
6134 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6135 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6136 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6137 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6139 state = 0xdeadbee;
6140 action = 0xdeadbee;
6141 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6142 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6143 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6144 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6146 state = 0xdeadbee;
6147 action = 0xdeadbee;
6148 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6149 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6150 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6151 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6153 state = 0xdeadbee;
6154 action = 0xdeadbee;
6155 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6156 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6157 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6158 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6160 state = 0xdeadbee;
6161 action = 0xdeadbee;
6162 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6163 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6164 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6165 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6167 r = MsiDoAction( hpkg, "CostInitialize");
6168 ok( r == ERROR_SUCCESS, "cost init failed\n");
6170 state = 0xdeadbee;
6171 action = 0xdeadbee;
6172 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6173 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6174 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6175 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6177 state = 0xdeadbee;
6178 action = 0xdeadbee;
6179 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6180 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6181 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6182 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6184 state = 0xdeadbee;
6185 action = 0xdeadbee;
6186 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6187 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6188 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6189 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6191 state = 0xdeadbee;
6192 action = 0xdeadbee;
6193 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6194 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6195 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6196 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6198 state = 0xdeadbee;
6199 action = 0xdeadbee;
6200 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6201 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6202 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6203 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6205 state = 0xdeadbee;
6206 action = 0xdeadbee;
6207 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6208 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6209 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6210 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6212 state = 0xdeadbee;
6213 action = 0xdeadbee;
6214 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6215 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6216 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6217 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6219 state = 0xdeadbee;
6220 action = 0xdeadbee;
6221 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6222 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6223 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6224 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6226 state = 0xdeadbee;
6227 action = 0xdeadbee;
6228 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6229 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6230 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6231 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6233 state = 0xdeadbee;
6234 action = 0xdeadbee;
6235 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6236 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6237 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6238 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6240 state = 0xdeadbee;
6241 action = 0xdeadbee;
6242 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6243 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6244 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6245 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6247 state = 0xdeadbee;
6248 action = 0xdeadbee;
6249 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6250 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6251 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6252 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6254 state = 0xdeadbee;
6255 action = 0xdeadbee;
6256 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6257 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6258 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6259 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6261 state = 0xdeadbee;
6262 action = 0xdeadbee;
6263 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6264 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6265 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6266 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6268 state = 0xdeadbee;
6269 action = 0xdeadbee;
6270 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6271 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6272 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6273 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6275 state = 0xdeadbee;
6276 action = 0xdeadbee;
6277 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6278 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6279 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6280 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6282 state = 0xdeadbee;
6283 action = 0xdeadbee;
6284 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6285 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6286 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6287 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6289 state = 0xdeadbee;
6290 action = 0xdeadbee;
6291 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6292 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6293 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6294 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6296 state = 0xdeadbee;
6297 action = 0xdeadbee;
6298 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6299 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6300 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6301 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6303 state = 0xdeadbee;
6304 action = 0xdeadbee;
6305 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6306 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6307 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6310 state = 0xdeadbee;
6311 action = 0xdeadbee;
6312 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6313 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6314 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6315 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6317 state = 0xdeadbee;
6318 action = 0xdeadbee;
6319 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6320 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6321 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6322 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6324 state = 0xdeadbee;
6325 action = 0xdeadbee;
6326 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6328 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6329 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6331 state = 0xdeadbee;
6332 action = 0xdeadbee;
6333 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6334 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6335 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6336 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6338 state = 0xdeadbee;
6339 action = 0xdeadbee;
6340 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6341 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6342 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6343 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6345 state = 0xdeadbee;
6346 action = 0xdeadbee;
6347 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6349 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6350 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6352 state = 0xdeadbee;
6353 action = 0xdeadbee;
6354 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6359 state = 0xdeadbee;
6360 action = 0xdeadbee;
6361 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6366 state = 0xdeadbee;
6367 action = 0xdeadbee;
6368 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6370 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6373 r = MsiDoAction( hpkg, "FileCost");
6374 ok( r == ERROR_SUCCESS, "file cost failed\n");
6376 state = 0xdeadbee;
6377 action = 0xdeadbee;
6378 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6379 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6380 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6381 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6383 state = 0xdeadbee;
6384 action = 0xdeadbee;
6385 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6386 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6387 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6388 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6390 state = 0xdeadbee;
6391 action = 0xdeadbee;
6392 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6393 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6394 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6395 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6397 state = 0xdeadbee;
6398 action = 0xdeadbee;
6399 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6400 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6401 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6402 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6404 state = 0xdeadbee;
6405 action = 0xdeadbee;
6406 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6408 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6409 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6411 state = 0xdeadbee;
6412 action = 0xdeadbee;
6413 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6415 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6416 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6418 state = 0xdeadbee;
6419 action = 0xdeadbee;
6420 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6422 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6423 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6425 state = 0xdeadbee;
6426 action = 0xdeadbee;
6427 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6429 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6430 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6432 state = 0xdeadbee;
6433 action = 0xdeadbee;
6434 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6436 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6437 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6439 state = 0xdeadbee;
6440 action = 0xdeadbee;
6441 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6443 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6444 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6446 state = 0xdeadbee;
6447 action = 0xdeadbee;
6448 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6450 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6451 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6453 state = 0xdeadbee;
6454 action = 0xdeadbee;
6455 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6457 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6458 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6460 state = 0xdeadbee;
6461 action = 0xdeadbee;
6462 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6464 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6465 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6467 state = 0xdeadbee;
6468 action = 0xdeadbee;
6469 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6471 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6472 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6474 state = 0xdeadbee;
6475 action = 0xdeadbee;
6476 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6478 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6479 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6481 state = 0xdeadbee;
6482 action = 0xdeadbee;
6483 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6485 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6486 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6488 state = 0xdeadbee;
6489 action = 0xdeadbee;
6490 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6492 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6493 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6495 state = 0xdeadbee;
6496 action = 0xdeadbee;
6497 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6499 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6500 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6502 state = 0xdeadbee;
6503 action = 0xdeadbee;
6504 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6506 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6507 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6509 state = 0xdeadbee;
6510 action = 0xdeadbee;
6511 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6513 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6514 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6516 state = 0xdeadbee;
6517 action = 0xdeadbee;
6518 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6520 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6521 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6523 state = 0xdeadbee;
6524 action = 0xdeadbee;
6525 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6527 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6530 state = 0xdeadbee;
6531 action = 0xdeadbee;
6532 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6534 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6535 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6537 state = 0xdeadbee;
6538 action = 0xdeadbee;
6539 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6541 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6542 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6544 state = 0xdeadbee;
6545 action = 0xdeadbee;
6546 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6548 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6549 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6551 state = 0xdeadbee;
6552 action = 0xdeadbee;
6553 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6555 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6558 state = 0xdeadbee;
6559 action = 0xdeadbee;
6560 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6562 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6563 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6565 state = 0xdeadbee;
6566 action = 0xdeadbee;
6567 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6569 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6570 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6572 state = 0xdeadbee;
6573 action = 0xdeadbee;
6574 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6576 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6577 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6579 r = MsiDoAction( hpkg, "CostFinalize");
6580 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6582 state = 0xdeadbee;
6583 action = 0xdeadbee;
6584 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6585 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6586 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6587 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6589 state = 0xdeadbee;
6590 action = 0xdeadbee;
6591 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6593 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6594 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6596 state = 0xdeadbee;
6597 action = 0xdeadbee;
6598 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6599 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6600 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6601 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6603 state = 0xdeadbee;
6604 action = 0xdeadbee;
6605 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6606 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6607 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6608 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6610 state = 0xdeadbee;
6611 action = 0xdeadbee;
6612 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6614 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6615 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6617 state = 0xdeadbee;
6618 action = 0xdeadbee;
6619 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6621 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6622 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6624 state = 0xdeadbee;
6625 action = 0xdeadbee;
6626 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6627 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6628 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6629 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6631 state = 0xdeadbee;
6632 action = 0xdeadbee;
6633 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6634 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6635 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6636 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6638 state = 0xdeadbee;
6639 action = 0xdeadbee;
6640 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6642 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6643 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6645 state = 0xdeadbee;
6646 action = 0xdeadbee;
6647 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6649 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6650 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6652 state = 0xdeadbee;
6653 action = 0xdeadbee;
6654 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6655 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6656 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6657 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6659 state = 0xdeadbee;
6660 action = 0xdeadbee;
6661 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6663 todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6664 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6666 state = 0xdeadbee;
6667 action = 0xdeadbee;
6668 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6669 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6670 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6671 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6673 state = 0xdeadbee;
6674 action = 0xdeadbee;
6675 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6676 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6677 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6678 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6680 state = 0xdeadbee;
6681 action = 0xdeadbee;
6682 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6683 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6684 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6685 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6687 state = 0xdeadbee;
6688 action = 0xdeadbee;
6689 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6690 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6691 todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6692 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6694 state = 0xdeadbee;
6695 action = 0xdeadbee;
6696 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6697 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6698 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6699 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6701 state = 0xdeadbee;
6702 action = 0xdeadbee;
6703 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6704 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6705 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6706 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6708 state = 0xdeadbee;
6709 action = 0xdeadbee;
6710 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6711 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6712 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6713 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6715 state = 0xdeadbee;
6716 action = 0xdeadbee;
6717 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6718 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6719 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6720 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6722 state = 0xdeadbee;
6723 action = 0xdeadbee;
6724 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6725 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6726 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6727 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6729 state = 0xdeadbee;
6730 action = 0xdeadbee;
6731 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6732 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6733 todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6734 todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6736 state = 0xdeadbee;
6737 action = 0xdeadbee;
6738 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6739 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6740 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6741 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6743 state = 0xdeadbee;
6744 action = 0xdeadbee;
6745 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6746 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6747 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6748 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6750 state = 0xdeadbee;
6751 action = 0xdeadbee;
6752 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6753 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6754 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6755 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6757 state = 0xdeadbee;
6758 action = 0xdeadbee;
6759 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6760 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6761 todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6762 todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6764 state = 0xdeadbee;
6765 action = 0xdeadbee;
6766 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6767 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6768 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6769 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6771 state = 0xdeadbee;
6772 action = 0xdeadbee;
6773 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6774 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6775 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6776 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6778 state = 0xdeadbee;
6779 action = 0xdeadbee;
6780 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6781 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6782 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6783 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6785 MsiCloseHandle(hpkg);
6787 /* uninstall the product */
6788 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
6789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6791 DeleteFileA(msifile);
6792 DeleteFileA(msifile2);
6793 DeleteFileA(msifile3);
6794 DeleteFileA(msifile4);
6797 static void test_getproperty(void)
6799 MSIHANDLE hPackage = 0;
6800 char prop[100];
6801 static CHAR empty[] = "";
6802 DWORD size;
6803 UINT r;
6805 hPackage = package_from_db(create_package_db());
6806 ok( hPackage != 0, " Failed to create package\n");
6808 /* set the property */
6809 r = MsiSetProperty(hPackage, "Name", "Value");
6810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6812 /* retrieve the size, NULL pointer */
6813 size = 0;
6814 r = MsiGetProperty(hPackage, "Name", NULL, &size);
6815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6816 ok( size == 5, "Expected 5, got %d\n", size);
6818 /* retrieve the size, empty string */
6819 size = 0;
6820 r = MsiGetProperty(hPackage, "Name", empty, &size);
6821 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
6822 ok( size == 5, "Expected 5, got %d\n", size);
6824 /* don't change size */
6825 r = MsiGetProperty(hPackage, "Name", prop, &size);
6826 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
6827 ok( size == 5, "Expected 5, got %d\n", size);
6828 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
6830 /* increase the size by 1 */
6831 size++;
6832 r = MsiGetProperty(hPackage, "Name", prop, &size);
6833 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6834 ok( size == 5, "Expected 5, got %d\n", size);
6835 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
6837 r = MsiCloseHandle( hPackage);
6838 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
6839 DeleteFile(msifile);
6842 static void test_removefiles(void)
6844 MSIHANDLE hpkg;
6845 UINT r;
6846 MSIHANDLE hdb;
6848 hdb = create_package_db();
6849 ok ( hdb, "failed to create package database\n" );
6851 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
6852 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
6854 r = create_feature_table( hdb );
6855 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
6857 r = create_component_table( hdb );
6858 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
6860 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
6861 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
6863 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
6864 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
6866 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
6867 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
6869 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
6870 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
6872 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
6873 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
6875 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
6876 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
6878 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
6879 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
6881 r = create_feature_components_table( hdb );
6882 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
6884 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
6885 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
6887 r = add_feature_components_entry( hdb, "'one', 'helium'" );
6888 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
6890 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
6891 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
6893 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
6894 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
6896 r = add_feature_components_entry( hdb, "'one', 'boron'" );
6897 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
6899 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
6900 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
6902 r = create_file_table( hdb );
6903 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
6905 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
6906 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
6908 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
6909 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
6911 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
6912 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
6914 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
6915 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
6917 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
6918 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
6920 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
6921 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
6923 r = create_remove_file_table( hdb );
6924 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
6926 hpkg = package_from_db( hdb );
6927 ok( hpkg, "failed to create package\n");
6929 MsiCloseHandle( hdb );
6931 create_test_file( "hydrogen.txt" );
6932 create_test_file( "helium.txt" );
6933 create_test_file( "lithium.txt" );
6934 create_test_file( "beryllium.txt" );
6935 create_test_file( "boron.txt" );
6936 create_test_file( "carbon.txt" );
6938 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
6939 ok( r == ERROR_SUCCESS, "set property failed\n");
6941 r = MsiDoAction( hpkg, "CostInitialize");
6942 ok( r == ERROR_SUCCESS, "cost init failed\n");
6944 r = MsiDoAction( hpkg, "FileCost");
6945 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
6947 r = MsiDoAction( hpkg, "CostFinalize");
6948 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
6950 r = MsiDoAction( hpkg, "InstallValidate");
6951 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
6953 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
6954 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
6956 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
6957 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
6959 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
6960 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
6962 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
6963 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
6965 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
6966 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
6968 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
6969 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
6971 r = MsiDoAction( hpkg, "RemoveFiles");
6972 ok( r == ERROR_SUCCESS, "remove files failed\n");
6974 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
6975 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
6976 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
6977 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
6978 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
6979 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
6981 MsiCloseHandle( hpkg );
6982 DeleteFileA(msifile);
6985 static void test_appsearch(void)
6987 MSIHANDLE hpkg;
6988 UINT r;
6989 MSIHANDLE hdb;
6990 CHAR prop[MAX_PATH];
6991 DWORD size = MAX_PATH;
6993 hdb = create_package_db();
6994 ok ( hdb, "failed to create package database\n" );
6996 r = create_appsearch_table( hdb );
6997 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
6999 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7000 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7002 r = create_reglocator_table( hdb );
7003 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7005 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7006 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7008 r = create_signature_table( hdb );
7009 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7011 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7012 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7014 hpkg = package_from_db( hdb );
7015 ok( hpkg, "failed to create package\n");
7017 MsiCloseHandle( hdb );
7019 r = MsiDoAction( hpkg, "AppSearch" );
7020 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7022 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7023 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7024 todo_wine
7026 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7029 MsiCloseHandle( hpkg );
7030 DeleteFileA(msifile);
7033 static void test_appsearch_complocator(void)
7035 MSIHANDLE hpkg, hdb;
7036 CHAR path[MAX_PATH];
7037 CHAR prop[MAX_PATH];
7038 LPSTR usersid;
7039 DWORD size;
7040 UINT r;
7042 get_user_sid(&usersid);
7043 if (!usersid)
7045 skip("ConvertSidToStringSidA is not available\n");
7046 return;
7049 create_test_file("FileName1");
7050 create_test_file("FileName4");
7051 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7052 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7054 create_test_file("FileName2");
7055 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7056 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7058 create_test_file("FileName3");
7059 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7060 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7062 create_test_file("FileName5");
7063 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7064 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7066 create_test_file("FileName6");
7067 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7068 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7070 create_test_file("FileName7");
7071 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7072 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7074 /* dir is FALSE, but we're pretending it's a directory */
7075 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7076 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7078 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7079 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7080 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7082 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7083 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7084 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7086 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7087 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7088 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7090 hdb = create_package_db();
7091 ok(hdb, "Expected a valid database handle\n");
7093 r = create_appsearch_table(hdb);
7094 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7096 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7099 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7100 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7102 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7105 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7108 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7111 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7114 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7117 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7120 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7123 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7124 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7126 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7129 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7132 r = create_complocator_table(hdb);
7133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7135 /* published component, machine, file, signature, misdbLocatorTypeFile */
7136 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7137 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7139 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7140 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7143 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7144 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7147 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7148 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7149 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7151 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7152 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7155 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7156 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7159 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7160 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7161 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7163 /* unpublished component, no signature, misdbLocatorTypeDir */
7164 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7167 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7168 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7171 /* published component, signature w/ ver, misdbLocatorTypeFile */
7172 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7173 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7175 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7176 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7179 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7180 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7183 r = create_signature_table(hdb);
7184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7186 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7187 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7189 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7192 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7195 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7198 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7201 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7204 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7207 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7210 hpkg = package_from_db(hdb);
7211 ok(hpkg, "Expected a valid package handle\n");
7213 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
7214 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7216 r = MsiDoAction(hpkg, "AppSearch");
7217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7219 size = MAX_PATH;
7220 sprintf(path, "%s\\FileName1", CURR_DIR);
7221 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7223 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7225 size = MAX_PATH;
7226 sprintf(path, "%s\\FileName2", CURR_DIR);
7227 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7228 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7229 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7231 size = MAX_PATH;
7232 sprintf(path, "%s\\FileName3", CURR_DIR);
7233 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7234 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7235 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7237 size = MAX_PATH;
7238 sprintf(path, "%s\\FileName4", CURR_DIR);
7239 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
7240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7241 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7243 size = MAX_PATH;
7244 sprintf(path, "%s\\FileName5", CURR_DIR);
7245 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7247 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7249 size = MAX_PATH;
7250 sprintf(path, "%s\\", CURR_DIR);
7251 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7253 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7255 size = MAX_PATH;
7256 sprintf(path, "%s\\", CURR_DIR);
7257 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7259 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7261 size = MAX_PATH;
7262 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7263 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7264 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
7266 size = MAX_PATH;
7267 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7268 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7269 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7271 size = MAX_PATH;
7272 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
7273 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7274 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7275 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7277 size = MAX_PATH;
7278 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7280 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7282 size = MAX_PATH;
7283 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
7284 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7286 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7288 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7289 MSIINSTALLCONTEXT_MACHINE, NULL);
7290 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7291 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
7292 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7293 MSIINSTALLCONTEXT_USERMANAGED, usersid);
7294 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7295 MSIINSTALLCONTEXT_MACHINE, NULL);
7296 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7297 MSIINSTALLCONTEXT_MACHINE, NULL);
7298 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7299 MSIINSTALLCONTEXT_MACHINE, NULL);
7300 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7301 MSIINSTALLCONTEXT_MACHINE, NULL);
7302 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7303 MSIINSTALLCONTEXT_MACHINE, NULL);
7304 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7305 MSIINSTALLCONTEXT_MACHINE, NULL);
7306 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7307 MSIINSTALLCONTEXT_MACHINE, NULL);
7309 DeleteFileA("FileName1");
7310 DeleteFileA("FileName2");
7311 DeleteFileA("FileName3");
7312 DeleteFileA("FileName4");
7313 DeleteFileA("FileName5");
7314 DeleteFileA("FileName6");
7315 DeleteFileA("FileName7");
7316 DeleteFileA("FileName8.dll");
7317 DeleteFileA("FileName9.dll");
7318 DeleteFileA("FileName10.dll");
7319 MsiCloseHandle(hpkg);
7320 DeleteFileA(msifile);
7323 static void test_appsearch_reglocator(void)
7325 MSIHANDLE hpkg, hdb;
7326 CHAR path[MAX_PATH];
7327 CHAR prop[MAX_PATH];
7328 DWORD binary[2];
7329 DWORD size, val;
7330 BOOL space, version;
7331 HKEY hklm, classes;
7332 HKEY hkcu, users;
7333 LPSTR pathdata;
7334 LPSTR pathvar;
7335 LPCSTR str;
7336 LPSTR ptr;
7337 LONG res;
7338 UINT r;
7340 version = TRUE;
7341 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7342 version = FALSE;
7344 DeleteFileA("test.dll");
7346 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
7347 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7349 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
7350 (const BYTE *)"regszdata", 10);
7351 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7353 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
7354 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7356 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
7357 (const BYTE *)"regszdata", 10);
7358 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7360 users = 0;
7361 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
7362 ok(res == ERROR_SUCCESS ||
7363 broken(res == ERROR_INVALID_PARAMETER),
7364 "Expected ERROR_SUCCESS, got %d\n", res);
7366 if (res == ERROR_SUCCESS)
7368 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
7369 (const BYTE *)"regszdata", 10);
7370 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7373 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
7374 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7376 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
7377 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7379 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
7380 (const BYTE *)"regszdata", 10);
7381 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7383 val = 42;
7384 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
7385 (const BYTE *)&val, sizeof(DWORD));
7386 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7388 val = -42;
7389 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
7390 (const BYTE *)&val, sizeof(DWORD));
7391 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7393 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
7394 (const BYTE *)"%PATH%", 7);
7395 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7397 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
7398 (const BYTE *)"my%NOVAR%", 10);
7399 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7401 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
7402 (const BYTE *)"one\0two\0", 9);
7403 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7405 binary[0] = 0x1234abcd;
7406 binary[1] = 0x567890ef;
7407 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
7408 (const BYTE *)binary, sizeof(binary));
7409 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7411 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
7412 (const BYTE *)"#regszdata", 11);
7413 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7415 create_test_file("FileName1");
7416 sprintf(path, "%s\\FileName1", CURR_DIR);
7417 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
7418 (const BYTE *)path, lstrlenA(path) + 1);
7419 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7421 sprintf(path, "%s\\FileName2", CURR_DIR);
7422 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
7423 (const BYTE *)path, lstrlenA(path) + 1);
7424 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7426 lstrcpyA(path, CURR_DIR);
7427 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
7428 (const BYTE *)path, lstrlenA(path) + 1);
7429 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7431 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
7432 (const BYTE *)"", 1);
7433 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7435 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7436 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7437 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
7438 (const BYTE *)path, lstrlenA(path) + 1);
7439 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7441 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7442 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
7443 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
7444 (const BYTE *)path, lstrlenA(path) + 1);
7445 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7447 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7448 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7449 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
7450 (const BYTE *)path, lstrlenA(path) + 1);
7451 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7453 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
7454 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
7455 (const BYTE *)path, lstrlenA(path) + 1);
7457 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
7458 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
7459 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
7460 (const BYTE *)path, lstrlenA(path) + 1);
7462 hdb = create_package_db();
7463 ok(hdb, "Expected a valid database handle\n");
7465 r = create_appsearch_table(hdb);
7466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7468 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7471 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7474 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7477 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7480 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7483 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7484 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7486 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7489 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7492 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7495 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
7496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7498 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
7499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7501 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
7502 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7504 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
7505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7507 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
7508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7510 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
7511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7513 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
7514 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7516 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
7517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7519 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
7520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7522 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
7523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7525 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
7526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7528 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
7529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7531 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
7532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7534 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
7535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7537 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
7538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7540 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
7541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7543 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
7544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7546 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
7547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7549 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
7550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7552 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
7553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7555 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
7556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7558 r = create_reglocator_table(hdb);
7559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7561 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7562 str = "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7563 r = add_reglocator_entry(hdb, str);
7564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7566 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7567 str = "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7568 r = add_reglocator_entry(hdb, str);
7569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7571 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7572 str = "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7573 r = add_reglocator_entry(hdb, str);
7574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7576 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7577 str = "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7578 r = add_reglocator_entry(hdb, str);
7579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7581 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7582 str = "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7583 r = add_reglocator_entry(hdb, str);
7584 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7586 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7587 str = "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7588 r = add_reglocator_entry(hdb, str);
7589 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7591 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7592 str = "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7593 r = add_reglocator_entry(hdb, str);
7594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7596 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7597 str = "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7598 r = add_reglocator_entry(hdb, str);
7599 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7601 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7602 str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7603 r = add_reglocator_entry(hdb, str);
7604 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7606 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7607 str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7608 r = add_reglocator_entry(hdb, str);
7609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7611 /* HKLM, msidbLocatorTypeFileName, no signature */
7612 str = "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7613 r = add_reglocator_entry(hdb, str);
7614 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7616 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7617 str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7618 r = add_reglocator_entry(hdb, str);
7619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7621 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7622 str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7623 r = add_reglocator_entry(hdb, str);
7624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7626 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
7627 str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
7628 r = add_reglocator_entry(hdb, str);
7629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7631 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
7632 str = "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
7633 r = add_reglocator_entry(hdb, str);
7634 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7636 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
7637 str = "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
7638 r = add_reglocator_entry(hdb, str);
7639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7641 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
7642 str = "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
7643 r = add_reglocator_entry(hdb, str);
7644 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7646 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
7647 str = "'NewSignature18', 2, 'Software\\Wine', '', 2";
7648 r = add_reglocator_entry(hdb, str);
7649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7651 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
7652 str = "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
7653 r = add_reglocator_entry(hdb, str);
7654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7656 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
7657 str = "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
7658 r = add_reglocator_entry(hdb, str);
7659 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7661 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
7662 str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
7663 r = add_reglocator_entry(hdb, str);
7664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7666 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
7667 str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
7668 r = add_reglocator_entry(hdb, str);
7669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7671 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
7672 str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
7673 r = add_reglocator_entry(hdb, str);
7674 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7676 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
7677 str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
7678 r = add_reglocator_entry(hdb, str);
7679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7681 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
7682 str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
7683 r = add_reglocator_entry(hdb, str);
7684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7686 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
7687 str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
7688 r = add_reglocator_entry(hdb, str);
7689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7691 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
7692 str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
7693 r = add_reglocator_entry(hdb, str);
7694 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7696 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
7697 str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
7698 r = add_reglocator_entry(hdb, str);
7699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7701 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
7702 str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
7703 r = add_reglocator_entry(hdb, str);
7704 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7706 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
7707 str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
7708 r = add_reglocator_entry(hdb, str);
7709 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7711 r = create_signature_table(hdb);
7712 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7714 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
7715 r = add_signature_entry(hdb, str);
7716 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7718 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
7719 r = add_signature_entry(hdb, str);
7720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7722 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
7723 r = add_signature_entry(hdb, str);
7724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7726 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7727 r = add_signature_entry(hdb, str);
7728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7730 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7731 r = add_signature_entry(hdb, str);
7732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7734 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7735 r = add_signature_entry(hdb, str);
7736 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7738 ptr = strrchr(CURR_DIR, '\\') + 1;
7739 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
7740 r = add_signature_entry(hdb, path);
7741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7743 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
7744 r = add_signature_entry(hdb, str);
7745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7747 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
7748 r = add_signature_entry(hdb, str);
7749 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7751 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
7752 r = add_signature_entry(hdb, str);
7753 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7755 hpkg = package_from_db(hdb);
7756 ok(hpkg, "Expected a valid package handle\n");
7758 r = MsiDoAction(hpkg, "AppSearch");
7759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7761 size = MAX_PATH;
7762 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
7763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7764 ok(!lstrcmpA(prop, "regszdata"),
7765 "Expected \"regszdata\", got \"%s\"\n", prop);
7767 size = MAX_PATH;
7768 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
7769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7770 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
7772 size = MAX_PATH;
7773 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
7774 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7775 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
7777 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
7778 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
7780 /* Workaround for Win95 */
7781 CHAR tempbuf[1];
7782 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
7784 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
7785 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
7787 size = 0;
7788 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
7789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7791 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
7792 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
7793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7794 ok(!lstrcmpA(pathdata, pathvar),
7795 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
7797 HeapFree(GetProcessHeap(), 0, pathvar);
7798 HeapFree(GetProcessHeap(), 0, pathdata);
7800 size = MAX_PATH;
7801 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
7802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7803 ok(!lstrcmpA(prop,
7804 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
7806 size = MAX_PATH;
7807 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
7808 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7809 todo_wine
7811 ok(!memcmp(prop, "\0one\0two\0\0", 10),
7812 "Expected \"\\0one\\0two\\0\\0\"\n");
7815 size = MAX_PATH;
7816 lstrcpyA(path, "#xCDAB3412EF907856");
7817 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
7818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7819 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7821 size = MAX_PATH;
7822 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
7823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7824 ok(!lstrcmpA(prop, "##regszdata"),
7825 "Expected \"##regszdata\", got \"%s\"\n", prop);
7827 size = MAX_PATH;
7828 sprintf(path, "%s\\FileName1", CURR_DIR);
7829 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
7830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7831 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7833 size = MAX_PATH;
7834 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
7835 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7836 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7838 size = MAX_PATH;
7839 sprintf(path, "%s\\", CURR_DIR);
7840 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
7841 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7842 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7844 size = MAX_PATH;
7845 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
7846 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7847 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7849 size = MAX_PATH;
7850 sprintf(path, "%s\\", CURR_DIR);
7851 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
7852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7853 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7855 size = MAX_PATH;
7856 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
7857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7858 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7860 size = MAX_PATH;
7861 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
7862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7863 ok(!lstrcmpA(prop, "regszdata"),
7864 "Expected \"regszdata\", got \"%s\"\n", prop);
7866 size = MAX_PATH;
7867 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
7868 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7869 ok(!lstrcmpA(prop, "regszdata"),
7870 "Expected \"regszdata\", got \"%s\"\n", prop);
7872 if (users)
7874 size = MAX_PATH;
7875 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
7876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7877 ok(!lstrcmpA(prop, "regszdata"),
7878 "Expected \"regszdata\", got \"%s\"\n", prop);
7881 size = MAX_PATH;
7882 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
7883 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7884 ok(!lstrcmpA(prop, "defvalue"),
7885 "Expected \"defvalue\", got \"%s\"\n", prop);
7887 size = MAX_PATH;
7888 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
7889 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7890 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7892 size = MAX_PATH;
7893 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
7894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7895 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7897 if (version)
7899 size = MAX_PATH;
7900 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
7901 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
7902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7903 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7905 size = MAX_PATH;
7906 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
7907 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7908 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7910 size = MAX_PATH;
7911 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
7912 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
7913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7914 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7917 size = MAX_PATH;
7918 lstrcpyA(path, CURR_DIR);
7919 ptr = strrchr(path, '\\') + 1;
7920 *ptr = '\0';
7921 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
7922 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7923 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7925 size = MAX_PATH;
7926 sprintf(path, "%s\\", CURR_DIR);
7927 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
7928 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7929 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7931 size = MAX_PATH;
7932 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
7933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7934 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7936 size = MAX_PATH;
7937 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
7938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7939 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7941 size = MAX_PATH;
7942 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
7943 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7944 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7946 size = MAX_PATH;
7947 sprintf(path, "%s\\FileName1", CURR_DIR);
7948 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
7949 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7950 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7952 size = MAX_PATH;
7953 sprintf(path, "%s\\FileName1", CURR_DIR);
7954 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
7955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7956 if (space)
7957 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
7958 else
7959 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
7961 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
7962 RegDeleteValueA(hklm, "Value1");
7963 RegDeleteValueA(hklm, "Value2");
7964 RegDeleteValueA(hklm, "Value3");
7965 RegDeleteValueA(hklm, "Value4");
7966 RegDeleteValueA(hklm, "Value5");
7967 RegDeleteValueA(hklm, "Value6");
7968 RegDeleteValueA(hklm, "Value7");
7969 RegDeleteValueA(hklm, "Value8");
7970 RegDeleteValueA(hklm, "Value9");
7971 RegDeleteValueA(hklm, "Value10");
7972 RegDeleteValueA(hklm, "Value11");
7973 RegDeleteValueA(hklm, "Value12");
7974 RegDeleteValueA(hklm, "Value13");
7975 RegDeleteValueA(hklm, "Value14");
7976 RegDeleteValueA(hklm, "Value15");
7977 RegDeleteValueA(hklm, "Value16");
7978 RegDeleteValueA(hklm, "Value17");
7979 RegDeleteKeyA(hklm, "");
7980 RegCloseKey(hklm);
7982 RegDeleteValueA(classes, "Value1");
7983 RegDeleteKeyA(classes, "");
7984 RegCloseKey(classes);
7986 RegDeleteValueA(hkcu, "Value1");
7987 RegDeleteKeyA(hkcu, "");
7988 RegCloseKey(hkcu);
7990 RegDeleteValueA(users, "Value1");
7991 RegDeleteKeyA(users, "");
7992 RegCloseKey(users);
7994 DeleteFileA("FileName1");
7995 DeleteFileA("FileName3.dll");
7996 DeleteFileA("FileName4.dll");
7997 DeleteFileA("FileName5.dll");
7998 MsiCloseHandle(hpkg);
7999 DeleteFileA(msifile);
8002 static void delete_win_ini(LPCSTR file)
8004 CHAR path[MAX_PATH];
8006 GetWindowsDirectoryA(path, MAX_PATH);
8007 lstrcatA(path, "\\");
8008 lstrcatA(path, file);
8010 DeleteFileA(path);
8013 static void test_appsearch_inilocator(void)
8015 MSIHANDLE hpkg, hdb;
8016 CHAR path[MAX_PATH];
8017 CHAR prop[MAX_PATH];
8018 BOOL version;
8019 LPCSTR str;
8020 LPSTR ptr;
8021 DWORD size;
8022 UINT r;
8024 version = TRUE;
8025 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8026 version = FALSE;
8028 DeleteFileA("test.dll");
8030 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8032 create_test_file("FileName1");
8033 sprintf(path, "%s\\FileName1", CURR_DIR);
8034 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8036 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8038 sprintf(path, "%s\\IDontExist", CURR_DIR);
8039 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8041 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8042 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8043 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8045 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8046 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8047 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8049 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8050 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8051 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8053 hdb = create_package_db();
8054 ok(hdb, "Expected a valid database handle\n");
8056 r = create_appsearch_table(hdb);
8057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8059 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8062 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8065 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8068 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8071 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8074 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8077 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8080 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8083 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8086 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8089 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8092 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8095 r = create_inilocator_table(hdb);
8096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8098 /* msidbLocatorTypeRawValue, field 1 */
8099 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8100 r = add_inilocator_entry(hdb, str);
8101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8103 /* msidbLocatorTypeRawValue, field 2 */
8104 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8105 r = add_inilocator_entry(hdb, str);
8106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8108 /* msidbLocatorTypeRawValue, entire field */
8109 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8110 r = add_inilocator_entry(hdb, str);
8111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8113 /* msidbLocatorTypeFile */
8114 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8115 r = add_inilocator_entry(hdb, str);
8116 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8118 /* msidbLocatorTypeDirectory, file */
8119 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8120 r = add_inilocator_entry(hdb, str);
8121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8123 /* msidbLocatorTypeDirectory, directory */
8124 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8125 r = add_inilocator_entry(hdb, str);
8126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8128 /* msidbLocatorTypeFile, file, no signature */
8129 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8130 r = add_inilocator_entry(hdb, str);
8131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8133 /* msidbLocatorTypeFile, dir, no signature */
8134 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8135 r = add_inilocator_entry(hdb, str);
8136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8138 /* msidbLocatorTypeFile, file does not exist */
8139 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8140 r = add_inilocator_entry(hdb, str);
8141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8143 /* msidbLocatorTypeFile, signature with version */
8144 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8145 r = add_inilocator_entry(hdb, str);
8146 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8148 /* msidbLocatorTypeFile, signature with version, ver > max */
8149 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8150 r = add_inilocator_entry(hdb, str);
8151 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8153 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8154 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8155 r = add_inilocator_entry(hdb, str);
8156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8158 r = create_signature_table(hdb);
8159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8161 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8164 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8167 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8170 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8173 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8176 hpkg = package_from_db(hdb);
8177 ok(hpkg, "Expected a valid package handle\n");
8179 r = MsiDoAction(hpkg, "AppSearch");
8180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8182 size = MAX_PATH;
8183 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8185 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
8187 size = MAX_PATH;
8188 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8190 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
8192 size = MAX_PATH;
8193 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8194 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8195 ok(!lstrcmpA(prop, "keydata,field2"),
8196 "Expected \"keydata,field2\", got \"%s\"\n", prop);
8198 size = MAX_PATH;
8199 sprintf(path, "%s\\FileName1", CURR_DIR);
8200 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8202 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8204 size = MAX_PATH;
8205 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8206 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8207 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8209 size = MAX_PATH;
8210 sprintf(path, "%s\\", CURR_DIR);
8211 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8213 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8215 size = MAX_PATH;
8216 sprintf(path, "%s\\", CURR_DIR);
8217 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8218 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8219 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8221 size = MAX_PATH;
8222 lstrcpyA(path, CURR_DIR);
8223 ptr = strrchr(path, '\\');
8224 *(ptr + 1) = '\0';
8225 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8226 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8227 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8229 size = MAX_PATH;
8230 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8232 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8234 if (version)
8236 size = MAX_PATH;
8237 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8238 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8239 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8240 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8242 size = MAX_PATH;
8243 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8245 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8247 size = MAX_PATH;
8248 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8249 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8251 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8254 delete_win_ini("IniFile.ini");
8255 DeleteFileA("FileName1");
8256 DeleteFileA("FileName2.dll");
8257 DeleteFileA("FileName3.dll");
8258 DeleteFileA("FileName4.dll");
8259 MsiCloseHandle(hpkg);
8260 DeleteFileA(msifile);
8263 static void test_appsearch_drlocator(void)
8265 MSIHANDLE hpkg, hdb;
8266 CHAR path[MAX_PATH];
8267 CHAR prop[MAX_PATH];
8268 BOOL version;
8269 LPCSTR str;
8270 DWORD size;
8271 UINT r;
8273 version = TRUE;
8274 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8275 version = FALSE;
8277 DeleteFileA("test.dll");
8279 create_test_file("FileName1");
8280 CreateDirectoryA("one", NULL);
8281 CreateDirectoryA("one\\two", NULL);
8282 CreateDirectoryA("one\\two\\three", NULL);
8283 create_test_file("one\\two\\three\\FileName2");
8284 CreateDirectoryA("another", NULL);
8285 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8286 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8287 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8289 hdb = create_package_db();
8290 ok(hdb, "Expected a valid database handle\n");
8292 r = create_appsearch_table(hdb);
8293 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8295 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8296 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8298 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8301 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8304 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8305 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8307 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8308 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8310 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8313 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8314 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8316 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8317 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8319 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8322 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8325 r = create_drlocator_table(hdb);
8326 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8328 /* no parent, full path, depth 0, signature */
8329 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
8330 r = add_drlocator_entry(hdb, path);
8331 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8333 /* no parent, full path, depth 0, no signature */
8334 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
8335 r = add_drlocator_entry(hdb, path);
8336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8338 /* no parent, relative path, depth 0, no signature */
8339 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
8340 r = add_drlocator_entry(hdb, path);
8341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8343 /* no parent, full path, depth 2, signature */
8344 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
8345 r = add_drlocator_entry(hdb, path);
8346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8348 /* no parent, full path, depth 3, signature */
8349 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
8350 r = add_drlocator_entry(hdb, path);
8351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8353 /* no parent, full path, depth 1, signature is dir */
8354 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
8355 r = add_drlocator_entry(hdb, path);
8356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8358 /* parent is in DrLocator, relative path, depth 0, signature */
8359 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8360 r = add_drlocator_entry(hdb, path);
8361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8363 /* no parent, full path, depth 0, signature w/ version */
8364 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
8365 r = add_drlocator_entry(hdb, path);
8366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8368 /* no parent, full path, depth 0, signature w/ version, ver > max */
8369 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
8370 r = add_drlocator_entry(hdb, path);
8371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8373 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8374 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
8375 r = add_drlocator_entry(hdb, path);
8376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8378 r = create_signature_table(hdb);
8379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8381 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8382 r = add_signature_entry(hdb, str);
8383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8385 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8386 r = add_signature_entry(hdb, str);
8387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8389 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8390 r = add_signature_entry(hdb, str);
8391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8393 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8394 r = add_signature_entry(hdb, str);
8395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8397 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8398 r = add_signature_entry(hdb, str);
8399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8401 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8402 r = add_signature_entry(hdb, str);
8403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8405 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8406 r = add_signature_entry(hdb, str);
8407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8409 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8410 r = add_signature_entry(hdb, str);
8411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8413 hpkg = package_from_db(hdb);
8414 ok(hpkg, "Expected a valid package handle\n");
8416 r = MsiDoAction(hpkg, "AppSearch");
8417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8419 size = MAX_PATH;
8420 sprintf(path, "%s\\FileName1", CURR_DIR);
8421 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8423 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8425 size = MAX_PATH;
8426 sprintf(path, "%s\\", CURR_DIR);
8427 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8429 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8431 size = MAX_PATH;
8432 sprintf(path, "%s\\", CURR_DIR);
8433 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8435 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8437 size = MAX_PATH;
8438 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8440 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8442 size = MAX_PATH;
8443 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8444 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8446 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8448 size = MAX_PATH;
8449 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8451 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8453 size = MAX_PATH;
8454 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
8455 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8457 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8459 if (version)
8461 size = MAX_PATH;
8462 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8463 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8467 size = MAX_PATH;
8468 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8470 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8472 size = MAX_PATH;
8473 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8475 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8478 DeleteFileA("FileName1");
8479 DeleteFileA("FileName3.dll");
8480 DeleteFileA("FileName4.dll");
8481 DeleteFileA("FileName5.dll");
8482 DeleteFileA("one\\two\\three\\FileName2");
8483 RemoveDirectoryA("one\\two\\three");
8484 RemoveDirectoryA("one\\two");
8485 RemoveDirectoryA("one");
8486 RemoveDirectoryA("another");
8487 MsiCloseHandle(hpkg);
8488 DeleteFileA(msifile);
8491 static void test_featureparents(void)
8493 MSIHANDLE hpkg;
8494 UINT r;
8495 MSIHANDLE hdb;
8496 INSTALLSTATE state, action;
8498 hdb = create_package_db();
8499 ok ( hdb, "failed to create package database\n" );
8501 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
8502 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
8504 r = create_feature_table( hdb );
8505 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
8507 r = create_component_table( hdb );
8508 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
8510 r = create_feature_components_table( hdb );
8511 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
8513 r = create_file_table( hdb );
8514 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
8516 /* msidbFeatureAttributesFavorLocal */
8517 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
8518 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8520 /* msidbFeatureAttributesFavorSource */
8521 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
8522 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8524 /* msidbFeatureAttributesFavorLocal */
8525 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
8526 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8528 /* disabled because of install level */
8529 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
8530 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8532 /* child feature of disabled feature */
8533 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8534 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
8536 /* component of disabled feature (install level) */
8537 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8538 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8540 /* component of disabled child feature (install level) */
8541 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8542 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8544 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8545 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8546 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8548 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8549 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8550 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8552 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8553 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8554 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8556 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8557 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8558 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8560 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8561 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8562 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8564 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8565 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8566 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8568 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8569 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8570 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8572 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8573 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8574 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
8576 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8577 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
8579 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
8580 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8582 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
8583 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8585 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
8586 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8588 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
8589 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8591 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
8592 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8594 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
8595 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8597 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
8598 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8600 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
8601 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8603 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
8604 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8606 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
8607 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8609 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
8610 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8612 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
8613 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8615 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
8616 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8618 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
8619 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8621 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
8622 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8624 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
8625 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8627 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
8628 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
8630 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
8631 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8633 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
8634 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8636 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
8637 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8639 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
8640 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8642 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
8643 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8645 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
8646 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8648 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
8649 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8651 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
8652 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8654 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
8655 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8657 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
8658 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8660 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
8661 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
8663 hpkg = package_from_db( hdb );
8664 ok( hpkg, "failed to create package\n");
8666 MsiCloseHandle( hdb );
8668 r = MsiDoAction( hpkg, "CostInitialize");
8669 ok( r == ERROR_SUCCESS, "cost init failed\n");
8671 r = MsiDoAction( hpkg, "FileCost");
8672 ok( r == ERROR_SUCCESS, "file cost failed\n");
8674 r = MsiDoAction( hpkg, "CostFinalize");
8675 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
8677 state = 0xdeadbee;
8678 action = 0xdeadbee;
8679 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
8680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8681 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8682 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
8684 state = 0xdeadbee;
8685 action = 0xdeadbee;
8686 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
8687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8688 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8689 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
8691 state = 0xdeadbee;
8692 action = 0xdeadbee;
8693 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
8694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8695 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8696 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
8698 state = 0xdeadbee;
8699 action = 0xdeadbee;
8700 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
8701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8702 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8703 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
8705 state = 0xdeadbee;
8706 action = 0xdeadbee;
8707 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
8708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8709 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
8710 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
8712 state = 0xdeadbee;
8713 action = 0xdeadbee;
8714 r = MsiGetComponentState(hpkg, "leo", &state, &action);
8715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8716 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
8717 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
8719 state = 0xdeadbee;
8720 action = 0xdeadbee;
8721 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
8722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8723 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
8724 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
8726 state = 0xdeadbee;
8727 action = 0xdeadbee;
8728 r = MsiGetComponentState(hpkg, "libra", &state, &action);
8729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8730 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
8731 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
8733 state = 0xdeadbee;
8734 action = 0xdeadbee;
8735 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
8736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8737 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
8738 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
8740 state = 0xdeadbee;
8741 action = 0xdeadbee;
8742 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
8743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8744 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
8745 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
8747 state = 0xdeadbee;
8748 action = 0xdeadbee;
8749 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
8750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8751 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
8752 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
8754 state = 0xdeadbee;
8755 action = 0xdeadbee;
8756 r = MsiGetComponentState(hpkg, "canis", &state, &action);
8757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8758 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
8759 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
8761 state = 0xdeadbee;
8762 action = 0xdeadbee;
8763 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
8764 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8765 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
8766 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
8768 state = 0xdeadbee;
8769 action = 0xdeadbee;
8770 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
8771 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8772 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
8773 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
8775 state = 0xdeadbee;
8776 action = 0xdeadbee;
8777 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
8778 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8779 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
8780 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
8782 state = 0xdeadbee;
8783 action = 0xdeadbee;
8784 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
8785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8786 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
8787 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
8789 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
8790 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
8792 state = 0xdeadbee;
8793 action = 0xdeadbee;
8794 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
8795 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8796 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
8797 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
8799 state = 0xdeadbee;
8800 action = 0xdeadbee;
8801 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
8802 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8803 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
8804 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
8806 state = 0xdeadbee;
8807 action = 0xdeadbee;
8808 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
8809 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8810 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
8811 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
8813 state = 0xdeadbee;
8814 action = 0xdeadbee;
8815 r = MsiGetComponentState(hpkg, "leo", &state, &action);
8816 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8817 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
8818 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
8820 state = 0xdeadbee;
8821 action = 0xdeadbee;
8822 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
8823 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8824 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
8825 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
8827 state = 0xdeadbee;
8828 action = 0xdeadbee;
8829 r = MsiGetComponentState(hpkg, "libra", &state, &action);
8830 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8831 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
8832 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
8834 state = 0xdeadbee;
8835 action = 0xdeadbee;
8836 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
8837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8838 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
8839 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
8841 state = 0xdeadbee;
8842 action = 0xdeadbee;
8843 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
8844 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8845 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
8846 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
8848 state = 0xdeadbee;
8849 action = 0xdeadbee;
8850 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
8851 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8852 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
8853 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
8855 state = 0xdeadbee;
8856 action = 0xdeadbee;
8857 r = MsiGetComponentState(hpkg, "canis", &state, &action);
8858 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8859 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
8860 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
8862 state = 0xdeadbee;
8863 action = 0xdeadbee;
8864 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
8865 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8866 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
8867 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
8869 state = 0xdeadbee;
8870 action = 0xdeadbee;
8871 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
8872 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8873 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
8874 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
8876 state = 0xdeadbee;
8877 action = 0xdeadbee;
8878 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
8879 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8880 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
8881 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
8883 state = 0xdeadbee;
8884 action = 0xdeadbee;
8885 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
8886 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
8887 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
8888 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
8890 MsiCloseHandle(hpkg);
8891 DeleteFileA(msifile);
8894 static void test_installprops(void)
8896 MSIHANDLE hpkg, hdb;
8897 CHAR path[MAX_PATH];
8898 CHAR buf[MAX_PATH];
8899 DWORD size, type;
8900 LANGID langid;
8901 HKEY hkey1, hkey2;
8902 int res;
8903 UINT r;
8905 GetCurrentDirectory(MAX_PATH, path);
8906 lstrcat(path, "\\");
8907 lstrcat(path, msifile);
8909 hdb = create_package_db();
8910 ok( hdb, "failed to create database\n");
8912 hpkg = package_from_db(hdb);
8913 ok( hpkg, "failed to create package\n");
8915 MsiCloseHandle(hdb);
8917 size = MAX_PATH;
8918 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
8919 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8920 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
8922 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
8924 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
8926 size = MAX_PATH;
8927 type = REG_SZ;
8928 *path = '\0';
8929 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
8931 size = MAX_PATH;
8932 type = REG_SZ;
8933 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
8936 /* win9x doesn't set this */
8937 if (*path)
8939 size = MAX_PATH;
8940 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
8941 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8942 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
8945 size = MAX_PATH;
8946 type = REG_SZ;
8947 *path = '\0';
8948 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
8950 size = MAX_PATH;
8951 type = REG_SZ;
8952 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
8955 if (*path)
8957 size = MAX_PATH;
8958 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
8959 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8960 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
8963 size = MAX_PATH;
8964 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
8965 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8966 trace("VersionDatabase = %s\n", buf);
8968 size = MAX_PATH;
8969 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
8970 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8971 trace("VersionMsi = %s\n", buf);
8973 size = MAX_PATH;
8974 r = MsiGetProperty(hpkg, "Date", buf, &size);
8975 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8976 trace("Date = %s\n", buf);
8978 size = MAX_PATH;
8979 r = MsiGetProperty(hpkg, "Time", buf, &size);
8980 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8981 trace("Time = %s\n", buf);
8983 size = MAX_PATH;
8984 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
8985 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
8986 trace("PackageCode = %s\n", buf);
8988 langid = GetUserDefaultLangID();
8989 sprintf(path, "%d", langid);
8991 size = MAX_PATH;
8992 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
8993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
8994 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
8996 res = GetSystemMetrics(SM_CXSCREEN);
8997 size = MAX_PATH;
8998 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
8999 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9001 res = GetSystemMetrics(SM_CYSCREEN);
9002 size = MAX_PATH;
9003 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
9004 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9006 CloseHandle(hkey1);
9007 CloseHandle(hkey2);
9008 MsiCloseHandle(hpkg);
9009 DeleteFile(msifile);
9012 static void test_launchconditions(void)
9014 MSIHANDLE hpkg;
9015 MSIHANDLE hdb;
9016 UINT r;
9018 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9020 hdb = create_package_db();
9021 ok( hdb, "failed to create package database\n" );
9023 r = create_launchcondition_table( hdb );
9024 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
9026 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
9027 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9029 /* invalid condition */
9030 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
9031 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
9033 hpkg = package_from_db( hdb );
9034 ok( hpkg, "failed to create package\n");
9036 MsiCloseHandle( hdb );
9038 r = MsiSetProperty( hpkg, "X", "1" );
9039 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9041 /* invalid conditions are ignored */
9042 r = MsiDoAction( hpkg, "LaunchConditions" );
9043 ok( r == ERROR_SUCCESS, "cost init failed\n" );
9045 /* verify LaunchConditions still does some verification */
9046 r = MsiSetProperty( hpkg, "X", "2" );
9047 ok( r == ERROR_SUCCESS, "failed to set property\n" );
9049 r = MsiDoAction( hpkg, "LaunchConditions" );
9050 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
9052 MsiCloseHandle( hpkg );
9053 DeleteFile( msifile );
9056 static void test_ccpsearch(void)
9058 MSIHANDLE hdb, hpkg;
9059 CHAR prop[MAX_PATH];
9060 DWORD size = MAX_PATH;
9061 UINT r;
9063 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9065 hdb = create_package_db();
9066 ok(hdb, "failed to create package database\n");
9068 r = create_ccpsearch_table(hdb);
9069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9071 r = add_ccpsearch_entry(hdb, "'CCP_random'");
9072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9074 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
9075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9077 r = create_reglocator_table(hdb);
9078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9080 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9083 r = create_drlocator_table(hdb);
9084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9086 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
9087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9089 r = create_signature_table(hdb);
9090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9092 hpkg = package_from_db(hdb);
9093 ok(hpkg, "failed to create package\n");
9095 MsiCloseHandle(hdb);
9097 r = MsiDoAction(hpkg, "CCPSearch");
9098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9100 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
9101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9102 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
9104 MsiCloseHandle(hpkg);
9105 DeleteFileA(msifile);
9108 static void test_complocator(void)
9110 MSIHANDLE hdb, hpkg;
9111 UINT r;
9112 CHAR prop[MAX_PATH];
9113 CHAR expected[MAX_PATH];
9114 DWORD size = MAX_PATH;
9116 hdb = create_package_db();
9117 ok(hdb, "failed to create package database\n");
9119 r = create_appsearch_table(hdb);
9120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9122 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
9123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9125 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
9126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9128 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
9129 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9131 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
9132 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9134 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
9135 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9137 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
9138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9140 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
9141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9143 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
9144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9146 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
9147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9149 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
9150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9152 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
9153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9155 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
9156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9158 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
9159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9161 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
9162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9164 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
9165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9167 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
9168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9170 r = create_complocator_table(hdb);
9171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9173 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9176 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9179 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9182 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9183 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9185 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9186 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9188 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9191 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9194 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9195 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9197 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9198 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9200 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9203 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9204 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9206 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9209 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9210 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9212 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9215 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9216 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9218 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9221 r = create_signature_table(hdb);
9222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9224 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9227 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9228 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9230 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9233 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9234 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9236 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9237 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9239 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9242 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9243 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9245 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9248 hpkg = package_from_db(hdb);
9249 ok(hpkg, "failed to create package\n");
9251 MsiCloseHandle(hdb);
9253 create_test_file("abelisaurus");
9254 create_test_file("bactrosaurus");
9255 create_test_file("camelotia");
9256 create_test_file("diclonius");
9257 create_test_file("echinodon");
9258 create_test_file("falcarius");
9259 create_test_file("gallimimus");
9260 create_test_file("hagryphus");
9261 CreateDirectoryA("iguanodon", NULL);
9262 CreateDirectoryA("jobaria", NULL);
9263 CreateDirectoryA("kakuru", NULL);
9264 CreateDirectoryA("labocania", NULL);
9265 CreateDirectoryA("megaraptor", NULL);
9266 CreateDirectoryA("neosodon", NULL);
9267 CreateDirectoryA("olorotitan", NULL);
9268 CreateDirectoryA("pantydraco", NULL);
9270 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
9271 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
9272 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
9273 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
9274 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
9275 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
9276 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
9277 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
9278 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
9279 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
9280 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
9281 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
9282 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
9283 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
9284 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
9285 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
9287 r = MsiDoAction(hpkg, "AppSearch");
9288 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9290 size = MAX_PATH;
9291 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
9292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9294 lstrcpyA(expected, CURR_DIR);
9295 lstrcatA(expected, "\\abelisaurus");
9296 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9297 "Expected %s or empty string, got %s\n", expected, prop);
9299 size = MAX_PATH;
9300 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
9301 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9302 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9304 size = MAX_PATH;
9305 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
9306 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9307 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9309 size = MAX_PATH;
9310 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
9311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9312 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9314 size = MAX_PATH;
9315 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
9316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9318 lstrcpyA(expected, CURR_DIR);
9319 lstrcatA(expected, "\\");
9320 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9321 "Expected %s or empty string, got %s\n", expected, prop);
9323 size = MAX_PATH;
9324 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
9325 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9326 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9328 size = MAX_PATH;
9329 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
9330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9331 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9333 size = MAX_PATH;
9334 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
9335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9336 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9338 size = MAX_PATH;
9339 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
9340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9341 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9343 size = MAX_PATH;
9344 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
9345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9346 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9348 size = MAX_PATH;
9349 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
9350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9351 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9353 size = MAX_PATH;
9354 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
9355 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9356 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9358 size = MAX_PATH;
9359 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
9360 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9362 lstrcpyA(expected, CURR_DIR);
9363 lstrcatA(expected, "\\");
9364 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9365 "Expected %s or empty string, got %s\n", expected, prop);
9367 size = MAX_PATH;
9368 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
9369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9371 lstrcpyA(expected, CURR_DIR);
9372 lstrcatA(expected, "\\neosodon\\");
9373 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
9374 "Expected %s or empty string, got %s\n", expected, prop);
9376 size = MAX_PATH;
9377 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
9378 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9379 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9381 size = MAX_PATH;
9382 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
9383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9384 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
9386 MsiCloseHandle(hpkg);
9387 DeleteFileA("abelisaurus");
9388 DeleteFileA("bactrosaurus");
9389 DeleteFileA("camelotia");
9390 DeleteFileA("diclonius");
9391 DeleteFileA("echinodon");
9392 DeleteFileA("falcarius");
9393 DeleteFileA("gallimimus");
9394 DeleteFileA("hagryphus");
9395 RemoveDirectoryA("iguanodon");
9396 RemoveDirectoryA("jobaria");
9397 RemoveDirectoryA("kakuru");
9398 RemoveDirectoryA("labocania");
9399 RemoveDirectoryA("megaraptor");
9400 RemoveDirectoryA("neosodon");
9401 RemoveDirectoryA("olorotitan");
9402 RemoveDirectoryA("pantydraco");
9403 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9404 MSIINSTALLCONTEXT_MACHINE, NULL);
9405 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9406 MSIINSTALLCONTEXT_MACHINE, NULL);
9407 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9408 MSIINSTALLCONTEXT_MACHINE, NULL);
9409 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9410 MSIINSTALLCONTEXT_MACHINE, NULL);
9411 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9412 MSIINSTALLCONTEXT_MACHINE, NULL);
9413 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9414 MSIINSTALLCONTEXT_MACHINE, NULL);
9415 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9416 MSIINSTALLCONTEXT_MACHINE, NULL);
9417 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9418 MSIINSTALLCONTEXT_MACHINE, NULL);
9419 DeleteFileA(msifile);
9422 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
9424 MSIHANDLE summary;
9425 UINT r;
9427 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
9428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9430 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
9431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9433 r = MsiSummaryInfoPersist(summary);
9434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9436 MsiCloseHandle(summary);
9439 static void test_MsiGetSourcePath(void)
9441 MSIHANDLE hdb, hpkg;
9442 CHAR path[MAX_PATH];
9443 CHAR cwd[MAX_PATH];
9444 CHAR subsrc[MAX_PATH];
9445 CHAR sub2[MAX_PATH];
9446 DWORD size;
9447 UINT r;
9449 lstrcpyA(cwd, CURR_DIR);
9450 lstrcatA(cwd, "\\");
9452 lstrcpyA(subsrc, cwd);
9453 lstrcatA(subsrc, "subsource");
9454 lstrcatA(subsrc, "\\");
9456 lstrcpyA(sub2, subsrc);
9457 lstrcatA(sub2, "sub2");
9458 lstrcatA(sub2, "\\");
9460 /* uncompressed source */
9462 hdb = create_package_db();
9463 ok( hdb, "failed to create database\n");
9465 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9467 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9468 ok(r == S_OK, "failed\n");
9470 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9471 ok(r == S_OK, "failed\n");
9473 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
9474 ok(r == S_OK, "failed\n");
9476 r = MsiDatabaseCommit(hdb);
9477 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
9479 hpkg = package_from_db(hdb);
9480 ok(hpkg, "failed to create package\n");
9482 MsiCloseHandle(hdb);
9484 /* invalid database handle */
9485 size = MAX_PATH;
9486 lstrcpyA(path, "kiwi");
9487 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
9488 ok(r == ERROR_INVALID_HANDLE,
9489 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
9490 ok(!lstrcmpA(path, "kiwi"),
9491 "Expected path to be unchanged, got \"%s\"\n", path);
9492 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9494 /* NULL szFolder */
9495 size = MAX_PATH;
9496 lstrcpyA(path, "kiwi");
9497 r = MsiGetSourcePath(hpkg, NULL, path, &size);
9498 ok(r == ERROR_INVALID_PARAMETER,
9499 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9500 ok(!lstrcmpA(path, "kiwi"),
9501 "Expected path to be unchanged, got \"%s\"\n", path);
9502 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9504 /* empty szFolder */
9505 size = MAX_PATH;
9506 lstrcpyA(path, "kiwi");
9507 r = MsiGetSourcePath(hpkg, "", path, &size);
9508 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9509 ok(!lstrcmpA(path, "kiwi"),
9510 "Expected path to be unchanged, got \"%s\"\n", path);
9511 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9513 /* try TARGETDIR */
9514 size = MAX_PATH;
9515 lstrcpyA(path, "kiwi");
9516 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9517 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9518 ok(!lstrcmpA(path, "kiwi"),
9519 "Expected path to be unchanged, got \"%s\"\n", path);
9520 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9522 /* try SourceDir */
9523 size = MAX_PATH;
9524 lstrcpyA(path, "kiwi");
9525 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9526 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9527 ok(!lstrcmpA(path, "kiwi"),
9528 "Expected path to be unchanged, got \"%s\"\n", path);
9529 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9531 /* try SOURCEDIR */
9532 size = MAX_PATH;
9533 lstrcpyA(path, "kiwi");
9534 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9535 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9536 ok(!lstrcmpA(path, "kiwi"),
9537 "Expected path to be unchanged, got \"%s\"\n", path);
9538 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9540 /* source path does not exist, but the property exists */
9541 size = MAX_PATH;
9542 lstrcpyA(path, "kiwi");
9543 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9544 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9545 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
9546 ok(size == 0, "Expected 0, got %d\n", size);
9548 /* try SubDir */
9549 size = MAX_PATH;
9550 lstrcpyA(path, "kiwi");
9551 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9552 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9553 ok(!lstrcmpA(path, "kiwi"),
9554 "Expected path to be unchanged, got \"%s\"\n", path);
9555 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9557 /* try SubDir2 */
9558 size = MAX_PATH;
9559 lstrcpyA(path, "kiwi");
9560 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9561 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9562 ok(!lstrcmpA(path, "kiwi"),
9563 "Expected path to be unchanged, got \"%s\"\n", path);
9564 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9566 r = MsiDoAction(hpkg, "CostInitialize");
9567 ok(r == ERROR_SUCCESS, "cost init failed\n");
9569 /* try TARGETDIR after CostInitialize */
9570 size = MAX_PATH;
9571 lstrcpyA(path, "kiwi");
9572 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9574 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9575 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9577 /* try SourceDir after CostInitialize */
9578 size = MAX_PATH;
9579 lstrcpyA(path, "kiwi");
9580 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9582 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9583 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9585 /* try SOURCEDIR after CostInitialize */
9586 size = MAX_PATH;
9587 lstrcpyA(path, "kiwi");
9588 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9589 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9590 ok(!lstrcmpA(path, "kiwi"),
9591 "Expected path to be unchanged, got \"%s\"\n", path);
9592 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9594 /* source path does not exist, but the property exists */
9595 size = MAX_PATH;
9596 lstrcpyA(path, "kiwi");
9597 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9599 todo_wine
9601 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9602 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9605 /* try SubDir after CostInitialize */
9606 size = MAX_PATH;
9607 lstrcpyA(path, "kiwi");
9608 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9610 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9611 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9613 /* try SubDir2 after CostInitialize */
9614 size = MAX_PATH;
9615 lstrcpyA(path, "kiwi");
9616 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9618 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9619 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9621 r = MsiDoAction(hpkg, "ResolveSource");
9622 ok(r == ERROR_SUCCESS, "file cost failed\n");
9624 /* try TARGETDIR after ResolveSource */
9625 size = MAX_PATH;
9626 lstrcpyA(path, "kiwi");
9627 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9629 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9630 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9632 /* try SourceDir after ResolveSource */
9633 size = MAX_PATH;
9634 lstrcpyA(path, "kiwi");
9635 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9637 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9638 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9640 /* try SOURCEDIR after ResolveSource */
9641 size = MAX_PATH;
9642 lstrcpyA(path, "kiwi");
9643 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9644 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9645 ok(!lstrcmpA(path, "kiwi"),
9646 "Expected path to be unchanged, got \"%s\"\n", path);
9647 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9649 /* source path does not exist, but the property exists */
9650 size = MAX_PATH;
9651 lstrcpyA(path, "kiwi");
9652 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
9653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9654 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9655 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9657 /* try SubDir after ResolveSource */
9658 size = MAX_PATH;
9659 lstrcpyA(path, "kiwi");
9660 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9662 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9663 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9665 /* try SubDir2 after ResolveSource */
9666 size = MAX_PATH;
9667 lstrcpyA(path, "kiwi");
9668 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9670 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9671 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9673 r = MsiDoAction(hpkg, "FileCost");
9674 ok(r == ERROR_SUCCESS, "file cost failed\n");
9676 /* try TARGETDIR after FileCost */
9677 size = MAX_PATH;
9678 lstrcpyA(path, "kiwi");
9679 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9680 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9681 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9682 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9684 /* try SourceDir after FileCost */
9685 size = MAX_PATH;
9686 lstrcpyA(path, "kiwi");
9687 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9689 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9690 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9692 /* try SOURCEDIR after FileCost */
9693 size = MAX_PATH;
9694 lstrcpyA(path, "kiwi");
9695 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9696 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9697 ok(!lstrcmpA(path, "kiwi"),
9698 "Expected path to be unchanged, got \"%s\"\n", path);
9699 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9701 /* try SubDir after FileCost */
9702 size = MAX_PATH;
9703 lstrcpyA(path, "kiwi");
9704 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9706 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9707 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9709 /* try SubDir2 after FileCost */
9710 size = MAX_PATH;
9711 lstrcpyA(path, "kiwi");
9712 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9714 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9715 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9717 r = MsiDoAction(hpkg, "CostFinalize");
9718 ok(r == ERROR_SUCCESS, "file cost failed\n");
9720 /* try TARGETDIR after CostFinalize */
9721 size = MAX_PATH;
9722 lstrcpyA(path, "kiwi");
9723 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9725 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9726 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9728 /* try SourceDir after CostFinalize */
9729 size = MAX_PATH;
9730 lstrcpyA(path, "kiwi");
9731 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9733 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9734 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9736 /* try SOURCEDIR after CostFinalize */
9737 size = MAX_PATH;
9738 lstrcpyA(path, "kiwi");
9739 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9740 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9741 ok(!lstrcmpA(path, "kiwi"),
9742 "Expected path to be unchanged, got \"%s\"\n", path);
9743 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9745 /* try SubDir after CostFinalize */
9746 size = MAX_PATH;
9747 lstrcpyA(path, "kiwi");
9748 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9749 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9750 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9751 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9753 /* try SubDir2 after CostFinalize */
9754 size = MAX_PATH;
9755 lstrcpyA(path, "kiwi");
9756 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9758 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
9759 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
9761 /* nonexistent directory */
9762 size = MAX_PATH;
9763 lstrcpyA(path, "kiwi");
9764 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
9765 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
9766 ok(!lstrcmpA(path, "kiwi"),
9767 "Expected path to be unchanged, got \"%s\"\n", path);
9768 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
9770 /* NULL szPathBuf */
9771 size = MAX_PATH;
9772 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
9773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9774 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9776 /* NULL pcchPathBuf */
9777 lstrcpyA(path, "kiwi");
9778 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
9779 ok(r == ERROR_INVALID_PARAMETER,
9780 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
9781 ok(!lstrcmpA(path, "kiwi"),
9782 "Expected path to be unchanged, got \"%s\"\n", path);
9784 /* pcchPathBuf is 0 */
9785 size = 0;
9786 lstrcpyA(path, "kiwi");
9787 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9788 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
9789 ok(!lstrcmpA(path, "kiwi"),
9790 "Expected path to be unchanged, got \"%s\"\n", path);
9791 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9793 /* pcchPathBuf does not have room for NULL terminator */
9794 size = lstrlenA(cwd);
9795 lstrcpyA(path, "kiwi");
9796 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9797 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
9798 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
9799 "Expected path with no backslash, got \"%s\"\n", path);
9800 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9802 /* pcchPathBuf has room for NULL terminator */
9803 size = lstrlenA(cwd) + 1;
9804 lstrcpyA(path, "kiwi");
9805 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9806 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9807 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9808 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9810 MsiCloseHandle(hpkg);
9812 /* compressed source */
9814 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
9815 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9817 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
9819 hpkg = package_from_db(hdb);
9820 ok(hpkg, "failed to create package\n");
9822 r = MsiDoAction(hpkg, "CostInitialize");
9823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9824 r = MsiDoAction(hpkg, "FileCost");
9825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9826 r = MsiDoAction(hpkg, "CostFinalize");
9827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9829 /* try TARGETDIR after CostFinalize */
9830 size = MAX_PATH;
9831 lstrcpyA(path, "kiwi");
9832 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
9833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9834 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9835 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9837 /* try SourceDir after CostFinalize */
9838 size = MAX_PATH;
9839 lstrcpyA(path, "kiwi");
9840 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
9841 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9842 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9843 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9845 /* try SOURCEDIR after CostFinalize */
9846 size = MAX_PATH;
9847 lstrcpyA(path, "kiwi");
9848 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
9849 todo_wine
9851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9852 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9853 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9856 /* try SubDir after CostFinalize */
9857 size = MAX_PATH;
9858 lstrcpyA(path, "kiwi");
9859 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9860 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9861 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9862 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9864 /* try SubDir2 after CostFinalize */
9865 size = MAX_PATH;
9866 lstrcpyA(path, "kiwi");
9867 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9868 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9869 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
9870 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
9872 MsiCloseHandle(hpkg);
9873 DeleteFile(msifile);
9876 static void test_shortlongsource(void)
9878 MSIHANDLE hdb, hpkg;
9879 CHAR path[MAX_PATH];
9880 CHAR cwd[MAX_PATH];
9881 CHAR subsrc[MAX_PATH];
9882 DWORD size;
9883 UINT r;
9885 lstrcpyA(cwd, CURR_DIR);
9886 lstrcatA(cwd, "\\");
9888 lstrcpyA(subsrc, cwd);
9889 lstrcatA(subsrc, "long");
9890 lstrcatA(subsrc, "\\");
9892 /* long file names */
9894 hdb = create_package_db();
9895 ok( hdb, "failed to create database\n");
9897 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
9899 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
9900 ok(r == S_OK, "failed\n");
9902 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
9903 ok(r == S_OK, "failed\n");
9905 /* CostInitialize:short */
9906 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
9907 ok(r == S_OK, "failed\n");
9909 /* CostInitialize:long */
9910 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
9911 ok(r == S_OK, "failed\n");
9913 /* FileCost:short */
9914 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
9915 ok(r == S_OK, "failed\n");
9917 /* FileCost:long */
9918 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
9919 ok(r == S_OK, "failed\n");
9921 /* CostFinalize:short */
9922 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
9923 ok(r == S_OK, "failed\n");
9925 /* CostFinalize:long */
9926 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
9927 ok(r == S_OK, "failed\n");
9929 MsiDatabaseCommit(hdb);
9931 hpkg = package_from_db(hdb);
9932 ok(hpkg, "failed to create package\n");
9934 MsiCloseHandle(hdb);
9936 CreateDirectoryA("one", NULL);
9937 CreateDirectoryA("four", NULL);
9939 r = MsiDoAction(hpkg, "CostInitialize");
9940 ok(r == ERROR_SUCCESS, "file cost failed\n");
9942 CreateDirectory("five", NULL);
9943 CreateDirectory("eight", NULL);
9945 r = MsiDoAction(hpkg, "FileCost");
9946 ok(r == ERROR_SUCCESS, "file cost failed\n");
9948 CreateDirectory("nine", NULL);
9949 CreateDirectory("twelve", NULL);
9951 r = MsiDoAction(hpkg, "CostFinalize");
9952 ok(r == ERROR_SUCCESS, "file cost failed\n");
9954 /* neither short nor long source directories exist */
9955 size = MAX_PATH;
9956 lstrcpyA(path, "kiwi");
9957 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9958 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9959 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9960 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9962 CreateDirectoryA("short", NULL);
9964 /* short source directory exists */
9965 size = MAX_PATH;
9966 lstrcpyA(path, "kiwi");
9967 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9968 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9969 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9970 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9972 CreateDirectoryA("long", NULL);
9974 /* both short and long source directories exist */
9975 size = MAX_PATH;
9976 lstrcpyA(path, "kiwi");
9977 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
9978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9979 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9980 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9982 lstrcpyA(subsrc, cwd);
9983 lstrcatA(subsrc, "two");
9984 lstrcatA(subsrc, "\\");
9986 /* short dir exists before CostInitialize */
9987 size = MAX_PATH;
9988 lstrcpyA(path, "kiwi");
9989 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
9990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9991 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
9992 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
9994 lstrcpyA(subsrc, cwd);
9995 lstrcatA(subsrc, "four");
9996 lstrcatA(subsrc, "\\");
9998 /* long dir exists before CostInitialize */
9999 size = MAX_PATH;
10000 lstrcpyA(path, "kiwi");
10001 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10003 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10004 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10006 lstrcpyA(subsrc, cwd);
10007 lstrcatA(subsrc, "six");
10008 lstrcatA(subsrc, "\\");
10010 /* short dir exists before FileCost */
10011 size = MAX_PATH;
10012 lstrcpyA(path, "kiwi");
10013 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10015 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10016 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10018 lstrcpyA(subsrc, cwd);
10019 lstrcatA(subsrc, "eight");
10020 lstrcatA(subsrc, "\\");
10022 /* long dir exists before FileCost */
10023 size = MAX_PATH;
10024 lstrcpyA(path, "kiwi");
10025 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10027 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10028 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10030 lstrcpyA(subsrc, cwd);
10031 lstrcatA(subsrc, "ten");
10032 lstrcatA(subsrc, "\\");
10034 /* short dir exists before CostFinalize */
10035 size = MAX_PATH;
10036 lstrcpyA(path, "kiwi");
10037 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10038 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10039 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10040 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10042 lstrcpyA(subsrc, cwd);
10043 lstrcatA(subsrc, "twelve");
10044 lstrcatA(subsrc, "\\");
10046 /* long dir exists before CostFinalize */
10047 size = MAX_PATH;
10048 lstrcpyA(path, "kiwi");
10049 r = MsiGetSourcePath(hpkg, "SubDir7", 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 MsiCloseHandle(hpkg);
10055 RemoveDirectoryA("short");
10056 RemoveDirectoryA("long");
10057 RemoveDirectoryA("one");
10058 RemoveDirectoryA("four");
10059 RemoveDirectoryA("five");
10060 RemoveDirectoryA("eight");
10061 RemoveDirectoryA("nine");
10062 RemoveDirectoryA("twelve");
10064 /* short file names */
10066 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
10067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10069 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
10071 hpkg = package_from_db(hdb);
10072 ok(hpkg, "failed to create package\n");
10074 MsiCloseHandle(hdb);
10076 CreateDirectoryA("one", NULL);
10077 CreateDirectoryA("four", NULL);
10079 r = MsiDoAction(hpkg, "CostInitialize");
10080 ok(r == ERROR_SUCCESS, "file cost failed\n");
10082 CreateDirectory("five", NULL);
10083 CreateDirectory("eight", NULL);
10085 r = MsiDoAction(hpkg, "FileCost");
10086 ok(r == ERROR_SUCCESS, "file cost failed\n");
10088 CreateDirectory("nine", NULL);
10089 CreateDirectory("twelve", NULL);
10091 r = MsiDoAction(hpkg, "CostFinalize");
10092 ok(r == ERROR_SUCCESS, "file cost failed\n");
10094 lstrcpyA(subsrc, cwd);
10095 lstrcatA(subsrc, "short");
10096 lstrcatA(subsrc, "\\");
10098 /* neither short nor long source directories exist */
10099 size = MAX_PATH;
10100 lstrcpyA(path, "kiwi");
10101 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10103 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10104 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10106 CreateDirectoryA("short", NULL);
10108 /* short source directory exists */
10109 size = MAX_PATH;
10110 lstrcpyA(path, "kiwi");
10111 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10113 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10114 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10116 CreateDirectoryA("long", NULL);
10118 /* both short and long source directories exist */
10119 size = MAX_PATH;
10120 lstrcpyA(path, "kiwi");
10121 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10123 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10124 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10126 lstrcpyA(subsrc, cwd);
10127 lstrcatA(subsrc, "one");
10128 lstrcatA(subsrc, "\\");
10130 /* short dir exists before CostInitialize */
10131 size = MAX_PATH;
10132 lstrcpyA(path, "kiwi");
10133 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10134 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10135 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10136 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10138 lstrcpyA(subsrc, cwd);
10139 lstrcatA(subsrc, "three");
10140 lstrcatA(subsrc, "\\");
10142 /* long dir exists before CostInitialize */
10143 size = MAX_PATH;
10144 lstrcpyA(path, "kiwi");
10145 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
10146 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10147 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10148 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10150 lstrcpyA(subsrc, cwd);
10151 lstrcatA(subsrc, "five");
10152 lstrcatA(subsrc, "\\");
10154 /* short dir exists before FileCost */
10155 size = MAX_PATH;
10156 lstrcpyA(path, "kiwi");
10157 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
10158 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10159 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10160 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10162 lstrcpyA(subsrc, cwd);
10163 lstrcatA(subsrc, "seven");
10164 lstrcatA(subsrc, "\\");
10166 /* long dir exists before FileCost */
10167 size = MAX_PATH;
10168 lstrcpyA(path, "kiwi");
10169 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
10170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10171 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10172 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10174 lstrcpyA(subsrc, cwd);
10175 lstrcatA(subsrc, "nine");
10176 lstrcatA(subsrc, "\\");
10178 /* short dir exists before CostFinalize */
10179 size = MAX_PATH;
10180 lstrcpyA(path, "kiwi");
10181 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
10182 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10183 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10184 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10186 lstrcpyA(subsrc, cwd);
10187 lstrcatA(subsrc, "eleven");
10188 lstrcatA(subsrc, "\\");
10190 /* long dir exists before CostFinalize */
10191 size = MAX_PATH;
10192 lstrcpyA(path, "kiwi");
10193 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
10194 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10195 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10196 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10198 MsiCloseHandle(hpkg);
10199 RemoveDirectoryA("short");
10200 RemoveDirectoryA("long");
10201 RemoveDirectoryA("one");
10202 RemoveDirectoryA("four");
10203 RemoveDirectoryA("five");
10204 RemoveDirectoryA("eight");
10205 RemoveDirectoryA("nine");
10206 RemoveDirectoryA("twelve");
10207 DeleteFileA(msifile);
10210 static void test_sourcedir(void)
10212 MSIHANDLE hdb, hpkg;
10213 CHAR package[10];
10214 CHAR path[MAX_PATH];
10215 CHAR cwd[MAX_PATH];
10216 CHAR subsrc[MAX_PATH];
10217 DWORD size;
10218 UINT r;
10220 lstrcpyA(cwd, CURR_DIR);
10221 lstrcatA(cwd, "\\");
10223 lstrcpyA(subsrc, cwd);
10224 lstrcatA(subsrc, "long");
10225 lstrcatA(subsrc, "\\");
10227 hdb = create_package_db();
10228 ok( hdb, "failed to create database\n");
10230 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10231 ok(r == S_OK, "failed\n");
10233 sprintf(package, "#%i", hdb);
10234 r = MsiOpenPackage(package, &hpkg);
10235 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10237 /* properties only */
10239 /* SourceDir prop */
10240 size = MAX_PATH;
10241 lstrcpyA(path, "kiwi");
10242 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10243 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10244 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10245 ok(size == 0, "Expected 0, got %d\n", size);
10247 /* SOURCEDIR prop */
10248 size = MAX_PATH;
10249 lstrcpyA(path, "kiwi");
10250 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10251 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10252 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10253 ok(size == 0, "Expected 0, got %d\n", size);
10255 r = MsiDoAction(hpkg, "CostInitialize");
10256 ok(r == ERROR_SUCCESS, "file cost failed\n");
10258 /* SourceDir after CostInitialize */
10259 size = MAX_PATH;
10260 lstrcpyA(path, "kiwi");
10261 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10263 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10264 ok(size == 0, "Expected 0, got %d\n", size);
10266 /* SOURCEDIR after CostInitialize */
10267 size = MAX_PATH;
10268 lstrcpyA(path, "kiwi");
10269 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10270 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10271 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10272 ok(size == 0, "Expected 0, got %d\n", size);
10274 r = MsiDoAction(hpkg, "FileCost");
10275 ok(r == ERROR_SUCCESS, "file cost failed\n");
10277 /* SourceDir after FileCost */
10278 size = MAX_PATH;
10279 lstrcpyA(path, "kiwi");
10280 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10281 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10282 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10283 ok(size == 0, "Expected 0, got %d\n", size);
10285 /* SOURCEDIR after FileCost */
10286 size = MAX_PATH;
10287 lstrcpyA(path, "kiwi");
10288 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10290 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10291 ok(size == 0, "Expected 0, got %d\n", size);
10293 r = MsiDoAction(hpkg, "CostFinalize");
10294 ok(r == ERROR_SUCCESS, "file cost failed\n");
10296 /* SourceDir after CostFinalize */
10297 size = MAX_PATH;
10298 lstrcpyA(path, "kiwi");
10299 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10301 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10302 ok(size == 0, "Expected 0, got %d\n", size);
10304 /* SOURCEDIR after CostFinalize */
10305 size = MAX_PATH;
10306 lstrcpyA(path, "kiwi");
10307 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10308 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10309 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10310 ok(size == 0, "Expected 0, got %d\n", size);
10312 r = MsiDoAction(hpkg, "ResolveSource");
10313 ok(r == ERROR_SUCCESS, "file cost failed\n");
10315 /* SourceDir after ResolveSource */
10316 size = MAX_PATH;
10317 lstrcpyA(path, "kiwi");
10318 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10320 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10321 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10323 /* SOURCEDIR after ResolveSource */
10324 size = MAX_PATH;
10325 lstrcpyA(path, "kiwi");
10326 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10328 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10329 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10331 /* random casing */
10332 size = MAX_PATH;
10333 lstrcpyA(path, "kiwi");
10334 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
10335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10336 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10337 ok(size == 0, "Expected 0, got %d\n", size);
10339 MsiCloseHandle(hpkg);
10341 /* reset the package state */
10342 sprintf(package, "#%i", hdb);
10343 r = MsiOpenPackage(package, &hpkg);
10344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10346 /* test how MsiGetSourcePath affects the properties */
10348 /* SourceDir prop */
10349 size = MAX_PATH;
10350 lstrcpyA(path, "kiwi");
10351 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10352 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10353 todo_wine
10355 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10356 ok(size == 0, "Expected 0, got %d\n", size);
10359 size = MAX_PATH;
10360 lstrcpyA(path, "kiwi");
10361 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10362 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10363 ok(!lstrcmpA(path, "kiwi"),
10364 "Expected path to be unchanged, got \"%s\"\n", path);
10365 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10367 /* SourceDir after MsiGetSourcePath */
10368 size = MAX_PATH;
10369 lstrcpyA(path, "kiwi");
10370 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10372 todo_wine
10374 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10375 ok(size == 0, "Expected 0, got %d\n", size);
10378 /* SOURCEDIR prop */
10379 size = MAX_PATH;
10380 lstrcpyA(path, "kiwi");
10381 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10383 todo_wine
10385 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10386 ok(size == 0, "Expected 0, got %d\n", size);
10389 size = MAX_PATH;
10390 lstrcpyA(path, "kiwi");
10391 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10392 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10393 ok(!lstrcmpA(path, "kiwi"),
10394 "Expected path to be unchanged, got \"%s\"\n", path);
10395 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10397 /* SOURCEDIR prop after MsiGetSourcePath */
10398 size = MAX_PATH;
10399 lstrcpyA(path, "kiwi");
10400 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10402 todo_wine
10404 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10405 ok(size == 0, "Expected 0, got %d\n", size);
10408 r = MsiDoAction(hpkg, "CostInitialize");
10409 ok(r == ERROR_SUCCESS, "file cost failed\n");
10411 /* SourceDir after CostInitialize */
10412 size = MAX_PATH;
10413 lstrcpyA(path, "kiwi");
10414 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10415 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10416 todo_wine
10418 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10419 ok(size == 0, "Expected 0, got %d\n", size);
10422 size = MAX_PATH;
10423 lstrcpyA(path, "kiwi");
10424 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10426 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10427 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10429 /* SourceDir after MsiGetSourcePath */
10430 size = MAX_PATH;
10431 lstrcpyA(path, "kiwi");
10432 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10434 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10435 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10437 /* SOURCEDIR after CostInitialize */
10438 size = MAX_PATH;
10439 lstrcpyA(path, "kiwi");
10440 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10442 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10443 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10445 /* SOURCEDIR source path still does not exist */
10446 size = MAX_PATH;
10447 lstrcpyA(path, "kiwi");
10448 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10449 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10450 ok(!lstrcmpA(path, "kiwi"),
10451 "Expected path to be unchanged, got \"%s\"\n", path);
10452 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10454 r = MsiDoAction(hpkg, "FileCost");
10455 ok(r == ERROR_SUCCESS, "file cost failed\n");
10457 /* SourceDir after FileCost */
10458 size = MAX_PATH;
10459 lstrcpyA(path, "kiwi");
10460 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10462 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10463 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10465 /* SOURCEDIR after FileCost */
10466 size = MAX_PATH;
10467 lstrcpyA(path, "kiwi");
10468 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10470 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10471 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10473 /* SOURCEDIR source path still does not exist */
10474 size = MAX_PATH;
10475 lstrcpyA(path, "kiwi");
10476 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10477 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10478 ok(!lstrcmpA(path, "kiwi"),
10479 "Expected path to be unchanged, got \"%s\"\n", path);
10480 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10482 r = MsiDoAction(hpkg, "CostFinalize");
10483 ok(r == ERROR_SUCCESS, "file cost failed\n");
10485 /* SourceDir after CostFinalize */
10486 size = MAX_PATH;
10487 lstrcpyA(path, "kiwi");
10488 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10490 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10491 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10493 /* SOURCEDIR after CostFinalize */
10494 size = MAX_PATH;
10495 lstrcpyA(path, "kiwi");
10496 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10498 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10499 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10501 /* SOURCEDIR source path still does not exist */
10502 size = MAX_PATH;
10503 lstrcpyA(path, "kiwi");
10504 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10505 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10506 ok(!lstrcmpA(path, "kiwi"),
10507 "Expected path to be unchanged, got \"%s\"\n", path);
10508 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10510 r = MsiDoAction(hpkg, "ResolveSource");
10511 ok(r == ERROR_SUCCESS, "file cost failed\n");
10513 /* SourceDir after ResolveSource */
10514 size = MAX_PATH;
10515 lstrcpyA(path, "kiwi");
10516 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10518 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10519 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10521 /* SOURCEDIR after ResolveSource */
10522 size = MAX_PATH;
10523 lstrcpyA(path, "kiwi");
10524 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10526 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10527 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10529 /* SOURCEDIR source path still does not exist */
10530 size = MAX_PATH;
10531 lstrcpyA(path, "kiwi");
10532 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10533 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10534 ok(!lstrcmpA(path, "kiwi"),
10535 "Expected path to be unchanged, got \"%s\"\n", path);
10536 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10538 MsiCloseHandle(hdb);
10539 MsiCloseHandle(hpkg);
10540 DeleteFileA(msifile);
10543 struct access_res
10545 BOOL gothandle;
10546 DWORD lasterr;
10547 BOOL ignore;
10550 static const struct access_res create[16] =
10552 { TRUE, ERROR_SUCCESS, TRUE },
10553 { TRUE, ERROR_SUCCESS, TRUE },
10554 { TRUE, ERROR_SUCCESS, FALSE },
10555 { TRUE, ERROR_SUCCESS, FALSE },
10556 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10557 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10558 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10559 { TRUE, ERROR_SUCCESS, FALSE },
10560 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10561 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10562 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10563 { TRUE, ERROR_SUCCESS, TRUE },
10564 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10565 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10566 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10567 { TRUE, ERROR_SUCCESS, TRUE }
10570 static const struct access_res create_commit[16] =
10572 { TRUE, ERROR_SUCCESS, TRUE },
10573 { TRUE, ERROR_SUCCESS, TRUE },
10574 { TRUE, ERROR_SUCCESS, FALSE },
10575 { TRUE, ERROR_SUCCESS, FALSE },
10576 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10577 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10578 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10579 { TRUE, ERROR_SUCCESS, FALSE },
10580 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10581 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10582 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10583 { TRUE, ERROR_SUCCESS, TRUE },
10584 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10585 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10586 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
10587 { TRUE, ERROR_SUCCESS, TRUE }
10590 static const struct access_res create_close[16] =
10592 { TRUE, ERROR_SUCCESS, FALSE },
10593 { TRUE, ERROR_SUCCESS, FALSE },
10594 { TRUE, ERROR_SUCCESS, FALSE },
10595 { TRUE, ERROR_SUCCESS, FALSE },
10596 { TRUE, ERROR_SUCCESS, FALSE },
10597 { TRUE, ERROR_SUCCESS, FALSE },
10598 { TRUE, ERROR_SUCCESS, FALSE },
10599 { TRUE, ERROR_SUCCESS, FALSE },
10600 { TRUE, ERROR_SUCCESS, FALSE },
10601 { TRUE, ERROR_SUCCESS, FALSE },
10602 { TRUE, ERROR_SUCCESS, FALSE },
10603 { TRUE, ERROR_SUCCESS, FALSE },
10604 { TRUE, ERROR_SUCCESS, FALSE },
10605 { TRUE, ERROR_SUCCESS, FALSE },
10606 { TRUE, ERROR_SUCCESS, FALSE },
10607 { TRUE, ERROR_SUCCESS }
10610 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
10612 DWORD access = 0, share = 0;
10613 DWORD lasterr;
10614 HANDLE hfile;
10615 int i, j, idx = 0;
10617 for (i = 0; i < 4; i++)
10619 if (i == 0) access = 0;
10620 if (i == 1) access = GENERIC_READ;
10621 if (i == 2) access = GENERIC_WRITE;
10622 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
10624 for (j = 0; j < 4; j++)
10626 if (ares[idx].ignore)
10627 continue;
10629 if (j == 0) share = 0;
10630 if (j == 1) share = FILE_SHARE_READ;
10631 if (j == 2) share = FILE_SHARE_WRITE;
10632 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
10634 SetLastError(0xdeadbeef);
10635 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
10636 FILE_ATTRIBUTE_NORMAL, 0);
10637 lasterr = GetLastError();
10639 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
10640 "(%d, handle, %d): Expected %d, got %d\n",
10641 line, idx, ares[idx].gothandle,
10642 (hfile != INVALID_HANDLE_VALUE));
10644 ok(lasterr == ares[idx].lasterr ||
10645 lasterr == 0xdeadbeef, /* win9x */
10646 "(%d, lasterr, %d): Expected %d, got %d\n",
10647 line, idx, ares[idx].lasterr, lasterr);
10649 CloseHandle(hfile);
10650 idx++;
10655 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
10657 static void test_access(void)
10659 MSIHANDLE hdb;
10660 UINT r;
10662 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
10663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10665 test_file_access(msifile, create);
10667 r = MsiDatabaseCommit(hdb);
10668 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10670 test_file_access(msifile, create_commit);
10672 MsiCloseHandle(hdb);
10674 test_file_access(msifile, create_close);
10676 DeleteFileA(msifile);
10678 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
10679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10681 test_file_access(msifile, create);
10683 r = MsiDatabaseCommit(hdb);
10684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10686 test_file_access(msifile, create_commit);
10688 MsiCloseHandle(hdb);
10690 test_file_access(msifile, create_close);
10692 DeleteFileA(msifile);
10695 static void test_emptypackage(void)
10697 MSIHANDLE hpkg, hdb, hsuminfo;
10698 MSIHANDLE hview, hrec;
10699 MSICONDITION condition;
10700 CHAR buffer[MAX_PATH];
10701 DWORD size;
10702 UINT r;
10704 r = MsiOpenPackageA("", &hpkg);
10705 todo_wine
10707 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10710 hdb = MsiGetActiveDatabase(hpkg);
10711 todo_wine
10713 ok(hdb != 0, "Expected a valid database handle\n");
10716 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
10717 todo_wine
10719 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10721 r = MsiViewExecute(hview, 0);
10722 todo_wine
10724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10727 r = MsiViewFetch(hview, &hrec);
10728 todo_wine
10730 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10733 size = MAX_PATH;
10734 r = MsiRecordGetString(hrec, 1, buffer, &size);
10735 todo_wine
10737 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10738 ok(!lstrcmpA(buffer, "_Property"),
10739 "Expected \"_Property\", got \"%s\"\n", buffer);
10742 MsiCloseHandle(hrec);
10744 r = MsiViewFetch(hview, &hrec);
10745 todo_wine
10747 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10750 size = MAX_PATH;
10751 r = MsiRecordGetString(hrec, 1, buffer, &size);
10752 todo_wine
10754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10755 ok(!lstrcmpA(buffer, "#_FolderCache"),
10756 "Expected \"_Property\", got \"%s\"\n", buffer);
10759 MsiCloseHandle(hrec);
10760 MsiViewClose(hview);
10761 MsiCloseHandle(hview);
10763 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
10764 todo_wine
10766 ok(condition == MSICONDITION_FALSE,
10767 "Expected MSICONDITION_FALSE, got %d\n", condition);
10770 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
10771 todo_wine
10773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10775 r = MsiViewExecute(hview, 0);
10776 todo_wine
10778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10781 /* _Property table is not empty */
10782 r = MsiViewFetch(hview, &hrec);
10783 todo_wine
10785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10788 MsiCloseHandle(hrec);
10789 MsiViewClose(hview);
10790 MsiCloseHandle(hview);
10792 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
10793 todo_wine
10795 ok(condition == MSICONDITION_FALSE,
10796 "Expected MSICONDITION_FALSE, got %d\n", condition);
10799 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
10800 todo_wine
10802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10804 r = MsiViewExecute(hview, 0);
10805 todo_wine
10807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10810 /* #_FolderCache is not empty */
10811 r = MsiViewFetch(hview, &hrec);
10812 todo_wine
10814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10817 MsiCloseHandle(hrec);
10818 MsiViewClose(hview);
10819 MsiCloseHandle(hview);
10821 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
10822 todo_wine
10824 ok(r == ERROR_BAD_QUERY_SYNTAX,
10825 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
10828 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
10829 todo_wine
10831 ok(r == ERROR_BAD_QUERY_SYNTAX,
10832 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
10835 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
10836 todo_wine
10838 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
10839 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
10842 MsiCloseHandle(hsuminfo);
10844 r = MsiDatabaseCommit(hdb);
10845 todo_wine
10847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10850 MsiCloseHandle(hdb);
10851 MsiCloseHandle(hpkg);
10854 static void test_MsiGetProductProperty(void)
10856 MSIHANDLE hprod, hdb;
10857 CHAR val[MAX_PATH];
10858 CHAR path[MAX_PATH];
10859 CHAR query[MAX_PATH];
10860 CHAR keypath[MAX_PATH*2];
10861 CHAR prodcode[MAX_PATH];
10862 CHAR prod_squashed[MAX_PATH];
10863 HKEY prodkey, userkey, props;
10864 LPSTR usersid;
10865 DWORD size;
10866 LONG res;
10867 UINT r;
10868 SC_HANDLE scm;
10870 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
10871 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
10873 win_skip("Different registry keys on Win9x and WinMe\n");
10874 return;
10876 CloseServiceHandle(scm);
10878 GetCurrentDirectoryA(MAX_PATH, path);
10879 lstrcatA(path, "\\");
10881 create_test_guid(prodcode, prod_squashed);
10882 get_user_sid(&usersid);
10884 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
10885 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10887 r = MsiDatabaseCommit(hdb);
10888 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10890 r = set_summary_info(hdb);
10891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10893 r = run_query(hdb,
10894 "CREATE TABLE `Directory` ( "
10895 "`Directory` CHAR(255) NOT NULL, "
10896 "`Directory_Parent` CHAR(255), "
10897 "`DefaultDir` CHAR(255) NOT NULL "
10898 "PRIMARY KEY `Directory`)");
10899 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10901 r = run_query(hdb,
10902 "CREATE TABLE `Property` ( "
10903 "`Property` CHAR(72) NOT NULL, "
10904 "`Value` CHAR(255) "
10905 "PRIMARY KEY `Property`)");
10906 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10908 sprintf(query, "INSERT INTO `Property` "
10909 "(`Property`, `Value`) "
10910 "VALUES( 'ProductCode', '%s' )", prodcode);
10911 r = run_query(hdb, query);
10912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10914 r = MsiDatabaseCommit(hdb);
10915 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10917 MsiCloseHandle(hdb);
10919 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
10920 lstrcatA(keypath, prod_squashed);
10922 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &prodkey);
10923 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10925 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
10926 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
10927 lstrcatA(keypath, prod_squashed);
10929 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
10930 if (res == ERROR_ACCESS_DENIED)
10932 skip("Not enough rights to perform tests\n");
10933 RegDeleteKeyA(prodkey, "");
10934 RegCloseKey(prodkey);
10935 return;
10937 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10939 res = RegCreateKeyA(userkey, "InstallProperties", &props);
10940 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10942 lstrcpyA(val, path);
10943 lstrcatA(val, "\\winetest.msi");
10944 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
10945 (const BYTE *)val, lstrlenA(val) + 1);
10946 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10948 hprod = 0xdeadbeef;
10949 r = MsiOpenProductA(prodcode, &hprod);
10950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10951 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
10953 /* hProduct is invalid */
10954 size = MAX_PATH;
10955 lstrcpyA(val, "apple");
10956 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
10957 ok(r == ERROR_INVALID_HANDLE,
10958 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10959 ok(!lstrcmpA(val, "apple"),
10960 "Expected val to be unchanged, got \"%s\"\n", val);
10961 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10963 /* szProperty is NULL */
10964 size = MAX_PATH;
10965 lstrcpyA(val, "apple");
10966 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
10967 ok(r == ERROR_INVALID_PARAMETER,
10968 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10969 ok(!lstrcmpA(val, "apple"),
10970 "Expected val to be unchanged, got \"%s\"\n", val);
10971 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10973 /* szProperty is empty */
10974 size = MAX_PATH;
10975 lstrcpyA(val, "apple");
10976 r = MsiGetProductPropertyA(hprod, "", val, &size);
10977 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10978 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
10979 ok(size == 0, "Expected 0, got %d\n", size);
10981 /* get the property */
10982 size = MAX_PATH;
10983 lstrcpyA(val, "apple");
10984 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
10985 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10986 ok(!lstrcmpA(val, prodcode),
10987 "Expected \"%s\", got \"%s\"\n", prodcode, val);
10988 ok(size == lstrlenA(prodcode),
10989 "Expected %d, got %d\n", lstrlenA(prodcode), size);
10991 /* lpValueBuf is NULL */
10992 size = MAX_PATH;
10993 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
10994 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10995 ok(size == lstrlenA(prodcode),
10996 "Expected %d, got %d\n", lstrlenA(prodcode), size);
10998 /* pcchValueBuf is NULL */
10999 lstrcpyA(val, "apple");
11000 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
11001 ok(r == ERROR_INVALID_PARAMETER,
11002 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11003 ok(!lstrcmpA(val, "apple"),
11004 "Expected val to be unchanged, got \"%s\"\n", val);
11005 ok(size == lstrlenA(prodcode),
11006 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11008 /* pcchValueBuf is too small */
11009 size = 4;
11010 lstrcpyA(val, "apple");
11011 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11012 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11013 ok(!strncmp(val, prodcode, 3),
11014 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
11015 ok(size == lstrlenA(prodcode),
11016 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11018 /* pcchValueBuf does not leave room for NULL terminator */
11019 size = lstrlenA(prodcode);
11020 lstrcpyA(val, "apple");
11021 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11022 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11023 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
11024 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
11025 ok(size == lstrlenA(prodcode),
11026 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11028 /* pcchValueBuf has enough room for NULL terminator */
11029 size = lstrlenA(prodcode) + 1;
11030 lstrcpyA(val, "apple");
11031 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11033 ok(!lstrcmpA(val, prodcode),
11034 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11035 ok(size == lstrlenA(prodcode),
11036 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11038 /* nonexistent property */
11039 size = MAX_PATH;
11040 lstrcpyA(val, "apple");
11041 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
11042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11043 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11044 ok(size == 0, "Expected 0, got %d\n", size);
11046 r = MsiSetPropertyA(hprod, "NewProperty", "value");
11047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11049 /* non-product property set */
11050 size = MAX_PATH;
11051 lstrcpyA(val, "apple");
11052 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
11053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11054 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
11055 ok(size == 0, "Expected 0, got %d\n", size);
11057 r = MsiSetPropertyA(hprod, "ProductCode", "value");
11058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11060 /* non-product property that is also a product property set */
11061 size = MAX_PATH;
11062 lstrcpyA(val, "apple");
11063 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
11064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11065 ok(!lstrcmpA(val, prodcode),
11066 "Expected \"%s\", got \"%s\"\n", prodcode, val);
11067 ok(size == lstrlenA(prodcode),
11068 "Expected %d, got %d\n", lstrlenA(prodcode), size);
11070 MsiCloseHandle(hprod);
11072 RegDeleteValueA(props, "LocalPackage");
11073 RegDeleteKeyA(props, "");
11074 RegCloseKey(props);
11075 RegDeleteKeyA(userkey, "");
11076 RegCloseKey(userkey);
11077 RegDeleteKeyA(prodkey, "");
11078 RegCloseKey(prodkey);
11079 DeleteFileA(msifile);
11082 START_TEST(package)
11084 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
11086 test_createpackage();
11087 test_doaction();
11088 test_gettargetpath_bad();
11089 test_settargetpath();
11090 test_props();
11091 test_property_table();
11092 test_condition();
11093 test_msipackage();
11094 test_formatrecord2();
11095 test_states();
11096 test_getproperty();
11097 test_removefiles();
11098 test_appsearch();
11099 test_appsearch_complocator();
11100 test_appsearch_reglocator();
11101 test_appsearch_inilocator();
11102 test_appsearch_drlocator();
11103 test_featureparents();
11104 test_installprops();
11105 test_launchconditions();
11106 test_ccpsearch();
11107 test_complocator();
11108 test_MsiGetSourcePath();
11109 test_shortlongsource();
11110 test_sourcedir();
11111 test_access();
11112 test_emptypackage();
11113 test_MsiGetProductProperty();