push ba446c6b1b23357887fb7e3c53313f206998858b
[wine/hacks.git] / dlls / msi / tests / package.c
blob8611bf6175c7774a5abc10dd79dc30b635dce67e
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 /* RegDeleteTreeW from dlls/advapi32/registry.c */
36 LSTATUS WINAPI package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
38 LONG ret;
39 DWORD dwMaxSubkeyLen, dwMaxValueLen;
40 DWORD dwMaxLen, dwSize;
41 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
42 HKEY hSubKey = hKey;
44 if(lpszSubKey)
46 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
47 if (ret) return ret;
50 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
51 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
52 if (ret) goto cleanup;
54 dwMaxSubkeyLen++;
55 dwMaxValueLen++;
56 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
57 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
59 /* Name too big: alloc a buffer for it */
60 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
62 ret = ERROR_NOT_ENOUGH_MEMORY;
63 goto cleanup;
67 /* Recursively delete all the subkeys */
68 while (TRUE)
70 dwSize = dwMaxLen;
71 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
72 NULL, NULL, NULL)) break;
74 ret = package_RegDeleteTreeW(hSubKey, lpszName);
75 if (ret) goto cleanup;
78 if (lpszSubKey)
79 ret = RegDeleteKeyW(hKey, lpszSubKey);
80 else
81 while (TRUE)
83 dwSize = dwMaxLen;
84 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
85 NULL, NULL, NULL, NULL)) break;
87 ret = RegDeleteValueW(hKey, lpszName);
88 if (ret) goto cleanup;
91 cleanup:
92 if (lpszName != szNameBuf)
93 HeapFree(GetProcessHeap(), 0, lpszName);
94 if(lpszSubKey)
95 RegCloseKey(hSubKey);
96 return ret;
99 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
101 MSIHANDLE hview = 0;
102 UINT r, ret;
104 /* open a select query */
105 r = MsiDatabaseOpenView(hdb, query, &hview);
106 if (r != ERROR_SUCCESS)
107 return r;
108 r = MsiViewExecute(hview, 0);
109 if (r != ERROR_SUCCESS)
110 return r;
111 ret = MsiViewFetch(hview, phrec);
112 r = MsiViewClose(hview);
113 if (r != ERROR_SUCCESS)
114 return r;
115 r = MsiCloseHandle(hview);
116 if (r != ERROR_SUCCESS)
117 return r;
118 return ret;
121 static UINT run_query( MSIHANDLE hdb, const char *query )
123 MSIHANDLE hview = 0;
124 UINT r;
126 r = MsiDatabaseOpenView(hdb, query, &hview);
127 if( r != ERROR_SUCCESS )
128 return r;
130 r = MsiViewExecute(hview, 0);
131 if( r == ERROR_SUCCESS )
132 r = MsiViewClose(hview);
133 MsiCloseHandle(hview);
134 return r;
137 static UINT create_component_table( MSIHANDLE hdb )
139 return run_query( hdb,
140 "CREATE TABLE `Component` ( "
141 "`Component` CHAR(72) NOT NULL, "
142 "`ComponentId` CHAR(38), "
143 "`Directory_` CHAR(72) NOT NULL, "
144 "`Attributes` SHORT NOT NULL, "
145 "`Condition` CHAR(255), "
146 "`KeyPath` CHAR(72) "
147 "PRIMARY KEY `Component`)" );
150 static UINT create_feature_table( MSIHANDLE hdb )
152 return run_query( hdb,
153 "CREATE TABLE `Feature` ( "
154 "`Feature` CHAR(38) NOT NULL, "
155 "`Feature_Parent` CHAR(38), "
156 "`Title` CHAR(64), "
157 "`Description` CHAR(255), "
158 "`Display` SHORT NOT NULL, "
159 "`Level` SHORT NOT NULL, "
160 "`Directory_` CHAR(72), "
161 "`Attributes` SHORT NOT NULL "
162 "PRIMARY KEY `Feature`)" );
165 static UINT create_feature_components_table( MSIHANDLE hdb )
167 return run_query( hdb,
168 "CREATE TABLE `FeatureComponents` ( "
169 "`Feature_` CHAR(38) NOT NULL, "
170 "`Component_` CHAR(72) NOT NULL "
171 "PRIMARY KEY `Feature_`, `Component_` )" );
174 static UINT create_file_table( MSIHANDLE hdb )
176 return run_query( hdb,
177 "CREATE TABLE `File` ("
178 "`File` CHAR(72) NOT NULL, "
179 "`Component_` CHAR(72) NOT NULL, "
180 "`FileName` CHAR(255) NOT NULL, "
181 "`FileSize` LONG NOT NULL, "
182 "`Version` CHAR(72), "
183 "`Language` CHAR(20), "
184 "`Attributes` SHORT, "
185 "`Sequence` SHORT NOT NULL "
186 "PRIMARY KEY `File`)" );
189 static UINT create_remove_file_table( MSIHANDLE hdb )
191 return run_query( hdb,
192 "CREATE TABLE `RemoveFile` ("
193 "`FileKey` CHAR(72) NOT NULL, "
194 "`Component_` CHAR(72) NOT NULL, "
195 "`FileName` CHAR(255) LOCALIZABLE, "
196 "`DirProperty` CHAR(72) NOT NULL, "
197 "`InstallMode` SHORT NOT NULL "
198 "PRIMARY KEY `FileKey`)" );
201 static UINT create_appsearch_table( MSIHANDLE hdb )
203 return run_query( hdb,
204 "CREATE TABLE `AppSearch` ("
205 "`Property` CHAR(72) NOT NULL, "
206 "`Signature_` CHAR(72) NOT NULL "
207 "PRIMARY KEY `Property`, `Signature_`)" );
210 static UINT create_reglocator_table( MSIHANDLE hdb )
212 return run_query( hdb,
213 "CREATE TABLE `RegLocator` ("
214 "`Signature_` CHAR(72) NOT NULL, "
215 "`Root` SHORT NOT NULL, "
216 "`Key` CHAR(255) NOT NULL, "
217 "`Name` CHAR(255), "
218 "`Type` SHORT "
219 "PRIMARY KEY `Signature_`)" );
222 static UINT create_signature_table( MSIHANDLE hdb )
224 return run_query( hdb,
225 "CREATE TABLE `Signature` ("
226 "`Signature` CHAR(72) NOT NULL, "
227 "`FileName` CHAR(255) NOT NULL, "
228 "`MinVersion` CHAR(20), "
229 "`MaxVersion` CHAR(20), "
230 "`MinSize` LONG, "
231 "`MaxSize` LONG, "
232 "`MinDate` LONG, "
233 "`MaxDate` LONG, "
234 "`Languages` CHAR(255) "
235 "PRIMARY KEY `Signature`)" );
238 static UINT create_launchcondition_table( MSIHANDLE hdb )
240 return run_query( hdb,
241 "CREATE TABLE `LaunchCondition` ("
242 "`Condition` CHAR(255) NOT NULL, "
243 "`Description` CHAR(255) NOT NULL "
244 "PRIMARY KEY `Condition`)" );
247 static UINT create_property_table( MSIHANDLE hdb )
249 return run_query( hdb,
250 "CREATE TABLE `Property` ("
251 "`Property` CHAR(72) NOT NULL, "
252 "`Value` CHAR(0) "
253 "PRIMARY KEY `Property`)" );
256 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
258 return run_query( hdb,
259 "CREATE TABLE `InstallExecuteSequence` ("
260 "`Action` CHAR(72) NOT NULL, "
261 "`Condition` CHAR(255), "
262 "`Sequence` SHORT "
263 "PRIMARY KEY `Action`)" );
266 static UINT create_media_table( MSIHANDLE hdb )
268 return run_query( hdb,
269 "CREATE TABLE `Media` ("
270 "`DiskId` SHORT NOT NULL, "
271 "`LastSequence` SHORT NOT NULL, "
272 "`DiskPrompt` CHAR(64), "
273 "`Cabinet` CHAR(255), "
274 "`VolumeLabel` CHAR(32), "
275 "`Source` CHAR(72) "
276 "PRIMARY KEY `DiskId`)" );
279 static UINT create_ccpsearch_table( MSIHANDLE hdb )
281 return run_query( hdb,
282 "CREATE TABLE `CCPSearch` ("
283 "`Signature_` CHAR(72) NOT NULL "
284 "PRIMARY KEY `Signature_`)" );
287 static UINT create_drlocator_table( MSIHANDLE hdb )
289 return run_query( hdb,
290 "CREATE TABLE `DrLocator` ("
291 "`Signature_` CHAR(72) NOT NULL, "
292 "`Parent` CHAR(72), "
293 "`Path` CHAR(255), "
294 "`Depth` SHORT "
295 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
298 static UINT create_complocator_table( MSIHANDLE hdb )
300 return run_query( hdb,
301 "CREATE TABLE `CompLocator` ("
302 "`Signature_` CHAR(72) NOT NULL, "
303 "`ComponentId` CHAR(38) NOT NULL, "
304 "`Type` SHORT "
305 "PRIMARY KEY `Signature_`)" );
308 static UINT add_component_entry( MSIHANDLE hdb, const char *values )
310 char insert[] = "INSERT INTO `Component` "
311 "(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
312 "VALUES( %s )";
313 char *query;
314 UINT sz, r;
316 sz = strlen(values) + sizeof insert;
317 query = HeapAlloc(GetProcessHeap(),0,sz);
318 sprintf(query,insert,values);
319 r = run_query( hdb, query );
320 HeapFree(GetProcessHeap(), 0, query);
321 return r;
324 static UINT add_directory_entry( MSIHANDLE hdb, const char *values )
326 char insert[] = "INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )";
327 char *query;
328 UINT sz, r;
330 sz = strlen(values) + sizeof insert;
331 query = HeapAlloc(GetProcessHeap(),0,sz);
332 sprintf(query,insert,values);
333 r = run_query( hdb, query );
334 HeapFree(GetProcessHeap(), 0, query);
335 return r;
338 static UINT add_feature_entry( MSIHANDLE hdb, const char *values )
340 char insert[] = "INSERT INTO `Feature` (`Feature`, `Feature_Parent`, "
341 "`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )";
342 char *query;
343 UINT sz, r;
345 sz = strlen(values) + sizeof insert;
346 query = HeapAlloc(GetProcessHeap(),0,sz);
347 sprintf(query,insert,values);
348 r = run_query( hdb, query );
349 HeapFree(GetProcessHeap(), 0, query);
350 return r;
353 static UINT add_feature_components_entry( MSIHANDLE hdb, const char *values )
355 char insert[] = "INSERT INTO `FeatureComponents` "
356 "(`Feature_`, `Component_`) "
357 "VALUES( %s )";
358 char *query;
359 UINT sz, r;
361 sz = strlen(values) + sizeof insert;
362 query = HeapAlloc(GetProcessHeap(),0,sz);
363 sprintf(query,insert,values);
364 r = run_query( hdb, query );
365 HeapFree(GetProcessHeap(), 0, query);
366 return r;
369 static UINT add_file_entry( MSIHANDLE hdb, const char *values )
371 char insert[] = "INSERT INTO `File` "
372 "(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) "
373 "VALUES( %s )";
374 char *query;
375 UINT sz, r;
377 sz = strlen(values) + sizeof insert;
378 query = HeapAlloc(GetProcessHeap(),0,sz);
379 sprintf(query,insert,values);
380 r = run_query( hdb, query );
381 HeapFree(GetProcessHeap(), 0, query);
382 return r;
385 static UINT add_appsearch_entry( MSIHANDLE hdb, const char *values )
387 char insert[] = "INSERT INTO `AppSearch` "
388 "(`Property`, `Signature_`) "
389 "VALUES( %s )";
390 char *query;
391 UINT sz, r;
393 sz = strlen(values) + sizeof insert;
394 query = HeapAlloc(GetProcessHeap(),0,sz);
395 sprintf(query,insert,values);
396 r = run_query( hdb, query );
397 HeapFree(GetProcessHeap(), 0, query);
398 return r;
401 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *values )
403 char insert[] = "INSERT INTO `RegLocator` "
404 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) "
405 "VALUES( %s )";
406 char *query;
407 UINT sz, r;
409 sz = strlen(values) + sizeof insert;
410 query = HeapAlloc(GetProcessHeap(),0,sz);
411 sprintf(query,insert,values);
412 r = run_query( hdb, query );
413 HeapFree(GetProcessHeap(), 0, query);
414 return r;
417 static UINT add_signature_entry( MSIHANDLE hdb, const char *values )
419 char insert[] = "INSERT INTO `Signature` "
420 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
421 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
422 "VALUES( %s )";
423 char *query;
424 UINT sz, r;
426 sz = strlen(values) + sizeof insert;
427 query = HeapAlloc(GetProcessHeap(),0,sz);
428 sprintf(query,insert,values);
429 r = run_query( hdb, query );
430 HeapFree(GetProcessHeap(), 0, query);
431 return r;
434 static UINT add_launchcondition_entry( MSIHANDLE hdb, const char *values )
436 char insert[] = "INSERT INTO `LaunchCondition` "
437 "(`Condition`, `Description`) "
438 "VALUES( %s )";
439 char *query;
440 UINT sz, r;
442 sz = strlen(values) + sizeof insert;
443 query = HeapAlloc(GetProcessHeap(),0,sz);
444 sprintf(query,insert,values);
445 r = run_query( hdb, query );
446 HeapFree(GetProcessHeap(), 0, query);
447 return r;
450 static UINT add_property_entry( MSIHANDLE hdb, const char *values )
452 char insert[] = "INSERT INTO `Property` "
453 "(`Property`, `Value`) "
454 "VALUES( %s )";
455 char *query;
456 UINT sz, r;
458 sz = strlen(values) + sizeof insert;
459 query = HeapAlloc(GetProcessHeap(),0,sz);
460 sprintf(query,insert,values);
461 r = run_query( hdb, query );
462 HeapFree(GetProcessHeap(), 0, query);
463 return r;
466 static UINT add_install_execute_sequence_entry( MSIHANDLE hdb, const char *values )
468 char insert[] = "INSERT INTO `InstallExecuteSequence` "
469 "(`Action`, `Condition`, `Sequence`) "
470 "VALUES( %s )";
471 char *query;
472 UINT sz, r;
474 sz = strlen(values) + sizeof insert;
475 query = HeapAlloc(GetProcessHeap(),0,sz);
476 sprintf(query,insert,values);
477 r = run_query( hdb, query );
478 HeapFree(GetProcessHeap(), 0, query);
479 return r;
482 static UINT add_media_entry( MSIHANDLE hdb, const char *values )
484 char insert[] = "INSERT INTO `Media` "
485 "(`DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source`) "
486 "VALUES( %s )";
487 char *query;
488 UINT sz, r;
490 sz = strlen(values) + sizeof insert;
491 query = HeapAlloc(GetProcessHeap(),0,sz);
492 sprintf(query,insert,values);
493 r = run_query( hdb, query );
494 HeapFree(GetProcessHeap(), 0, query);
495 return r;
498 static UINT add_ccpsearch_entry( MSIHANDLE hdb, const char *values )
500 char insert[] = "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )";
501 char *query;
502 UINT sz, r;
504 sz = strlen(values) + sizeof insert;
505 query = HeapAlloc(GetProcessHeap(),0,sz);
506 sprintf(query,insert,values);
507 r = run_query( hdb, query );
508 HeapFree(GetProcessHeap(), 0, query);
509 return r;
512 static UINT add_drlocator_entry( MSIHANDLE hdb, const char *values )
514 char insert[] = "INSERT INTO `DrLocator` "
515 "(`Signature_`, `Parent`, `Path`, `Depth`) "
516 "VALUES( %s )";
517 char *query;
518 UINT sz, r;
520 sz = strlen(values) + sizeof insert;
521 query = HeapAlloc(GetProcessHeap(),0,sz);
522 sprintf(query,insert,values);
523 r = run_query( hdb, query );
524 HeapFree(GetProcessHeap(), 0, query);
525 return r;
528 static UINT add_complocator_entry( MSIHANDLE hdb, const char *values )
530 char insert[] = "INSERT INTO `CompLocator` "
531 "(`Signature_`, `ComponentId`, `Type`) "
532 "VALUES( %s )";
533 char *query;
534 UINT sz, r;
536 sz = strlen(values) + sizeof insert;
537 query = HeapAlloc(GetProcessHeap(),0,sz);
538 sprintf(query,insert,values);
539 r = run_query( hdb, query );
540 HeapFree(GetProcessHeap(), 0, query);
541 return r;
544 static UINT set_summary_info(MSIHANDLE hdb)
546 UINT res;
547 MSIHANDLE suminfo;
549 /* build summary info */
550 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
551 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
553 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
554 "Installation Database");
555 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
557 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
558 "Installation Database");
559 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
561 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
562 "Wine Hackers");
563 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
565 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
566 ";1033");
567 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
569 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
570 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
571 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
573 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
574 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
576 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
577 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
579 res = MsiSummaryInfoPersist(suminfo);
580 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
582 res = MsiCloseHandle( suminfo);
583 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
585 return res;
589 static MSIHANDLE create_package_db(void)
591 MSIHANDLE hdb = 0;
592 UINT res;
594 DeleteFile(msifile);
596 /* create an empty database */
597 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
598 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
599 if( res != ERROR_SUCCESS )
600 return hdb;
602 res = MsiDatabaseCommit( hdb );
603 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
605 res = set_summary_info(hdb);
607 res = run_query( hdb,
608 "CREATE TABLE `Directory` ( "
609 "`Directory` CHAR(255) NOT NULL, "
610 "`Directory_Parent` CHAR(255), "
611 "`DefaultDir` CHAR(255) NOT NULL "
612 "PRIMARY KEY `Directory`)" );
613 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
615 return hdb;
618 static MSIHANDLE package_from_db(MSIHANDLE hdb)
620 UINT res;
621 CHAR szPackage[10];
622 MSIHANDLE hPackage;
624 sprintf(szPackage,"#%li",hdb);
625 res = MsiOpenPackage(szPackage,&hPackage);
626 if (res != ERROR_SUCCESS)
627 return 0;
629 res = MsiCloseHandle(hdb);
630 if (res != ERROR_SUCCESS)
631 return 0;
633 return hPackage;
636 static void create_test_file(const CHAR *name)
638 HANDLE file;
639 DWORD written;
641 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
642 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
643 WriteFile(file, name, strlen(name), &written, NULL);
644 WriteFile(file, "\n", strlen("\n"), &written, NULL);
645 CloseHandle(file);
648 static void test_createpackage(void)
650 MSIHANDLE hPackage = 0;
651 UINT res;
653 hPackage = package_from_db(create_package_db());
654 ok( hPackage != 0, " Failed to create package\n");
656 res = MsiCloseHandle( hPackage);
657 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
658 DeleteFile(msifile);
661 static void test_doaction( void )
663 MSIHANDLE hpkg;
664 UINT r;
666 r = MsiDoAction( -1, NULL );
667 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
669 hpkg = package_from_db(create_package_db());
670 ok( hpkg, "failed to create package\n");
672 r = MsiDoAction(hpkg, NULL);
673 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
675 r = MsiDoAction(0, "boo");
676 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
678 r = MsiDoAction(hpkg, "boo");
679 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
681 MsiCloseHandle( hpkg );
682 DeleteFile(msifile);
685 static void test_gettargetpath_bad(void)
687 char buffer[0x80];
688 MSIHANDLE hpkg;
689 DWORD sz;
690 UINT r;
692 hpkg = package_from_db(create_package_db());
693 ok( hpkg, "failed to create package\n");
695 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
696 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
698 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
699 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
701 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
702 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
704 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
705 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
707 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
708 ok( r == ERROR_DIRECTORY, "wrong return val\n");
710 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
711 ok( r == ERROR_DIRECTORY, "wrong return val\n");
713 MsiCloseHandle( hpkg );
714 DeleteFile(msifile);
717 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
719 UINT r;
720 DWORD size;
721 MSIHANDLE rec;
723 rec = MsiCreateRecord( 1 );
724 ok(rec, "MsiCreate record failed\n");
726 r = MsiRecordSetString( rec, 0, file );
727 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
729 size = MAX_PATH;
730 r = MsiFormatRecord( hpkg, rec, buff, &size );
731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
733 MsiCloseHandle( rec );
736 static void test_settargetpath(void)
738 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
739 DWORD sz;
740 MSIHANDLE hpkg;
741 UINT r;
742 MSIHANDLE hdb;
744 hdb = create_package_db();
745 ok ( hdb, "failed to create package database\n" );
747 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
748 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
750 r = create_component_table( hdb );
751 ok( r == S_OK, "cannot create Component table: %d\n", r );
753 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
754 ok( r == S_OK, "cannot add dummy component: %d\n", r );
756 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
757 ok( r == S_OK, "cannot add test component: %d\n", r );
759 r = create_feature_table( hdb );
760 ok( r == S_OK, "cannot create Feature table: %d\n", r );
762 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
763 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
765 r = create_feature_components_table( hdb );
766 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
768 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
769 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
771 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
772 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
774 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
775 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
777 r = create_file_table( hdb );
778 ok( r == S_OK, "cannot create File table: %d\n", r );
780 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
781 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
783 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
784 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
786 hpkg = package_from_db( hdb );
787 ok( hpkg, "failed to create package\n");
789 r = MsiDoAction( hpkg, "CostInitialize");
790 ok( r == ERROR_SUCCESS, "cost init failed\n");
792 r = MsiDoAction( hpkg, "FileCost");
793 ok( r == ERROR_SUCCESS, "file cost failed\n");
795 r = MsiDoAction( hpkg, "CostFinalize");
796 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
798 r = MsiSetTargetPath( 0, NULL, NULL );
799 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
801 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
802 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
804 r = MsiSetTargetPath( hpkg, "boo", NULL );
805 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
807 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
808 ok( r == ERROR_DIRECTORY, "wrong return val\n");
810 sz = sizeof tempdir - 1;
811 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
812 sprintf( file, "%srootfile.txt", tempdir );
813 query_file_path( hpkg, "[#RootFile]", buffer );
814 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
815 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
817 GetTempFileName( tempdir, "_wt", 0, buffer );
818 sprintf( tempdir, "%s\\subdir", buffer );
820 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
821 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
822 "MsiSetTargetPath on file returned %d\n", r );
824 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
825 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
826 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
828 DeleteFile( buffer );
830 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
831 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
833 r = GetFileAttributes( buffer );
834 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
836 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
837 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
839 sz = sizeof buffer - 1;
840 lstrcat( tempdir, "\\" );
841 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
842 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
843 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
845 sprintf( file, "%srootfile.txt", tempdir );
846 query_file_path( hpkg, "[#RootFile]", buffer );
847 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
849 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
850 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
852 query_file_path( hpkg, "[#TestFile]", buffer );
853 ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
854 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
856 sz = sizeof buffer - 1;
857 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
858 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
859 ok( !lstrcmp(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
861 MsiCloseHandle( hpkg );
864 static void test_condition(void)
866 MSICONDITION r;
867 MSIHANDLE hpkg;
869 hpkg = package_from_db(create_package_db());
870 ok( hpkg, "failed to create package\n");
872 r = MsiEvaluateCondition(0, NULL);
873 ok( r == MSICONDITION_ERROR, "wrong return val\n");
875 r = MsiEvaluateCondition(hpkg, NULL);
876 ok( r == MSICONDITION_NONE, "wrong return val\n");
878 r = MsiEvaluateCondition(hpkg, "");
879 ok( r == MSICONDITION_NONE, "wrong return val\n");
881 r = MsiEvaluateCondition(hpkg, "1");
882 ok( r == MSICONDITION_TRUE, "wrong return val\n");
884 r = MsiEvaluateCondition(hpkg, "0");
885 ok( r == MSICONDITION_FALSE, "wrong return val\n");
887 r = MsiEvaluateCondition(hpkg, "-1");
888 ok( r == MSICONDITION_TRUE, "wrong return val\n");
890 r = MsiEvaluateCondition(hpkg, "0 = 0");
891 ok( r == MSICONDITION_TRUE, "wrong return val\n");
893 r = MsiEvaluateCondition(hpkg, "0 <> 0");
894 ok( r == MSICONDITION_FALSE, "wrong return val\n");
896 r = MsiEvaluateCondition(hpkg, "0 = 1");
897 ok( r == MSICONDITION_FALSE, "wrong return val\n");
899 r = MsiEvaluateCondition(hpkg, "0 > 1");
900 ok( r == MSICONDITION_FALSE, "wrong return val\n");
902 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
903 ok( r == MSICONDITION_FALSE, "wrong return val\n");
905 r = MsiEvaluateCondition(hpkg, "1 > 1");
906 ok( r == MSICONDITION_FALSE, "wrong return val\n");
908 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
909 ok( r == MSICONDITION_FALSE, "wrong return val\n");
911 r = MsiEvaluateCondition(hpkg, "0 >= 1");
912 ok( r == MSICONDITION_FALSE, "wrong return val\n");
914 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
915 ok( r == MSICONDITION_FALSE, "wrong return val\n");
917 r = MsiEvaluateCondition(hpkg, "1 >= 1");
918 ok( r == MSICONDITION_TRUE, "wrong return val\n");
920 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
921 ok( r == MSICONDITION_TRUE, "wrong return val\n");
923 r = MsiEvaluateCondition(hpkg, "0 < 1");
924 ok( r == MSICONDITION_TRUE, "wrong return val\n");
926 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
927 ok( r == MSICONDITION_TRUE, "wrong return val\n");
929 r = MsiEvaluateCondition(hpkg, "1 < 1");
930 ok( r == MSICONDITION_FALSE, "wrong return val\n");
932 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
933 ok( r == MSICONDITION_FALSE, "wrong return val\n");
935 r = MsiEvaluateCondition(hpkg, "0 <= 1");
936 ok( r == MSICONDITION_TRUE, "wrong return val\n");
938 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
939 ok( r == MSICONDITION_TRUE, "wrong return val\n");
941 r = MsiEvaluateCondition(hpkg, "1 <= 1");
942 ok( r == MSICONDITION_TRUE, "wrong return val\n");
944 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
945 ok( r == MSICONDITION_TRUE, "wrong return val\n");
947 r = MsiEvaluateCondition(hpkg, "0 >=");
948 ok( r == MSICONDITION_ERROR, "wrong return val\n");
950 r = MsiEvaluateCondition(hpkg, " ");
951 ok( r == MSICONDITION_NONE, "wrong return val\n");
953 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
954 ok( r == MSICONDITION_TRUE, "wrong return val\n");
956 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
957 ok( r == MSICONDITION_TRUE, "wrong return val\n");
959 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
960 ok( r == MSICONDITION_FALSE, "wrong return val\n");
962 r = MsiEvaluateCondition(hpkg, "not 0");
963 ok( r == MSICONDITION_TRUE, "wrong return val\n");
965 r = MsiEvaluateCondition(hpkg, "not LicView");
966 ok( r == MSICONDITION_TRUE, "wrong return val\n");
968 r = MsiEvaluateCondition(hpkg, "not \"A\"");
969 ok( r == MSICONDITION_FALSE, "wrong return val\n");
971 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
972 ok( r == MSICONDITION_ERROR, "wrong return val\n");
974 r = MsiEvaluateCondition(hpkg, "\"0\"");
975 ok( r == MSICONDITION_TRUE, "wrong return val\n");
977 r = MsiEvaluateCondition(hpkg, "1 and 2");
978 ok( r == MSICONDITION_TRUE, "wrong return val\n");
980 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
981 ok( r == MSICONDITION_TRUE, "wrong return val\n");
983 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
984 ok( r == MSICONDITION_FALSE, "wrong return val\n");
986 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
987 ok( r == MSICONDITION_TRUE, "wrong return val\n");
989 r = MsiEvaluateCondition(hpkg, "(0)");
990 ok( r == MSICONDITION_FALSE, "wrong return val\n");
992 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
993 ok( r == MSICONDITION_ERROR, "wrong return val\n");
995 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
996 ok( r == MSICONDITION_TRUE, "wrong return val\n");
998 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
999 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1001 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1002 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1004 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1005 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1007 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1008 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1010 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1011 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1013 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1014 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1016 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1017 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1019 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1020 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1022 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1023 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1025 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1026 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1028 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1029 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1031 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1032 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1034 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1035 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1037 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1038 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1040 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1041 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1043 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1044 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1046 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1047 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1049 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1050 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1052 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1053 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1055 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1056 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1058 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1059 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1061 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1062 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1064 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1065 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1067 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1068 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1070 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1071 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1073 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1074 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1076 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1077 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1079 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1080 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1082 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1083 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1085 MsiSetProperty(hpkg, "mm", "5" );
1087 r = MsiEvaluateCondition(hpkg, "mm = 5");
1088 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1090 r = MsiEvaluateCondition(hpkg, "mm < 6");
1091 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1093 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1094 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1096 r = MsiEvaluateCondition(hpkg, "mm > 4");
1097 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1099 r = MsiEvaluateCondition(hpkg, "mm < 12");
1100 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1102 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1103 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1105 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1106 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1108 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1109 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1111 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1112 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1114 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1115 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1117 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1118 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1120 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1121 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1123 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1124 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1126 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1127 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1129 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1130 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1132 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1133 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1135 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1136 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1138 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1139 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1141 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1142 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1144 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1145 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1147 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1148 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1150 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1151 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1153 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1154 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1156 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1157 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1159 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1160 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1162 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1163 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1165 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1166 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1168 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1169 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1171 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1172 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1174 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1175 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1178 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1180 MsiSetProperty(hpkg, "bandalmael", "0" );
1181 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1182 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1184 MsiSetProperty(hpkg, "bandalmael", "" );
1185 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1186 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1188 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1189 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1190 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1192 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1193 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1194 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1196 MsiSetProperty(hpkg, "bandalmael", "0 " );
1197 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1198 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1200 MsiSetProperty(hpkg, "bandalmael", "-0" );
1201 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1202 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1204 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1205 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1206 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1208 MsiSetProperty(hpkg, "bandalmael", "--0" );
1209 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1210 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1212 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1213 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1214 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1216 MsiSetProperty(hpkg, "bandalmael", "-" );
1217 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1218 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1220 MsiSetProperty(hpkg, "bandalmael", "+0" );
1221 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1222 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1224 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1225 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1226 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1228 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1230 MsiSetProperty(hpkg, "one", "hi");
1231 MsiSetProperty(hpkg, "two", "hithere");
1232 r = MsiEvaluateCondition(hpkg, "one >< two");
1233 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1235 MsiSetProperty(hpkg, "one", "hithere");
1236 MsiSetProperty(hpkg, "two", "hi");
1237 r = MsiEvaluateCondition(hpkg, "one >< two");
1238 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1240 MsiSetProperty(hpkg, "one", "hello");
1241 MsiSetProperty(hpkg, "two", "hi");
1242 r = MsiEvaluateCondition(hpkg, "one >< two");
1243 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1245 MsiSetProperty(hpkg, "one", "hellohithere");
1246 MsiSetProperty(hpkg, "two", "hi");
1247 r = MsiEvaluateCondition(hpkg, "one >< two");
1248 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1250 MsiSetProperty(hpkg, "one", "");
1251 MsiSetProperty(hpkg, "two", "hi");
1252 r = MsiEvaluateCondition(hpkg, "one >< two");
1253 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1255 MsiSetProperty(hpkg, "one", "hi");
1256 MsiSetProperty(hpkg, "two", "");
1257 r = MsiEvaluateCondition(hpkg, "one >< two");
1258 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1260 MsiSetProperty(hpkg, "one", "");
1261 MsiSetProperty(hpkg, "two", "");
1262 r = MsiEvaluateCondition(hpkg, "one >< two");
1263 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1265 MsiSetProperty(hpkg, "one", "1234");
1266 MsiSetProperty(hpkg, "two", "1");
1267 r = MsiEvaluateCondition(hpkg, "one >< two");
1268 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1270 MsiSetProperty(hpkg, "one", "one 1234");
1271 MsiSetProperty(hpkg, "two", "1");
1272 r = MsiEvaluateCondition(hpkg, "one >< two");
1273 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1275 MsiSetProperty(hpkg, "one", "hithere");
1276 MsiSetProperty(hpkg, "two", "hi");
1277 r = MsiEvaluateCondition(hpkg, "one << two");
1278 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1280 MsiSetProperty(hpkg, "one", "hi");
1281 MsiSetProperty(hpkg, "two", "hithere");
1282 r = MsiEvaluateCondition(hpkg, "one << two");
1283 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1285 MsiSetProperty(hpkg, "one", "hi");
1286 MsiSetProperty(hpkg, "two", "hi");
1287 r = MsiEvaluateCondition(hpkg, "one << two");
1288 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1290 MsiSetProperty(hpkg, "one", "abcdhithere");
1291 MsiSetProperty(hpkg, "two", "hi");
1292 r = MsiEvaluateCondition(hpkg, "one << two");
1293 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1295 MsiSetProperty(hpkg, "one", "");
1296 MsiSetProperty(hpkg, "two", "hi");
1297 r = MsiEvaluateCondition(hpkg, "one << two");
1298 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1300 MsiSetProperty(hpkg, "one", "hithere");
1301 MsiSetProperty(hpkg, "two", "");
1302 r = MsiEvaluateCondition(hpkg, "one << two");
1303 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1305 MsiSetProperty(hpkg, "one", "");
1306 MsiSetProperty(hpkg, "two", "");
1307 r = MsiEvaluateCondition(hpkg, "one << two");
1308 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1310 MsiSetProperty(hpkg, "one", "1234");
1311 MsiSetProperty(hpkg, "two", "1");
1312 r = MsiEvaluateCondition(hpkg, "one << two");
1313 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1315 MsiSetProperty(hpkg, "one", "1234 one");
1316 MsiSetProperty(hpkg, "two", "1");
1317 r = MsiEvaluateCondition(hpkg, "one << two");
1318 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1320 MsiSetProperty(hpkg, "one", "hithere");
1321 MsiSetProperty(hpkg, "two", "there");
1322 r = MsiEvaluateCondition(hpkg, "one >> two");
1323 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1325 MsiSetProperty(hpkg, "one", "hithere");
1326 MsiSetProperty(hpkg, "two", "hi");
1327 r = MsiEvaluateCondition(hpkg, "one >> two");
1328 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1330 MsiSetProperty(hpkg, "one", "there");
1331 MsiSetProperty(hpkg, "two", "hithere");
1332 r = MsiEvaluateCondition(hpkg, "one >> two");
1333 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1335 MsiSetProperty(hpkg, "one", "there");
1336 MsiSetProperty(hpkg, "two", "there");
1337 r = MsiEvaluateCondition(hpkg, "one >> two");
1338 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1340 MsiSetProperty(hpkg, "one", "abcdhithere");
1341 MsiSetProperty(hpkg, "two", "hi");
1342 r = MsiEvaluateCondition(hpkg, "one >> two");
1343 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1345 MsiSetProperty(hpkg, "one", "");
1346 MsiSetProperty(hpkg, "two", "there");
1347 r = MsiEvaluateCondition(hpkg, "one >> two");
1348 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1350 MsiSetProperty(hpkg, "one", "there");
1351 MsiSetProperty(hpkg, "two", "");
1352 r = MsiEvaluateCondition(hpkg, "one >> two");
1353 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1355 MsiSetProperty(hpkg, "one", "");
1356 MsiSetProperty(hpkg, "two", "");
1357 r = MsiEvaluateCondition(hpkg, "one >> two");
1358 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1360 MsiSetProperty(hpkg, "one", "1234");
1361 MsiSetProperty(hpkg, "two", "4");
1362 r = MsiEvaluateCondition(hpkg, "one >> two");
1363 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 MsiSetProperty(hpkg, "one", "one 1234");
1366 MsiSetProperty(hpkg, "two", "4");
1367 r = MsiEvaluateCondition(hpkg, "one >> two");
1368 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1370 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1372 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1373 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1375 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1376 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1378 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1379 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1381 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1382 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1384 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1385 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1387 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1388 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1390 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1391 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1393 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1394 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1396 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1397 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1399 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1400 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1402 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1403 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1405 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1406 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1408 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1409 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1411 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1412 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1414 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1415 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1417 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1418 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1420 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1421 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1423 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1424 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1426 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1427 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1429 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1430 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1432 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1433 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1435 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1436 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1438 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1439 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1441 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1442 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1444 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1445 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1447 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1448 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1450 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1451 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1453 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1454 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1456 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1457 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1459 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1460 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1462 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1463 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1465 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1466 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1468 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1469 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1471 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1472 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1474 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1475 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1477 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1478 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1480 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1481 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1483 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1484 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1485 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1487 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1488 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1490 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1491 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1493 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1494 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1496 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1497 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1499 MsiSetProperty(hpkg, "one", "1");
1500 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1501 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1503 MsiSetProperty(hpkg, "X", "5.0");
1505 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1506 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1508 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1509 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1511 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1512 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1514 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1515 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1517 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1518 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1520 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1521 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1523 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1524 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1526 /* feature doesn't exist */
1527 r = MsiEvaluateCondition(hpkg, "&nofeature");
1528 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1530 MsiSetProperty(hpkg, "A", "2");
1531 MsiSetProperty(hpkg, "X", "50");
1533 r = MsiEvaluateCondition(hpkg, "2 <= X");
1534 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1536 r = MsiEvaluateCondition(hpkg, "A <= X");
1537 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1539 r = MsiEvaluateCondition(hpkg, "A <= 50");
1540 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1542 MsiSetProperty(hpkg, "X", "50val");
1544 r = MsiEvaluateCondition(hpkg, "2 <= X");
1545 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1547 r = MsiEvaluateCondition(hpkg, "A <= X");
1548 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1550 MsiSetProperty(hpkg, "A", "7");
1551 MsiSetProperty(hpkg, "X", "50");
1553 r = MsiEvaluateCondition(hpkg, "7 <= X");
1554 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1556 r = MsiEvaluateCondition(hpkg, "A <= X");
1557 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1559 r = MsiEvaluateCondition(hpkg, "A <= 50");
1560 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1562 MsiSetProperty(hpkg, "X", "50val");
1564 r = MsiEvaluateCondition(hpkg, "2 <= X");
1565 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1567 r = MsiEvaluateCondition(hpkg, "A <= X");
1568 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1570 MsiCloseHandle( hpkg );
1571 DeleteFile(msifile);
1574 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1576 UINT r;
1577 DWORD sz;
1578 char buffer[2];
1580 sz = sizeof buffer;
1581 strcpy(buffer,"x");
1582 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1583 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1586 static void test_props(void)
1588 MSIHANDLE hpkg, hdb;
1589 UINT r;
1590 DWORD sz;
1591 char buffer[0x100];
1593 hdb = create_package_db();
1594 r = run_query( hdb,
1595 "CREATE TABLE `Property` ( "
1596 "`Property` CHAR(255) NOT NULL, "
1597 "`Value` CHAR(255) "
1598 "PRIMARY KEY `Property`)" );
1599 ok( r == ERROR_SUCCESS , "Failed\n" );
1601 r = run_query(hdb,
1602 "INSERT INTO `Property` "
1603 "(`Property`, `Value`) "
1604 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1605 ok( r == ERROR_SUCCESS , "Failed\n" );
1607 hpkg = package_from_db( hdb );
1608 ok( hpkg, "failed to create package\n");
1610 /* test invalid values */
1611 r = MsiGetProperty( 0, NULL, NULL, NULL );
1612 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1614 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1615 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1617 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1618 ok( r == ERROR_SUCCESS, "wrong return val\n");
1620 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1621 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1623 /* test retrieving an empty/nonexistent property */
1624 sz = sizeof buffer;
1625 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1626 ok( r == ERROR_SUCCESS, "wrong return val\n");
1627 ok( sz == 0, "wrong size returned\n");
1629 check_prop_empty( hpkg, "boo");
1630 sz = 0;
1631 strcpy(buffer,"x");
1632 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1633 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1634 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1635 ok( sz == 0, "wrong size returned\n");
1637 sz = 1;
1638 strcpy(buffer,"x");
1639 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1640 ok( r == ERROR_SUCCESS, "wrong return val\n");
1641 ok( buffer[0] == 0, "buffer was not changed\n");
1642 ok( sz == 0, "wrong size returned\n");
1644 /* set the property to something */
1645 r = MsiSetProperty( 0, NULL, NULL );
1646 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1648 r = MsiSetProperty( hpkg, NULL, NULL );
1649 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1651 r = MsiSetProperty( hpkg, "", NULL );
1652 ok( r == ERROR_SUCCESS, "wrong return val\n");
1654 /* try set and get some illegal property identifiers */
1655 r = MsiSetProperty( hpkg, "", "asdf" );
1656 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1658 r = MsiSetProperty( hpkg, "=", "asdf" );
1659 ok( r == ERROR_SUCCESS, "wrong return val\n");
1661 r = MsiSetProperty( hpkg, " ", "asdf" );
1662 ok( r == ERROR_SUCCESS, "wrong return val\n");
1664 r = MsiSetProperty( hpkg, "'", "asdf" );
1665 ok( r == ERROR_SUCCESS, "wrong return val\n");
1667 sz = sizeof buffer;
1668 buffer[0]=0;
1669 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1670 ok( r == ERROR_SUCCESS, "wrong return val\n");
1671 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1673 /* set empty values */
1674 r = MsiSetProperty( hpkg, "boo", NULL );
1675 ok( r == ERROR_SUCCESS, "wrong return val\n");
1676 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1678 r = MsiSetProperty( hpkg, "boo", "" );
1679 ok( r == ERROR_SUCCESS, "wrong return val\n");
1680 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1682 /* set a non-empty value */
1683 r = MsiSetProperty( hpkg, "boo", "xyz" );
1684 ok( r == ERROR_SUCCESS, "wrong return val\n");
1686 sz = 1;
1687 strcpy(buffer,"x");
1688 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1689 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1690 ok( buffer[0] == 0, "buffer was not changed\n");
1691 ok( sz == 3, "wrong size returned\n");
1693 sz = 4;
1694 strcpy(buffer,"x");
1695 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1696 ok( r == ERROR_SUCCESS, "wrong return val\n");
1697 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1698 ok( sz == 3, "wrong size returned\n");
1700 sz = 3;
1701 strcpy(buffer,"x");
1702 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1703 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1704 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1705 ok( sz == 3, "wrong size returned\n");
1707 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1708 ok( r == ERROR_SUCCESS, "wrong return val\n");
1710 sz = 4;
1711 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1712 ok( r == ERROR_SUCCESS, "wrong return val\n");
1713 ok( !strcmp(buffer,""), "buffer wrong\n");
1714 ok( sz == 0, "wrong size returned\n");
1716 sz = 4;
1717 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1718 ok( r == ERROR_SUCCESS, "wrong return val\n");
1719 ok( !strcmp(buffer,""), "buffer wrong\n");
1720 ok( sz == 0, "wrong size returned\n");
1722 sz = 4;
1723 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1724 ok( r == ERROR_SUCCESS, "wrong return val\n");
1725 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1726 ok( sz == 3, "wrong size returned\n");
1728 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1729 ok( r == ERROR_SUCCESS, "wrong return val\n");
1731 sz = 0;
1732 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1733 ok( r == ERROR_SUCCESS, "return wrong\n");
1734 ok( sz == 13, "size wrong (%d)\n", sz);
1736 sz = 13;
1737 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1738 ok( r == ERROR_MORE_DATA, "return wrong\n");
1739 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1741 r = MsiSetProperty(hpkg, "property", "value");
1742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1744 sz = 6;
1745 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1746 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1747 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1749 r = MsiSetProperty(hpkg, "property", NULL);
1750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1752 sz = 6;
1753 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1755 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1757 MsiCloseHandle( hpkg );
1758 DeleteFile(msifile);
1761 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1763 MSIHANDLE hview, hrec;
1764 BOOL found;
1765 CHAR buffer[MAX_PATH];
1766 DWORD sz;
1767 UINT r;
1769 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1770 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1771 r = MsiViewExecute(hview, 0);
1772 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1774 found = FALSE;
1775 while (r == ERROR_SUCCESS && !found)
1777 r = MsiViewFetch(hview, &hrec);
1778 if (r != ERROR_SUCCESS) break;
1780 sz = MAX_PATH;
1781 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1782 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1784 sz = MAX_PATH;
1785 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1786 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1787 found = TRUE;
1790 MsiCloseHandle(hrec);
1793 MsiViewClose(hview);
1794 MsiCloseHandle(hview);
1796 return found;
1799 static void test_property_table(void)
1801 const char *query;
1802 UINT r;
1803 MSIHANDLE hpkg, hdb, hrec;
1804 char buffer[MAX_PATH];
1805 DWORD sz;
1806 BOOL found;
1808 hdb = create_package_db();
1809 ok( hdb, "failed to create package\n");
1811 hpkg = package_from_db(hdb);
1812 ok( hpkg, "failed to create package\n");
1814 MsiCloseHandle(hdb);
1816 hdb = MsiGetActiveDatabase(hpkg);
1818 query = "CREATE TABLE `_Property` ( "
1819 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1820 r = run_query(hdb, query);
1821 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1823 MsiCloseHandle(hdb);
1824 MsiCloseHandle(hpkg);
1825 DeleteFile(msifile);
1827 hdb = create_package_db();
1828 ok( hdb, "failed to create package\n");
1830 query = "CREATE TABLE `_Property` ( "
1831 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1832 r = run_query(hdb, query);
1833 ok(r == ERROR_SUCCESS, "failed to create table\n");
1835 query = "ALTER `_Property` ADD `foo` INTEGER";
1836 r = run_query(hdb, query);
1837 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1839 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1840 r = run_query(hdb, query);
1841 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1843 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1844 r = run_query(hdb, query);
1845 ok(r == ERROR_SUCCESS, "failed to add column\n");
1847 hpkg = package_from_db(hdb);
1848 todo_wine
1850 ok(!hpkg, "package should not be created\n");
1853 MsiCloseHandle(hdb);
1854 MsiCloseHandle(hpkg);
1855 DeleteFile(msifile);
1857 hdb = create_package_db();
1858 ok (hdb, "failed to create package database\n");
1860 r = create_property_table(hdb);
1861 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
1863 r = add_property_entry(hdb, "'prop', 'val'");
1864 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1866 hpkg = package_from_db(hdb);
1867 ok(hpkg, "failed to create package\n");
1869 MsiCloseHandle(hdb);
1871 sz = MAX_PATH;
1872 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
1873 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1874 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
1876 hdb = MsiGetActiveDatabase(hpkg);
1878 found = find_prop_in_property(hdb, "prop", "val");
1879 ok(found, "prop should be in the _Property table\n");
1881 r = add_property_entry(hdb, "'dantes', 'mercedes'");
1882 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1884 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1885 r = do_query(hdb, query, &hrec);
1886 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1888 found = find_prop_in_property(hdb, "dantes", "mercedes");
1889 ok(found == FALSE, "dantes should not be in the _Property table\n");
1891 sz = MAX_PATH;
1892 lstrcpy(buffer, "aaa");
1893 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
1894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1895 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
1897 r = MsiSetProperty(hpkg, "dantes", "mercedes");
1898 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1900 found = find_prop_in_property(hdb, "dantes", "mercedes");
1901 ok(found == TRUE, "dantes should be in the _Property table\n");
1903 MsiCloseHandle(hdb);
1904 MsiCloseHandle(hpkg);
1905 DeleteFile(msifile);
1908 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
1910 MSIHANDLE htab = 0;
1911 UINT res;
1913 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
1914 if( res == ERROR_SUCCESS )
1916 UINT r;
1918 r = MsiViewExecute( htab, hrec );
1919 if( r != ERROR_SUCCESS )
1921 res = r;
1922 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
1925 r = MsiViewClose( htab );
1926 if( r != ERROR_SUCCESS )
1927 res = r;
1929 r = MsiCloseHandle( htab );
1930 if( r != ERROR_SUCCESS )
1931 res = r;
1933 return res;
1936 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
1938 return try_query_param( hdb, szQuery, 0 );
1941 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
1943 MSIHANDLE summary;
1944 UINT r;
1946 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
1947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1949 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
1950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1952 r = MsiSummaryInfoPersist(summary);
1953 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1955 MsiCloseHandle(summary);
1958 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
1960 MSIHANDLE summary;
1961 UINT r;
1963 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
1964 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1966 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
1967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1969 r = MsiSummaryInfoPersist(summary);
1970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1972 MsiCloseHandle(summary);
1975 static void test_msipackage(void)
1977 MSIHANDLE hdb = 0, hpack = 100;
1978 UINT r;
1979 const char *query;
1980 char name[10];
1982 /* NULL szPackagePath */
1983 r = MsiOpenPackage(NULL, &hpack);
1984 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
1986 /* empty szPackagePath */
1987 r = MsiOpenPackage("", &hpack);
1988 todo_wine
1990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1993 if (r == ERROR_SUCCESS)
1994 MsiCloseHandle(hpack);
1996 /* nonexistent szPackagePath */
1997 r = MsiOpenPackage("nonexistent", &hpack);
1998 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2000 /* NULL hProduct */
2001 r = MsiOpenPackage(msifile, NULL);
2002 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2004 name[0]='#';
2005 name[1]=0;
2006 r = MsiOpenPackage(name, &hpack);
2007 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2009 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2012 /* database exists, but is emtpy */
2013 sprintf(name, "#%ld", hdb);
2014 r = MsiOpenPackage(name, &hpack);
2015 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2016 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2018 query = "CREATE TABLE `Property` ( "
2019 "`Property` CHAR(72), `Value` CHAR(0) "
2020 "PRIMARY KEY `Property`)";
2021 r = try_query(hdb, query);
2022 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2024 query = "CREATE TABLE `InstallExecuteSequence` ("
2025 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2026 "PRIMARY KEY `Action`)";
2027 r = try_query(hdb, query);
2028 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2030 /* a few key tables exist */
2031 sprintf(name, "#%ld", hdb);
2032 r = MsiOpenPackage(name, &hpack);
2033 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2034 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2036 MsiCloseHandle(hdb);
2037 DeleteFile(msifile);
2039 /* start with a clean database to show what constitutes a valid package */
2040 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2043 sprintf(name, "#%ld", hdb);
2045 /* The following summary information props must exist:
2046 * - PID_REVNUMBER
2047 * - PID_PAGECOUNT
2050 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2051 r = MsiOpenPackage(name, &hpack);
2052 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2053 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2055 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2056 r = MsiOpenPackage(name, &hpack);
2057 ok(r == ERROR_SUCCESS,
2058 "Expected ERROR_SUCCESS, got %d\n", r);
2060 MsiCloseHandle(hpack);
2061 MsiCloseHandle(hdb);
2062 DeleteFile(msifile);
2065 static void test_formatrecord2(void)
2067 MSIHANDLE hpkg, hrec ;
2068 char buffer[0x100];
2069 DWORD sz;
2070 UINT r;
2072 hpkg = package_from_db(create_package_db());
2073 ok( hpkg, "failed to create package\n");
2075 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2076 ok( r == ERROR_SUCCESS, "set property failed\n");
2078 hrec = MsiCreateRecord(2);
2079 ok(hrec, "create record failed\n");
2081 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2082 ok( r == ERROR_SUCCESS, "format record failed\n");
2084 buffer[0] = 0;
2085 sz = sizeof buffer;
2086 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2088 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2089 r = MsiRecordSetString(hrec, 1, "hoo");
2090 sz = sizeof buffer;
2091 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2092 ok( sz == 3, "size wrong\n");
2093 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2094 ok( r == ERROR_SUCCESS, "format failed\n");
2096 r = MsiRecordSetString(hrec, 0, "x[~]x");
2097 sz = sizeof buffer;
2098 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2099 ok( sz == 3, "size wrong\n");
2100 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2101 ok( r == ERROR_SUCCESS, "format failed\n");
2103 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2104 r = MsiRecordSetString(hrec, 1, "hoo");
2105 sz = sizeof buffer;
2106 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2107 ok( sz == 3, "size wrong\n");
2108 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2109 ok( r == ERROR_SUCCESS, "format failed\n");
2111 r = MsiRecordSetString(hrec, 0, "[\\[]");
2112 sz = sizeof buffer;
2113 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2114 ok( sz == 1, "size wrong\n");
2115 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2116 ok( r == ERROR_SUCCESS, "format failed\n");
2118 SetEnvironmentVariable("FOO", "BAR");
2119 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2120 sz = sizeof buffer;
2121 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2122 ok( sz == 3, "size wrong\n");
2123 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2124 ok( r == ERROR_SUCCESS, "format failed\n");
2126 r = MsiRecordSetString(hrec, 0, "[[1]]");
2127 r = MsiRecordSetString(hrec, 1, "%FOO");
2128 sz = sizeof buffer;
2129 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2130 ok( sz == 3, "size wrong\n");
2131 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2132 ok( r == ERROR_SUCCESS, "format failed\n");
2134 MsiCloseHandle( hrec );
2135 MsiCloseHandle( hpkg );
2136 DeleteFile(msifile);
2139 static void test_states(void)
2141 MSIHANDLE hpkg;
2142 UINT r;
2143 MSIHANDLE hdb;
2144 INSTALLSTATE state, action;
2146 static const CHAR msifile2[] = "winetest2.msi";
2147 static const CHAR msifile3[] = "winetest3.msi";
2149 hdb = create_package_db();
2150 ok ( hdb, "failed to create package database\n" );
2152 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2153 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2155 r = create_property_table( hdb );
2156 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2158 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2159 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2161 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2162 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2164 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2165 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2167 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2168 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2170 r = create_install_execute_sequence_table( hdb );
2171 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2173 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2174 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2176 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2177 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2179 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2180 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2182 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2183 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2185 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2186 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2188 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2189 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2191 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2192 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2194 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2195 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2197 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2198 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2200 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2201 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2203 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2204 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2206 r = create_media_table( hdb );
2207 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2209 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2210 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2212 r = create_feature_table( hdb );
2213 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2215 r = create_component_table( hdb );
2216 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2218 /* msidbFeatureAttributesFavorLocal */
2219 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2220 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2222 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2223 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2224 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2226 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2227 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2228 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2230 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2231 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2232 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2234 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2235 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2236 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2238 /* msidbFeatureAttributesFavorSource */
2239 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2240 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2242 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2243 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2244 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2246 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2247 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2248 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2250 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2251 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2252 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2254 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2255 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2256 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2258 /* msidbFeatureAttributesFavorSource */
2259 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2260 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2262 /* msidbFeatureAttributesFavorLocal */
2263 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2264 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2266 /* disabled */
2267 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2268 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2270 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2271 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2272 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2274 /* no feature parent:msidbComponentAttributesLocalOnly */
2275 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2276 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2278 /* msidbFeatureAttributesFavorLocal:removed */
2279 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2280 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2282 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2283 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2284 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2286 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2287 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2288 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2290 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2291 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2292 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2294 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2295 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2296 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2298 /* msidbFeatureAttributesFavorSource:removed */
2299 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2300 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2302 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2303 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2304 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2306 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2307 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2308 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2310 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2311 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2312 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2314 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2315 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2316 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2318 r = create_feature_components_table( hdb );
2319 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2321 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2322 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2324 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2325 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2327 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2328 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2330 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2331 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2333 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2334 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2336 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2337 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2339 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2340 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2342 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2343 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2345 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2346 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2348 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2349 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2351 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2352 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2354 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2355 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2357 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2358 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2360 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2361 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2363 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2364 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2366 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2367 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2369 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2370 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2372 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2373 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2375 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2376 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2378 r = create_file_table( hdb );
2379 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2381 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2382 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2384 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2385 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2387 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2388 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2390 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2391 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2393 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2394 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2396 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2397 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2399 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2400 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2402 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2403 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2405 /* compressed file */
2406 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2407 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2409 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2410 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2412 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2413 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2415 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2416 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2418 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2419 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2421 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2422 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2424 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2425 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2427 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2428 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2430 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2431 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2433 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2434 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2436 MsiDatabaseCommit(hdb);
2438 /* these properties must not be in the saved msi file */
2439 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2440 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2442 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2443 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2445 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2446 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2448 hpkg = package_from_db( hdb );
2449 ok( hpkg, "failed to create package\n");
2451 MsiCloseHandle(hdb);
2453 CopyFileA(msifile, msifile2, FALSE);
2454 CopyFileA(msifile, msifile3, FALSE);
2456 state = 0xdeadbee;
2457 action = 0xdeadbee;
2458 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2459 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2460 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2461 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2463 state = 0xdeadbee;
2464 action = 0xdeadbee;
2465 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2466 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2467 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2468 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2470 state = 0xdeadbee;
2471 action = 0xdeadbee;
2472 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2473 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2474 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2475 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2477 state = 0xdeadbee;
2478 action = 0xdeadbee;
2479 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2480 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2481 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2482 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2484 state = 0xdeadbee;
2485 action = 0xdeadbee;
2486 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2487 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2488 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2489 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2491 state = 0xdeadbee;
2492 action = 0xdeadbee;
2493 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2494 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2495 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2496 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2498 state = 0xdeadbee;
2499 action = 0xdeadbee;
2500 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2501 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2502 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2503 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2505 state = 0xdeadbee;
2506 action = 0xdeadbee;
2507 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2508 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2509 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2510 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2512 state = 0xdeadbee;
2513 action = 0xdeadbee;
2514 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2515 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2516 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2517 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2519 state = 0xdeadbee;
2520 action = 0xdeadbee;
2521 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2522 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2523 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2524 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2526 state = 0xdeadbee;
2527 action = 0xdeadbee;
2528 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2529 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2530 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2531 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2533 state = 0xdeadbee;
2534 action = 0xdeadbee;
2535 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2536 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2537 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2538 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2540 state = 0xdeadbee;
2541 action = 0xdeadbee;
2542 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2543 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2544 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2545 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2547 state = 0xdeadbee;
2548 action = 0xdeadbee;
2549 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2550 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2551 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2552 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2554 state = 0xdeadbee;
2555 action = 0xdeadbee;
2556 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2557 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2558 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2559 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2561 state = 0xdeadbee;
2562 action = 0xdeadbee;
2563 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2564 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2565 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2566 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2568 state = 0xdeadbee;
2569 action = 0xdeadbee;
2570 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2571 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2572 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2573 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2575 state = 0xdeadbee;
2576 action = 0xdeadbee;
2577 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2578 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2579 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2580 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2582 state = 0xdeadbee;
2583 action = 0xdeadbee;
2584 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2585 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2586 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2587 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2589 state = 0xdeadbee;
2590 action = 0xdeadbee;
2591 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2592 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2593 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2594 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2596 state = 0xdeadbee;
2597 action = 0xdeadbee;
2598 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2599 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2600 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2601 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2603 state = 0xdeadbee;
2604 action = 0xdeadbee;
2605 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2606 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2607 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2608 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2610 state = 0xdeadbee;
2611 action = 0xdeadbee;
2612 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2613 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2614 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2615 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2617 state = 0xdeadbee;
2618 action = 0xdeadbee;
2619 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2620 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2621 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2622 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2624 state = 0xdeadbee;
2625 action = 0xdeadbee;
2626 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2627 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2628 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2629 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2631 r = MsiDoAction( hpkg, "CostInitialize");
2632 ok( r == ERROR_SUCCESS, "cost init failed\n");
2634 state = 0xdeadbee;
2635 action = 0xdeadbee;
2636 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2638 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2639 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2641 state = 0xdeadbee;
2642 action = 0xdeadbee;
2643 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2645 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2646 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2648 state = 0xdeadbee;
2649 action = 0xdeadbee;
2650 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2652 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2653 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2655 state = 0xdeadbee;
2656 action = 0xdeadbee;
2657 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2659 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2660 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2662 state = 0xdeadbee;
2663 action = 0xdeadbee;
2664 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2666 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2667 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2669 state = 0xdeadbee;
2670 action = 0xdeadbee;
2671 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2673 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2674 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2676 state = 0xdeadbee;
2677 action = 0xdeadbee;
2678 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2680 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2681 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2683 state = 0xdeadbee;
2684 action = 0xdeadbee;
2685 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2687 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2688 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2690 state = 0xdeadbee;
2691 action = 0xdeadbee;
2692 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2694 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2695 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2697 state = 0xdeadbee;
2698 action = 0xdeadbee;
2699 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2701 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2702 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2704 state = 0xdeadbee;
2705 action = 0xdeadbee;
2706 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2708 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2709 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2711 state = 0xdeadbee;
2712 action = 0xdeadbee;
2713 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2715 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2716 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2718 state = 0xdeadbee;
2719 action = 0xdeadbee;
2720 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2722 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2723 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2725 state = 0xdeadbee;
2726 action = 0xdeadbee;
2727 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2729 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2730 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2732 state = 0xdeadbee;
2733 action = 0xdeadbee;
2734 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2736 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2737 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2739 state = 0xdeadbee;
2740 action = 0xdeadbee;
2741 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2743 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2744 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2746 state = 0xdeadbee;
2747 action = 0xdeadbee;
2748 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2750 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2751 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2753 state = 0xdeadbee;
2754 action = 0xdeadbee;
2755 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2757 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2758 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2760 state = 0xdeadbee;
2761 action = 0xdeadbee;
2762 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2764 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2765 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2767 state = 0xdeadbee;
2768 action = 0xdeadbee;
2769 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2770 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2771 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2772 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2774 state = 0xdeadbee;
2775 action = 0xdeadbee;
2776 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2777 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2778 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2779 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2781 state = 0xdeadbee;
2782 action = 0xdeadbee;
2783 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2784 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2785 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2786 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2788 state = 0xdeadbee;
2789 action = 0xdeadbee;
2790 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2791 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2792 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2793 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2795 state = 0xdeadbee;
2796 action = 0xdeadbee;
2797 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2798 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2799 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2800 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2802 state = 0xdeadbee;
2803 action = 0xdeadbee;
2804 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2805 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2806 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2807 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2809 r = MsiDoAction( hpkg, "FileCost");
2810 ok( r == ERROR_SUCCESS, "file cost failed\n");
2812 state = 0xdeadbee;
2813 action = 0xdeadbee;
2814 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2816 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2817 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2819 state = 0xdeadbee;
2820 action = 0xdeadbee;
2821 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2822 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2823 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2824 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2826 state = 0xdeadbee;
2827 action = 0xdeadbee;
2828 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2830 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2831 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2833 state = 0xdeadbee;
2834 action = 0xdeadbee;
2835 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2836 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2837 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2838 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2840 state = 0xdeadbee;
2841 action = 0xdeadbee;
2842 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2847 state = 0xdeadbee;
2848 action = 0xdeadbee;
2849 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2854 state = 0xdeadbee;
2855 action = 0xdeadbee;
2856 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2858 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2859 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2861 state = 0xdeadbee;
2862 action = 0xdeadbee;
2863 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2868 state = 0xdeadbee;
2869 action = 0xdeadbee;
2870 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2875 state = 0xdeadbee;
2876 action = 0xdeadbee;
2877 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2882 state = 0xdeadbee;
2883 action = 0xdeadbee;
2884 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2889 state = 0xdeadbee;
2890 action = 0xdeadbee;
2891 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2896 state = 0xdeadbee;
2897 action = 0xdeadbee;
2898 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2900 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2903 state = 0xdeadbee;
2904 action = 0xdeadbee;
2905 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2907 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2908 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2910 state = 0xdeadbee;
2911 action = 0xdeadbee;
2912 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2914 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2915 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2917 state = 0xdeadbee;
2918 action = 0xdeadbee;
2919 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2921 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2922 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2924 state = 0xdeadbee;
2925 action = 0xdeadbee;
2926 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2928 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2929 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2931 state = 0xdeadbee;
2932 action = 0xdeadbee;
2933 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2935 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2936 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2938 state = 0xdeadbee;
2939 action = 0xdeadbee;
2940 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2942 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2943 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2945 state = 0xdeadbee;
2946 action = 0xdeadbee;
2947 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2949 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2952 state = 0xdeadbee;
2953 action = 0xdeadbee;
2954 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2956 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2957 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2959 state = 0xdeadbee;
2960 action = 0xdeadbee;
2961 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2963 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2966 state = 0xdeadbee;
2967 action = 0xdeadbee;
2968 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2970 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2973 state = 0xdeadbee;
2974 action = 0xdeadbee;
2975 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2977 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2980 state = 0xdeadbee;
2981 action = 0xdeadbee;
2982 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2984 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2985 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2987 r = MsiDoAction( hpkg, "CostFinalize");
2988 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
2990 state = 0xdeadbee;
2991 action = 0xdeadbee;
2992 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2994 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
2995 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
2997 state = 0xdeadbee;
2998 action = 0xdeadbee;
2999 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3001 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3002 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3004 state = 0xdeadbee;
3005 action = 0xdeadbee;
3006 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3008 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3009 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3011 state = 0xdeadbee;
3012 action = 0xdeadbee;
3013 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3015 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3016 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3018 state = 0xdeadbee;
3019 action = 0xdeadbee;
3020 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3022 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3025 state = 0xdeadbee;
3026 action = 0xdeadbee;
3027 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3029 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3030 todo_wine
3032 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3035 state = 0xdeadbee;
3036 action = 0xdeadbee;
3037 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3039 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3040 todo_wine
3042 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3045 state = 0xdeadbee;
3046 action = 0xdeadbee;
3047 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3049 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3050 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3052 state = 0xdeadbee;
3053 action = 0xdeadbee;
3054 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3056 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3057 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3059 state = 0xdeadbee;
3060 action = 0xdeadbee;
3061 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3063 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3064 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3066 state = 0xdeadbee;
3067 action = 0xdeadbee;
3068 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3070 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3071 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3073 state = 0xdeadbee;
3074 action = 0xdeadbee;
3075 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3077 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3078 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3080 state = 0xdeadbee;
3081 action = 0xdeadbee;
3082 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3084 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3085 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3087 state = 0xdeadbee;
3088 action = 0xdeadbee;
3089 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3091 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3092 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3094 state = 0xdeadbee;
3095 action = 0xdeadbee;
3096 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3098 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3099 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3101 state = 0xdeadbee;
3102 action = 0xdeadbee;
3103 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3105 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3106 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3108 state = 0xdeadbee;
3109 action = 0xdeadbee;
3110 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3112 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3115 state = 0xdeadbee;
3116 action = 0xdeadbee;
3117 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3119 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3120 todo_wine
3122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3125 state = 0xdeadbee;
3126 action = 0xdeadbee;
3127 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3128 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3129 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3130 todo_wine
3132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3135 state = 0xdeadbee;
3136 action = 0xdeadbee;
3137 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3138 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3139 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3140 todo_wine
3142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3145 state = 0xdeadbee;
3146 action = 0xdeadbee;
3147 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3149 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3150 todo_wine
3152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3155 state = 0xdeadbee;
3156 action = 0xdeadbee;
3157 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3159 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3160 todo_wine
3162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3165 state = 0xdeadbee;
3166 action = 0xdeadbee;
3167 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3168 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3169 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3170 todo_wine
3172 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3175 state = 0xdeadbee;
3176 action = 0xdeadbee;
3177 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3179 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3180 todo_wine
3182 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3185 state = 0xdeadbee;
3186 action = 0xdeadbee;
3187 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3189 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3190 todo_wine
3192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3195 MsiCloseHandle( hpkg );
3197 /* publish the features and components */
3198 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3201 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3202 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3204 /* these properties must not be in the saved msi file */
3205 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3206 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3208 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3209 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3211 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3212 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3214 hpkg = package_from_db( hdb );
3215 ok( hpkg, "failed to create package\n");
3217 MsiCloseHandle(hdb);
3219 state = 0xdeadbee;
3220 action = 0xdeadbee;
3221 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3222 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3223 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3224 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3226 state = 0xdeadbee;
3227 action = 0xdeadbee;
3228 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3229 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3230 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3231 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3233 state = 0xdeadbee;
3234 action = 0xdeadbee;
3235 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3236 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3237 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3238 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3240 state = 0xdeadbee;
3241 action = 0xdeadbee;
3242 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3243 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3244 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3245 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3247 state = 0xdeadbee;
3248 action = 0xdeadbee;
3249 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3250 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3251 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3252 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3254 state = 0xdeadbee;
3255 action = 0xdeadbee;
3256 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3257 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3258 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3259 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3261 state = 0xdeadbee;
3262 action = 0xdeadbee;
3263 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3264 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3265 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3266 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3268 state = 0xdeadbee;
3269 action = 0xdeadbee;
3270 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3271 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3272 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3273 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3275 state = 0xdeadbee;
3276 action = 0xdeadbee;
3277 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3278 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3279 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3280 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3282 state = 0xdeadbee;
3283 action = 0xdeadbee;
3284 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3285 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3286 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3287 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3289 state = 0xdeadbee;
3290 action = 0xdeadbee;
3291 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3292 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3293 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3294 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3296 state = 0xdeadbee;
3297 action = 0xdeadbee;
3298 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3299 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3300 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3301 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3303 state = 0xdeadbee;
3304 action = 0xdeadbee;
3305 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3306 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3307 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3308 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3310 state = 0xdeadbee;
3311 action = 0xdeadbee;
3312 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3313 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3314 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3315 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3317 state = 0xdeadbee;
3318 action = 0xdeadbee;
3319 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3320 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3321 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3322 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3324 state = 0xdeadbee;
3325 action = 0xdeadbee;
3326 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3327 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3328 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3329 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3331 state = 0xdeadbee;
3332 action = 0xdeadbee;
3333 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3334 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3335 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3336 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3338 state = 0xdeadbee;
3339 action = 0xdeadbee;
3340 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3341 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3342 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3343 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3345 state = 0xdeadbee;
3346 action = 0xdeadbee;
3347 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3348 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3349 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3350 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3352 state = 0xdeadbee;
3353 action = 0xdeadbee;
3354 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3355 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3356 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3357 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3359 state = 0xdeadbee;
3360 action = 0xdeadbee;
3361 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3362 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3363 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3364 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3366 state = 0xdeadbee;
3367 action = 0xdeadbee;
3368 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3369 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3370 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3371 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3373 state = 0xdeadbee;
3374 action = 0xdeadbee;
3375 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3376 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3377 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3378 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3380 state = 0xdeadbee;
3381 action = 0xdeadbee;
3382 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3383 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3384 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3385 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3387 state = 0xdeadbee;
3388 action = 0xdeadbee;
3389 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3390 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3391 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3392 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3394 r = MsiDoAction( hpkg, "CostInitialize");
3395 ok( r == ERROR_SUCCESS, "cost init failed\n");
3397 state = 0xdeadbee;
3398 action = 0xdeadbee;
3399 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3400 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3401 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3402 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3404 state = 0xdeadbee;
3405 action = 0xdeadbee;
3406 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3408 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3409 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3411 state = 0xdeadbee;
3412 action = 0xdeadbee;
3413 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3415 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3416 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3418 state = 0xdeadbee;
3419 action = 0xdeadbee;
3420 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3422 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3423 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3425 state = 0xdeadbee;
3426 action = 0xdeadbee;
3427 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3429 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3430 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3432 state = 0xdeadbee;
3433 action = 0xdeadbee;
3434 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3436 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3437 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3439 state = 0xdeadbee;
3440 action = 0xdeadbee;
3441 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3443 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3444 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3446 state = 0xdeadbee;
3447 action = 0xdeadbee;
3448 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3450 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3451 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3453 state = 0xdeadbee;
3454 action = 0xdeadbee;
3455 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3457 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3458 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3460 state = 0xdeadbee;
3461 action = 0xdeadbee;
3462 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3464 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3465 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3467 state = 0xdeadbee;
3468 action = 0xdeadbee;
3469 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3471 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3472 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3474 state = 0xdeadbee;
3475 action = 0xdeadbee;
3476 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3478 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3479 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3481 state = 0xdeadbee;
3482 action = 0xdeadbee;
3483 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3485 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3486 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3488 state = 0xdeadbee;
3489 action = 0xdeadbee;
3490 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3492 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3493 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3495 state = 0xdeadbee;
3496 action = 0xdeadbee;
3497 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3499 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3500 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3502 state = 0xdeadbee;
3503 action = 0xdeadbee;
3504 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3506 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3507 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3509 state = 0xdeadbee;
3510 action = 0xdeadbee;
3511 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3513 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3514 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3516 state = 0xdeadbee;
3517 action = 0xdeadbee;
3518 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3520 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3521 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3523 state = 0xdeadbee;
3524 action = 0xdeadbee;
3525 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3527 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3530 state = 0xdeadbee;
3531 action = 0xdeadbee;
3532 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3534 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3535 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3537 state = 0xdeadbee;
3538 action = 0xdeadbee;
3539 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3541 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3542 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3544 state = 0xdeadbee;
3545 action = 0xdeadbee;
3546 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3548 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3549 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3551 state = 0xdeadbee;
3552 action = 0xdeadbee;
3553 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3555 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3558 state = 0xdeadbee;
3559 action = 0xdeadbee;
3560 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3562 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3563 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3565 state = 0xdeadbee;
3566 action = 0xdeadbee;
3567 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3569 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3570 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3572 r = MsiDoAction( hpkg, "FileCost");
3573 ok( r == ERROR_SUCCESS, "file cost failed\n");
3575 state = 0xdeadbee;
3576 action = 0xdeadbee;
3577 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3578 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3579 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3580 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3582 state = 0xdeadbee;
3583 action = 0xdeadbee;
3584 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3585 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3586 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3587 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3589 state = 0xdeadbee;
3590 action = 0xdeadbee;
3591 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3593 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3594 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3596 state = 0xdeadbee;
3597 action = 0xdeadbee;
3598 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3599 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3600 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3601 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3603 state = 0xdeadbee;
3604 action = 0xdeadbee;
3605 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3606 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3607 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3608 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3610 state = 0xdeadbee;
3611 action = 0xdeadbee;
3612 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3614 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3615 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3617 state = 0xdeadbee;
3618 action = 0xdeadbee;
3619 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3621 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3622 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3624 state = 0xdeadbee;
3625 action = 0xdeadbee;
3626 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3627 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3628 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3629 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3631 state = 0xdeadbee;
3632 action = 0xdeadbee;
3633 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3634 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3635 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3636 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3638 state = 0xdeadbee;
3639 action = 0xdeadbee;
3640 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3642 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3643 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3645 state = 0xdeadbee;
3646 action = 0xdeadbee;
3647 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3649 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3650 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3652 state = 0xdeadbee;
3653 action = 0xdeadbee;
3654 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3655 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3656 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3657 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3659 state = 0xdeadbee;
3660 action = 0xdeadbee;
3661 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3663 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3664 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3666 state = 0xdeadbee;
3667 action = 0xdeadbee;
3668 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3669 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3670 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3671 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3673 state = 0xdeadbee;
3674 action = 0xdeadbee;
3675 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3676 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3677 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3678 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3680 state = 0xdeadbee;
3681 action = 0xdeadbee;
3682 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3683 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3684 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3685 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3687 state = 0xdeadbee;
3688 action = 0xdeadbee;
3689 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3690 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3691 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3692 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3694 state = 0xdeadbee;
3695 action = 0xdeadbee;
3696 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3697 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3698 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3699 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3701 state = 0xdeadbee;
3702 action = 0xdeadbee;
3703 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3704 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3705 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3706 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3708 state = 0xdeadbee;
3709 action = 0xdeadbee;
3710 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3711 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3712 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3713 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3715 state = 0xdeadbee;
3716 action = 0xdeadbee;
3717 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3718 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3719 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3720 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3722 state = 0xdeadbee;
3723 action = 0xdeadbee;
3724 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3725 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3726 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3727 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3729 state = 0xdeadbee;
3730 action = 0xdeadbee;
3731 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3732 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3733 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3734 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3736 state = 0xdeadbee;
3737 action = 0xdeadbee;
3738 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3739 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3740 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3741 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3743 state = 0xdeadbee;
3744 action = 0xdeadbee;
3745 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3746 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3747 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3748 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3750 r = MsiDoAction( hpkg, "CostFinalize");
3751 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3753 state = 0xdeadbee;
3754 action = 0xdeadbee;
3755 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3757 todo_wine
3759 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3761 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3763 state = 0xdeadbee;
3764 action = 0xdeadbee;
3765 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3766 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3767 todo_wine
3769 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3771 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3773 state = 0xdeadbee;
3774 action = 0xdeadbee;
3775 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3776 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3777 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3778 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3780 state = 0xdeadbee;
3781 action = 0xdeadbee;
3782 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3784 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3785 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3787 state = 0xdeadbee;
3788 action = 0xdeadbee;
3789 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3791 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3792 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3794 state = 0xdeadbee;
3795 action = 0xdeadbee;
3796 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3798 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3799 todo_wine
3801 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3804 state = 0xdeadbee;
3805 action = 0xdeadbee;
3806 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3808 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3809 todo_wine
3811 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3814 state = 0xdeadbee;
3815 action = 0xdeadbee;
3816 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3818 todo_wine
3820 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3822 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3824 state = 0xdeadbee;
3825 action = 0xdeadbee;
3826 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3828 todo_wine
3830 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3832 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3834 state = 0xdeadbee;
3835 action = 0xdeadbee;
3836 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3837 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3838 todo_wine
3840 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3842 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3844 state = 0xdeadbee;
3845 action = 0xdeadbee;
3846 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3847 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3848 todo_wine
3850 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3852 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3854 state = 0xdeadbee;
3855 action = 0xdeadbee;
3856 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3858 todo_wine
3860 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3862 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3864 state = 0xdeadbee;
3865 action = 0xdeadbee;
3866 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3868 todo_wine
3870 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3871 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3874 state = 0xdeadbee;
3875 action = 0xdeadbee;
3876 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3877 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3878 todo_wine
3880 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3881 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3884 state = 0xdeadbee;
3885 action = 0xdeadbee;
3886 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3888 todo_wine
3890 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3892 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3894 state = 0xdeadbee;
3895 action = 0xdeadbee;
3896 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3898 todo_wine
3900 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3902 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3904 state = 0xdeadbee;
3905 action = 0xdeadbee;
3906 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3907 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3908 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3909 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3911 state = 0xdeadbee;
3912 action = 0xdeadbee;
3913 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3914 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3915 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3916 todo_wine
3918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3921 state = 0xdeadbee;
3922 action = 0xdeadbee;
3923 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3924 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3925 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3926 todo_wine
3928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3931 state = 0xdeadbee;
3932 action = 0xdeadbee;
3933 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3935 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3936 todo_wine
3938 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3941 state = 0xdeadbee;
3942 action = 0xdeadbee;
3943 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3945 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3946 todo_wine
3948 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3951 state = 0xdeadbee;
3952 action = 0xdeadbee;
3953 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3955 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3956 todo_wine
3958 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3961 state = 0xdeadbee;
3962 action = 0xdeadbee;
3963 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3964 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3965 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3966 todo_wine
3968 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3971 state = 0xdeadbee;
3972 action = 0xdeadbee;
3973 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3975 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3976 todo_wine
3978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3981 state = 0xdeadbee;
3982 action = 0xdeadbee;
3983 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3984 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3985 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3986 todo_wine
3988 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3991 MsiCloseHandle(hpkg);
3993 /* uninstall the product */
3994 r = MsiInstallProduct(msifile, "REMOVE=ALL");
3995 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3997 /* all features installed locally */
3998 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
3999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4001 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4002 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4004 /* these properties must not be in the saved msi file */
4005 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven'");
4006 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4008 hpkg = package_from_db( hdb );
4009 ok( hpkg, "failed to create package\n");
4011 state = 0xdeadbee;
4012 action = 0xdeadbee;
4013 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4014 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4015 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4016 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4018 state = 0xdeadbee;
4019 action = 0xdeadbee;
4020 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4021 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4022 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4023 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4025 state = 0xdeadbee;
4026 action = 0xdeadbee;
4027 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4028 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4029 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4030 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4032 state = 0xdeadbee;
4033 action = 0xdeadbee;
4034 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4035 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4036 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4037 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4039 state = 0xdeadbee;
4040 action = 0xdeadbee;
4041 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4042 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4043 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4044 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4046 state = 0xdeadbee;
4047 action = 0xdeadbee;
4048 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4049 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4050 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4051 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4053 state = 0xdeadbee;
4054 action = 0xdeadbee;
4055 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4056 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4057 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4058 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4060 state = 0xdeadbee;
4061 action = 0xdeadbee;
4062 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4063 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4064 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4065 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4067 state = 0xdeadbee;
4068 action = 0xdeadbee;
4069 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4070 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4071 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4072 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4074 state = 0xdeadbee;
4075 action = 0xdeadbee;
4076 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4077 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4078 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4079 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4081 state = 0xdeadbee;
4082 action = 0xdeadbee;
4083 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4084 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4085 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4086 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4088 state = 0xdeadbee;
4089 action = 0xdeadbee;
4090 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4091 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4092 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4093 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4095 state = 0xdeadbee;
4096 action = 0xdeadbee;
4097 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4098 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4099 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4100 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4102 state = 0xdeadbee;
4103 action = 0xdeadbee;
4104 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4105 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4106 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4107 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4109 state = 0xdeadbee;
4110 action = 0xdeadbee;
4111 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4112 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4113 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4114 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4116 state = 0xdeadbee;
4117 action = 0xdeadbee;
4118 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4119 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4120 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4121 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4123 state = 0xdeadbee;
4124 action = 0xdeadbee;
4125 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4126 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4127 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4128 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4130 state = 0xdeadbee;
4131 action = 0xdeadbee;
4132 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4133 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4134 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4135 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4137 state = 0xdeadbee;
4138 action = 0xdeadbee;
4139 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4140 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4141 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4142 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4144 state = 0xdeadbee;
4145 action = 0xdeadbee;
4146 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4147 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4148 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4149 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4151 state = 0xdeadbee;
4152 action = 0xdeadbee;
4153 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4154 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4155 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4156 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4158 state = 0xdeadbee;
4159 action = 0xdeadbee;
4160 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4161 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4162 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4163 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4165 state = 0xdeadbee;
4166 action = 0xdeadbee;
4167 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4168 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4169 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4170 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4172 state = 0xdeadbee;
4173 action = 0xdeadbee;
4174 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4175 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4176 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4177 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4179 state = 0xdeadbee;
4180 action = 0xdeadbee;
4181 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4182 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4183 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4184 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4186 r = MsiDoAction( hpkg, "CostInitialize");
4187 ok( r == ERROR_SUCCESS, "cost init failed\n");
4189 state = 0xdeadbee;
4190 action = 0xdeadbee;
4191 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4193 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4196 state = 0xdeadbee;
4197 action = 0xdeadbee;
4198 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4200 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4203 state = 0xdeadbee;
4204 action = 0xdeadbee;
4205 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4207 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4210 state = 0xdeadbee;
4211 action = 0xdeadbee;
4212 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4214 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4217 state = 0xdeadbee;
4218 action = 0xdeadbee;
4219 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4221 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4222 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4224 state = 0xdeadbee;
4225 action = 0xdeadbee;
4226 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4228 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4229 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4231 state = 0xdeadbee;
4232 action = 0xdeadbee;
4233 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4235 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, 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, "alpha", &state, &action);
4241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4242 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, 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, "beta", &state, &action);
4248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4249 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, 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, "gamma", &state, &action);
4255 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4256 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4257 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4259 state = 0xdeadbee;
4260 action = 0xdeadbee;
4261 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4262 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4263 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4264 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4266 state = 0xdeadbee;
4267 action = 0xdeadbee;
4268 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4269 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4270 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4271 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4273 state = 0xdeadbee;
4274 action = 0xdeadbee;
4275 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4276 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4277 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4278 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4280 state = 0xdeadbee;
4281 action = 0xdeadbee;
4282 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4283 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4284 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4285 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4287 state = 0xdeadbee;
4288 action = 0xdeadbee;
4289 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4290 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4291 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4292 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4294 state = 0xdeadbee;
4295 action = 0xdeadbee;
4296 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4297 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4298 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4299 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4301 state = 0xdeadbee;
4302 action = 0xdeadbee;
4303 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4305 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4306 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4308 state = 0xdeadbee;
4309 action = 0xdeadbee;
4310 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4311 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4312 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4313 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4315 state = 0xdeadbee;
4316 action = 0xdeadbee;
4317 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4318 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4319 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4320 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4322 state = 0xdeadbee;
4323 action = 0xdeadbee;
4324 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4325 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4326 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4327 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4329 state = 0xdeadbee;
4330 action = 0xdeadbee;
4331 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4332 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4333 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4334 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4336 state = 0xdeadbee;
4337 action = 0xdeadbee;
4338 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4339 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4340 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4341 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4343 state = 0xdeadbee;
4344 action = 0xdeadbee;
4345 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4346 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4347 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4348 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4350 state = 0xdeadbee;
4351 action = 0xdeadbee;
4352 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4353 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4354 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4355 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4357 state = 0xdeadbee;
4358 action = 0xdeadbee;
4359 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4360 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4361 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4362 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4364 r = MsiDoAction( hpkg, "FileCost");
4365 ok( r == ERROR_SUCCESS, "file cost failed\n");
4367 state = 0xdeadbee;
4368 action = 0xdeadbee;
4369 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4371 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4372 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4374 state = 0xdeadbee;
4375 action = 0xdeadbee;
4376 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4378 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4381 state = 0xdeadbee;
4382 action = 0xdeadbee;
4383 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4388 state = 0xdeadbee;
4389 action = 0xdeadbee;
4390 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4391 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4392 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4393 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4395 state = 0xdeadbee;
4396 action = 0xdeadbee;
4397 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4399 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4402 state = 0xdeadbee;
4403 action = 0xdeadbee;
4404 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4406 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4407 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4409 state = 0xdeadbee;
4410 action = 0xdeadbee;
4411 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4413 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4416 state = 0xdeadbee;
4417 action = 0xdeadbee;
4418 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4420 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4423 state = 0xdeadbee;
4424 action = 0xdeadbee;
4425 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4430 state = 0xdeadbee;
4431 action = 0xdeadbee;
4432 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4437 state = 0xdeadbee;
4438 action = 0xdeadbee;
4439 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4441 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4442 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4444 state = 0xdeadbee;
4445 action = 0xdeadbee;
4446 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4448 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4449 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4451 state = 0xdeadbee;
4452 action = 0xdeadbee;
4453 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4455 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4456 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4458 state = 0xdeadbee;
4459 action = 0xdeadbee;
4460 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4462 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4463 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4465 state = 0xdeadbee;
4466 action = 0xdeadbee;
4467 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4469 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4472 state = 0xdeadbee;
4473 action = 0xdeadbee;
4474 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4475 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4476 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4477 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4479 state = 0xdeadbee;
4480 action = 0xdeadbee;
4481 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4482 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4483 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4484 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4486 state = 0xdeadbee;
4487 action = 0xdeadbee;
4488 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4490 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4491 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4493 state = 0xdeadbee;
4494 action = 0xdeadbee;
4495 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4496 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4497 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4498 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4500 state = 0xdeadbee;
4501 action = 0xdeadbee;
4502 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4503 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4504 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4505 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4507 state = 0xdeadbee;
4508 action = 0xdeadbee;
4509 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4510 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4511 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4512 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4514 state = 0xdeadbee;
4515 action = 0xdeadbee;
4516 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4517 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4518 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4519 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4521 state = 0xdeadbee;
4522 action = 0xdeadbee;
4523 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4525 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4526 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4528 state = 0xdeadbee;
4529 action = 0xdeadbee;
4530 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4531 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4532 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4533 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4535 state = 0xdeadbee;
4536 action = 0xdeadbee;
4537 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4538 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4539 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4540 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4542 r = MsiDoAction( hpkg, "CostFinalize");
4543 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4545 state = 0xdeadbee;
4546 action = 0xdeadbee;
4547 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4549 todo_wine
4551 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4553 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4555 state = 0xdeadbee;
4556 action = 0xdeadbee;
4557 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4559 todo_wine
4561 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4563 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4565 state = 0xdeadbee;
4566 action = 0xdeadbee;
4567 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4569 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4570 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4572 state = 0xdeadbee;
4573 action = 0xdeadbee;
4574 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4576 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4577 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4579 state = 0xdeadbee;
4580 action = 0xdeadbee;
4581 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4583 todo_wine
4585 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4586 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4589 state = 0xdeadbee;
4590 action = 0xdeadbee;
4591 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4593 todo_wine
4595 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4597 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4599 state = 0xdeadbee;
4600 action = 0xdeadbee;
4601 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4603 todo_wine
4605 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4607 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4609 state = 0xdeadbee;
4610 action = 0xdeadbee;
4611 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4613 todo_wine
4615 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4617 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4619 state = 0xdeadbee;
4620 action = 0xdeadbee;
4621 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4622 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4623 todo_wine
4625 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4626 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4629 state = 0xdeadbee;
4630 action = 0xdeadbee;
4631 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4633 todo_wine
4635 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4637 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4639 state = 0xdeadbee;
4640 action = 0xdeadbee;
4641 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4643 todo_wine
4645 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4647 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4649 state = 0xdeadbee;
4650 action = 0xdeadbee;
4651 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4653 todo_wine
4655 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4657 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4659 state = 0xdeadbee;
4660 action = 0xdeadbee;
4661 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4663 todo_wine
4665 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4667 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4669 state = 0xdeadbee;
4670 action = 0xdeadbee;
4671 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4673 todo_wine
4675 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4677 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4679 state = 0xdeadbee;
4680 action = 0xdeadbee;
4681 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4683 todo_wine
4685 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4687 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4689 state = 0xdeadbee;
4690 action = 0xdeadbee;
4691 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4692 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4693 todo_wine
4695 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4697 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4699 state = 0xdeadbee;
4700 action = 0xdeadbee;
4701 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4703 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4704 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4706 state = 0xdeadbee;
4707 action = 0xdeadbee;
4708 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4710 todo_wine
4712 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4713 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4716 state = 0xdeadbee;
4717 action = 0xdeadbee;
4718 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4719 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4720 todo_wine
4722 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4723 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4726 state = 0xdeadbee;
4727 action = 0xdeadbee;
4728 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4730 todo_wine
4732 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4733 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4736 state = 0xdeadbee;
4737 action = 0xdeadbee;
4738 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4739 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4740 todo_wine
4742 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4743 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4746 state = 0xdeadbee;
4747 action = 0xdeadbee;
4748 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4750 todo_wine
4752 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4753 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4756 state = 0xdeadbee;
4757 action = 0xdeadbee;
4758 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4759 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4760 todo_wine
4762 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4764 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4766 state = 0xdeadbee;
4767 action = 0xdeadbee;
4768 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4769 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4770 todo_wine
4772 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4773 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4776 state = 0xdeadbee;
4777 action = 0xdeadbee;
4778 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4779 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4780 todo_wine
4782 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4783 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4786 MsiCloseHandle(hpkg);
4788 /* uninstall the product */
4789 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
4790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4792 /* all features installed from source */
4793 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
4794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4796 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
4797 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4799 /* this property must not be in the saved msi file */
4800 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven'");
4801 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4803 hpkg = package_from_db( hdb );
4804 ok( hpkg, "failed to create package\n");
4806 state = 0xdeadbee;
4807 action = 0xdeadbee;
4808 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4809 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4810 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4811 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4813 state = 0xdeadbee;
4814 action = 0xdeadbee;
4815 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4816 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4817 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4818 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4820 state = 0xdeadbee;
4821 action = 0xdeadbee;
4822 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4823 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4824 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4825 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4827 state = 0xdeadbee;
4828 action = 0xdeadbee;
4829 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4830 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4831 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4832 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4834 state = 0xdeadbee;
4835 action = 0xdeadbee;
4836 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4837 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4838 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4839 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4841 state = 0xdeadbee;
4842 action = 0xdeadbee;
4843 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4844 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4845 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4846 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4848 state = 0xdeadbee;
4849 action = 0xdeadbee;
4850 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4851 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4855 state = 0xdeadbee;
4856 action = 0xdeadbee;
4857 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4858 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4862 state = 0xdeadbee;
4863 action = 0xdeadbee;
4864 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4865 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4869 state = 0xdeadbee;
4870 action = 0xdeadbee;
4871 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4872 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4876 state = 0xdeadbee;
4877 action = 0xdeadbee;
4878 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4879 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4883 state = 0xdeadbee;
4884 action = 0xdeadbee;
4885 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4886 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4890 state = 0xdeadbee;
4891 action = 0xdeadbee;
4892 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4893 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4897 state = 0xdeadbee;
4898 action = 0xdeadbee;
4899 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4900 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4904 state = 0xdeadbee;
4905 action = 0xdeadbee;
4906 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4907 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4911 state = 0xdeadbee;
4912 action = 0xdeadbee;
4913 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4914 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4918 state = 0xdeadbee;
4919 action = 0xdeadbee;
4920 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4921 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4925 state = 0xdeadbee;
4926 action = 0xdeadbee;
4927 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4928 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4932 state = 0xdeadbee;
4933 action = 0xdeadbee;
4934 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4935 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4939 state = 0xdeadbee;
4940 action = 0xdeadbee;
4941 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4942 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4946 state = 0xdeadbee;
4947 action = 0xdeadbee;
4948 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4949 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4953 state = 0xdeadbee;
4954 action = 0xdeadbee;
4955 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4956 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4960 state = 0xdeadbee;
4961 action = 0xdeadbee;
4962 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4963 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4967 state = 0xdeadbee;
4968 action = 0xdeadbee;
4969 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4970 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4971 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4972 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4974 state = 0xdeadbee;
4975 action = 0xdeadbee;
4976 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4977 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4978 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4979 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4981 r = MsiDoAction( hpkg, "CostInitialize");
4982 ok( r == ERROR_SUCCESS, "cost init failed\n");
4984 state = 0xdeadbee;
4985 action = 0xdeadbee;
4986 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4991 state = 0xdeadbee;
4992 action = 0xdeadbee;
4993 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4998 state = 0xdeadbee;
4999 action = 0xdeadbee;
5000 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5005 state = 0xdeadbee;
5006 action = 0xdeadbee;
5007 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5012 state = 0xdeadbee;
5013 action = 0xdeadbee;
5014 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5019 state = 0xdeadbee;
5020 action = 0xdeadbee;
5021 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5026 state = 0xdeadbee;
5027 action = 0xdeadbee;
5028 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5033 state = 0xdeadbee;
5034 action = 0xdeadbee;
5035 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5040 state = 0xdeadbee;
5041 action = 0xdeadbee;
5042 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5047 state = 0xdeadbee;
5048 action = 0xdeadbee;
5049 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5054 state = 0xdeadbee;
5055 action = 0xdeadbee;
5056 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5061 state = 0xdeadbee;
5062 action = 0xdeadbee;
5063 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5068 state = 0xdeadbee;
5069 action = 0xdeadbee;
5070 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5075 state = 0xdeadbee;
5076 action = 0xdeadbee;
5077 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5082 state = 0xdeadbee;
5083 action = 0xdeadbee;
5084 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5089 state = 0xdeadbee;
5090 action = 0xdeadbee;
5091 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5096 state = 0xdeadbee;
5097 action = 0xdeadbee;
5098 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5103 state = 0xdeadbee;
5104 action = 0xdeadbee;
5105 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5110 state = 0xdeadbee;
5111 action = 0xdeadbee;
5112 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5117 state = 0xdeadbee;
5118 action = 0xdeadbee;
5119 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5124 state = 0xdeadbee;
5125 action = 0xdeadbee;
5126 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5131 state = 0xdeadbee;
5132 action = 0xdeadbee;
5133 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5138 state = 0xdeadbee;
5139 action = 0xdeadbee;
5140 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5145 state = 0xdeadbee;
5146 action = 0xdeadbee;
5147 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5152 state = 0xdeadbee;
5153 action = 0xdeadbee;
5154 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5159 r = MsiDoAction( hpkg, "FileCost");
5160 ok( r == ERROR_SUCCESS, "file cost failed\n");
5162 state = 0xdeadbee;
5163 action = 0xdeadbee;
5164 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5169 state = 0xdeadbee;
5170 action = 0xdeadbee;
5171 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5176 state = 0xdeadbee;
5177 action = 0xdeadbee;
5178 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5183 state = 0xdeadbee;
5184 action = 0xdeadbee;
5185 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5190 state = 0xdeadbee;
5191 action = 0xdeadbee;
5192 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5197 state = 0xdeadbee;
5198 action = 0xdeadbee;
5199 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5204 state = 0xdeadbee;
5205 action = 0xdeadbee;
5206 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5211 state = 0xdeadbee;
5212 action = 0xdeadbee;
5213 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5218 state = 0xdeadbee;
5219 action = 0xdeadbee;
5220 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5225 state = 0xdeadbee;
5226 action = 0xdeadbee;
5227 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5232 state = 0xdeadbee;
5233 action = 0xdeadbee;
5234 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5239 state = 0xdeadbee;
5240 action = 0xdeadbee;
5241 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5246 state = 0xdeadbee;
5247 action = 0xdeadbee;
5248 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5253 state = 0xdeadbee;
5254 action = 0xdeadbee;
5255 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5260 state = 0xdeadbee;
5261 action = 0xdeadbee;
5262 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5267 state = 0xdeadbee;
5268 action = 0xdeadbee;
5269 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5274 state = 0xdeadbee;
5275 action = 0xdeadbee;
5276 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5281 state = 0xdeadbee;
5282 action = 0xdeadbee;
5283 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5288 state = 0xdeadbee;
5289 action = 0xdeadbee;
5290 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5295 state = 0xdeadbee;
5296 action = 0xdeadbee;
5297 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5302 state = 0xdeadbee;
5303 action = 0xdeadbee;
5304 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5309 state = 0xdeadbee;
5310 action = 0xdeadbee;
5311 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5316 state = 0xdeadbee;
5317 action = 0xdeadbee;
5318 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5323 state = 0xdeadbee;
5324 action = 0xdeadbee;
5325 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5330 state = 0xdeadbee;
5331 action = 0xdeadbee;
5332 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5337 r = MsiDoAction( hpkg, "CostFinalize");
5338 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5340 state = 0xdeadbee;
5341 action = 0xdeadbee;
5342 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5344 todo_wine
5346 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5347 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5350 state = 0xdeadbee;
5351 action = 0xdeadbee;
5352 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5353 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5354 todo_wine
5356 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5357 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5360 state = 0xdeadbee;
5361 action = 0xdeadbee;
5362 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5363 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5364 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5365 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5367 state = 0xdeadbee;
5368 action = 0xdeadbee;
5369 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5371 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5372 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5374 state = 0xdeadbee;
5375 action = 0xdeadbee;
5376 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5378 todo_wine
5380 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5381 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5384 state = 0xdeadbee;
5385 action = 0xdeadbee;
5386 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5388 todo_wine
5390 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5391 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5394 state = 0xdeadbee;
5395 action = 0xdeadbee;
5396 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5398 todo_wine
5400 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5401 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5404 state = 0xdeadbee;
5405 action = 0xdeadbee;
5406 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5408 todo_wine
5410 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5411 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5414 state = 0xdeadbee;
5415 action = 0xdeadbee;
5416 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5418 todo_wine
5420 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5424 state = 0xdeadbee;
5425 action = 0xdeadbee;
5426 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5428 todo_wine
5430 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5431 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5434 state = 0xdeadbee;
5435 action = 0xdeadbee;
5436 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5437 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5438 todo_wine
5440 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5441 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5444 state = 0xdeadbee;
5445 action = 0xdeadbee;
5446 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5448 todo_wine
5450 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5452 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5454 state = 0xdeadbee;
5455 action = 0xdeadbee;
5456 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5458 todo_wine
5460 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5461 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5464 state = 0xdeadbee;
5465 action = 0xdeadbee;
5466 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5468 todo_wine
5470 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5474 state = 0xdeadbee;
5475 action = 0xdeadbee;
5476 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5478 todo_wine
5480 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5482 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5484 state = 0xdeadbee;
5485 action = 0xdeadbee;
5486 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5487 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5488 todo_wine
5490 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5492 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5494 state = 0xdeadbee;
5495 action = 0xdeadbee;
5496 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5498 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, 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, "lambda", &state, &action);
5504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5505 todo_wine
5507 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5508 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5511 state = 0xdeadbee;
5512 action = 0xdeadbee;
5513 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5514 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5515 todo_wine
5517 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5521 state = 0xdeadbee;
5522 action = 0xdeadbee;
5523 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5525 todo_wine
5527 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5531 state = 0xdeadbee;
5532 action = 0xdeadbee;
5533 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5534 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5535 todo_wine
5537 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5538 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5541 state = 0xdeadbee;
5542 action = 0xdeadbee;
5543 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5545 todo_wine
5547 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5548 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5551 state = 0xdeadbee;
5552 action = 0xdeadbee;
5553 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5555 todo_wine
5557 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5558 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5561 state = 0xdeadbee;
5562 action = 0xdeadbee;
5563 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5564 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5565 todo_wine
5567 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5568 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5571 state = 0xdeadbee;
5572 action = 0xdeadbee;
5573 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5575 todo_wine
5577 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5578 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5581 MsiCloseHandle(hpkg);
5583 /* uninstall the product */
5584 r = MsiInstallProduct(msifile3, "REMOVE=ALL");
5585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5587 DeleteFileA(msifile);
5588 DeleteFileA(msifile2);
5589 DeleteFileA(msifile3);
5592 static void test_getproperty(void)
5594 MSIHANDLE hPackage = 0;
5595 char prop[100];
5596 static CHAR empty[] = "";
5597 DWORD size;
5598 UINT r;
5600 hPackage = package_from_db(create_package_db());
5601 ok( hPackage != 0, " Failed to create package\n");
5603 /* set the property */
5604 r = MsiSetProperty(hPackage, "Name", "Value");
5605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5607 /* retrieve the size, NULL pointer */
5608 size = 0;
5609 r = MsiGetProperty(hPackage, "Name", NULL, &size);
5610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5611 ok( size == 5, "Expected 5, got %d\n", size);
5613 /* retrieve the size, empty string */
5614 size = 0;
5615 r = MsiGetProperty(hPackage, "Name", empty, &size);
5616 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5617 ok( size == 5, "Expected 5, got %d\n", size);
5619 /* don't change size */
5620 r = MsiGetProperty(hPackage, "Name", prop, &size);
5621 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5622 ok( size == 5, "Expected 5, got %d\n", size);
5623 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
5625 /* increase the size by 1 */
5626 size++;
5627 r = MsiGetProperty(hPackage, "Name", prop, &size);
5628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5629 ok( size == 5, "Expected 5, got %d\n", size);
5630 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
5632 r = MsiCloseHandle( hPackage);
5633 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
5634 DeleteFile(msifile);
5637 static void test_removefiles(void)
5639 MSIHANDLE hpkg;
5640 UINT r;
5641 MSIHANDLE hdb;
5643 hdb = create_package_db();
5644 ok ( hdb, "failed to create package database\n" );
5646 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
5647 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
5649 r = create_feature_table( hdb );
5650 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
5652 r = create_component_table( hdb );
5653 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
5655 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
5656 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5658 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
5659 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5661 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
5662 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5664 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
5665 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5667 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
5668 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5670 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
5671 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5673 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
5674 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5676 r = create_feature_components_table( hdb );
5677 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
5679 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
5680 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5682 r = add_feature_components_entry( hdb, "'one', 'helium'" );
5683 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5685 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
5686 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5688 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
5689 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5691 r = add_feature_components_entry( hdb, "'one', 'boron'" );
5692 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5694 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
5695 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5697 r = create_file_table( hdb );
5698 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
5700 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
5701 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5703 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
5704 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5706 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
5707 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5709 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
5710 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5712 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
5713 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5715 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
5716 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5718 r = create_remove_file_table( hdb );
5719 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
5721 hpkg = package_from_db( hdb );
5722 ok( hpkg, "failed to create package\n");
5724 MsiCloseHandle( hdb );
5726 create_test_file( "hydrogen.txt" );
5727 create_test_file( "helium.txt" );
5728 create_test_file( "lithium.txt" );
5729 create_test_file( "beryllium.txt" );
5730 create_test_file( "boron.txt" );
5731 create_test_file( "carbon.txt" );
5733 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
5734 ok( r == ERROR_SUCCESS, "set property failed\n");
5736 r = MsiDoAction( hpkg, "CostInitialize");
5737 ok( r == ERROR_SUCCESS, "cost init failed\n");
5739 r = MsiDoAction( hpkg, "FileCost");
5740 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5742 r = MsiDoAction( hpkg, "CostFinalize");
5743 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5745 r = MsiDoAction( hpkg, "InstallValidate");
5746 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5748 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
5749 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5751 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
5752 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5754 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
5755 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5757 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
5758 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5760 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
5761 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5763 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
5764 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5766 r = MsiDoAction( hpkg, "RemoveFiles");
5767 ok( r == ERROR_SUCCESS, "remove files failed\n");
5769 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
5770 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
5771 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
5772 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
5773 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
5774 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
5776 MsiCloseHandle( hpkg );
5777 DeleteFileA(msifile);
5780 static void test_appsearch(void)
5782 MSIHANDLE hpkg;
5783 UINT r;
5784 MSIHANDLE hdb;
5785 CHAR prop[MAX_PATH];
5786 DWORD size = MAX_PATH;
5788 hdb = create_package_db();
5789 ok ( hdb, "failed to create package database\n" );
5791 r = create_appsearch_table( hdb );
5792 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
5794 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
5795 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
5797 r = create_reglocator_table( hdb );
5798 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5800 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
5801 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5803 r = create_signature_table( hdb );
5804 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5806 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
5807 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5809 hpkg = package_from_db( hdb );
5810 ok( hpkg, "failed to create package\n");
5812 MsiCloseHandle( hdb );
5814 r = MsiDoAction( hpkg, "AppSearch" );
5815 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
5817 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
5818 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
5819 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
5821 MsiCloseHandle( hpkg );
5822 DeleteFileA(msifile);
5825 static void test_featureparents(void)
5827 MSIHANDLE hpkg;
5828 UINT r;
5829 MSIHANDLE hdb;
5830 INSTALLSTATE state, action;
5832 hdb = create_package_db();
5833 ok ( hdb, "failed to create package database\n" );
5835 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
5836 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
5838 r = create_feature_table( hdb );
5839 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
5841 r = create_component_table( hdb );
5842 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
5844 r = create_feature_components_table( hdb );
5845 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
5847 r = create_file_table( hdb );
5848 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
5850 /* msidbFeatureAttributesFavorLocal */
5851 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
5852 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5854 /* msidbFeatureAttributesFavorSource */
5855 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
5856 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5858 /* msidbFeatureAttributesFavorLocal */
5859 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
5860 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5862 /* disabled because of install level */
5863 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
5864 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5866 /* child feature of disabled feature */
5867 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
5868 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5870 /* component of disabled feature (install level) */
5871 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
5872 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5874 /* component of disabled child feature (install level) */
5875 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
5876 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5878 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5879 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
5880 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5882 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5883 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
5884 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5886 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5887 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
5888 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5890 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
5891 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
5892 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5894 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
5895 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
5896 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5898 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
5899 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
5900 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5902 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5903 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
5904 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5906 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5907 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
5908 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5910 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5911 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
5913 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
5914 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5916 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
5917 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5919 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
5920 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5922 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
5923 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5925 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
5926 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5928 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
5929 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5931 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
5932 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5934 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
5935 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5937 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
5938 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5940 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
5941 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5943 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
5944 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5946 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
5947 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5949 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
5950 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5952 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
5953 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5955 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
5956 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5958 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
5959 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5961 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
5962 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5964 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
5965 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5967 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
5968 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5970 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
5971 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5973 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
5974 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5976 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
5977 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5979 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
5980 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5982 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
5983 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5985 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
5986 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5988 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
5989 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5991 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
5992 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5994 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
5995 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5997 hpkg = package_from_db( hdb );
5998 ok( hpkg, "failed to create package\n");
6000 MsiCloseHandle( hdb );
6002 r = MsiDoAction( hpkg, "CostInitialize");
6003 ok( r == ERROR_SUCCESS, "cost init failed\n");
6005 r = MsiDoAction( hpkg, "FileCost");
6006 ok( r == ERROR_SUCCESS, "file cost failed\n");
6008 r = MsiDoAction( hpkg, "CostFinalize");
6009 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
6011 state = 0xdeadbee;
6012 action = 0xdeadbee;
6013 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
6014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6015 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6016 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6018 state = 0xdeadbee;
6019 action = 0xdeadbee;
6020 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
6021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6022 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6023 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6025 state = 0xdeadbee;
6026 action = 0xdeadbee;
6027 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
6028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6029 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6030 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6032 state = 0xdeadbee;
6033 action = 0xdeadbee;
6034 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
6035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6036 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6037 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6039 state = 0xdeadbee;
6040 action = 0xdeadbee;
6041 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
6042 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6043 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6044 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6046 state = 0xdeadbee;
6047 action = 0xdeadbee;
6048 r = MsiGetComponentState(hpkg, "leo", &state, &action);
6049 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6050 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6051 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6053 state = 0xdeadbee;
6054 action = 0xdeadbee;
6055 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
6056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6057 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
6058 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
6060 state = 0xdeadbee;
6061 action = 0xdeadbee;
6062 r = MsiGetComponentState(hpkg, "libra", &state, &action);
6063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6064 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
6065 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
6067 state = 0xdeadbee;
6068 action = 0xdeadbee;
6069 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
6070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6071 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
6072 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
6074 state = 0xdeadbee;
6075 action = 0xdeadbee;
6076 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
6077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6078 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
6079 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
6081 state = 0xdeadbee;
6082 action = 0xdeadbee;
6083 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
6084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6085 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
6086 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
6088 state = 0xdeadbee;
6089 action = 0xdeadbee;
6090 r = MsiGetComponentState(hpkg, "canis", &state, &action);
6091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6092 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
6093 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
6095 state = 0xdeadbee;
6096 action = 0xdeadbee;
6097 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
6098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6099 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
6100 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
6102 state = 0xdeadbee;
6103 action = 0xdeadbee;
6104 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
6105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6106 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
6107 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
6109 state = 0xdeadbee;
6110 action = 0xdeadbee;
6111 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
6112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6113 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
6114 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
6116 state = 0xdeadbee;
6117 action = 0xdeadbee;
6118 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
6119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6120 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
6121 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
6123 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
6124 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
6126 state = 0xdeadbee;
6127 action = 0xdeadbee;
6128 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
6129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6130 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
6131 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
6133 state = 0xdeadbee;
6134 action = 0xdeadbee;
6135 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
6136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6137 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
6138 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
6140 state = 0xdeadbee;
6141 action = 0xdeadbee;
6142 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
6143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6144 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
6145 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
6147 state = 0xdeadbee;
6148 action = 0xdeadbee;
6149 r = MsiGetComponentState(hpkg, "leo", &state, &action);
6150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6151 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
6152 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
6154 state = 0xdeadbee;
6155 action = 0xdeadbee;
6156 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
6157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6158 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
6159 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
6161 state = 0xdeadbee;
6162 action = 0xdeadbee;
6163 r = MsiGetComponentState(hpkg, "libra", &state, &action);
6164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6165 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
6166 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
6168 state = 0xdeadbee;
6169 action = 0xdeadbee;
6170 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
6171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6172 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
6173 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
6175 state = 0xdeadbee;
6176 action = 0xdeadbee;
6177 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
6178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6179 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
6180 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
6182 state = 0xdeadbee;
6183 action = 0xdeadbee;
6184 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
6185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6186 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
6187 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
6189 state = 0xdeadbee;
6190 action = 0xdeadbee;
6191 r = MsiGetComponentState(hpkg, "canis", &state, &action);
6192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6193 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
6194 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
6196 state = 0xdeadbee;
6197 action = 0xdeadbee;
6198 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
6199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6200 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
6201 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
6203 state = 0xdeadbee;
6204 action = 0xdeadbee;
6205 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
6206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6207 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
6208 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
6210 state = 0xdeadbee;
6211 action = 0xdeadbee;
6212 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
6213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6214 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
6215 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
6217 state = 0xdeadbee;
6218 action = 0xdeadbee;
6219 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
6220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6221 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
6222 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
6224 MsiCloseHandle(hpkg);
6225 DeleteFileA(msifile);
6228 static void test_installprops(void)
6230 MSIHANDLE hpkg, hdb;
6231 CHAR path[MAX_PATH];
6232 CHAR buf[MAX_PATH];
6233 DWORD size, type;
6234 LANGID langid;
6235 HKEY hkey1, hkey2;
6236 int res;
6237 UINT r;
6239 GetCurrentDirectory(MAX_PATH, path);
6240 lstrcat(path, "\\");
6241 lstrcat(path, msifile);
6243 hdb = create_package_db();
6244 ok( hdb, "failed to create database\n");
6246 hpkg = package_from_db(hdb);
6247 ok( hpkg, "failed to create package\n");
6249 MsiCloseHandle(hdb);
6251 size = MAX_PATH;
6252 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
6253 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6254 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6256 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
6258 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
6260 size = MAX_PATH;
6261 type = REG_SZ;
6262 *path = '\0';
6263 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
6265 size = MAX_PATH;
6266 type = REG_SZ;
6267 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
6270 /* win9x doesn't set this */
6271 if (*path)
6273 size = MAX_PATH;
6274 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
6275 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6276 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6279 size = MAX_PATH;
6280 type = REG_SZ;
6281 *path = '\0';
6282 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
6284 size = MAX_PATH;
6285 type = REG_SZ;
6286 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
6289 if (*path)
6291 size = MAX_PATH;
6292 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
6293 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6294 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6297 size = MAX_PATH;
6298 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
6299 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6300 trace("VersionDatabase = %s\n", buf);
6302 size = MAX_PATH;
6303 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
6304 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6305 trace("VersionMsi = %s\n", buf);
6307 size = MAX_PATH;
6308 r = MsiGetProperty(hpkg, "Date", buf, &size);
6309 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6310 trace("Date = %s\n", buf);
6312 size = MAX_PATH;
6313 r = MsiGetProperty(hpkg, "Time", buf, &size);
6314 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6315 trace("Time = %s\n", buf);
6317 size = MAX_PATH;
6318 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
6319 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6320 trace("PackageCode = %s\n", buf);
6322 langid = GetUserDefaultLangID();
6323 sprintf(path, "%d", langid);
6325 size = MAX_PATH;
6326 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
6327 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
6328 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
6330 res = GetSystemMetrics(SM_CXSCREEN);
6331 size = MAX_PATH;
6332 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
6333 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
6335 res = GetSystemMetrics(SM_CYSCREEN);
6336 size = MAX_PATH;
6337 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
6338 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
6340 CloseHandle(hkey1);
6341 CloseHandle(hkey2);
6342 MsiCloseHandle(hpkg);
6343 DeleteFile(msifile);
6346 static void test_launchconditions(void)
6348 MSIHANDLE hpkg;
6349 MSIHANDLE hdb;
6350 UINT r;
6352 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6354 hdb = create_package_db();
6355 ok( hdb, "failed to create package database\n" );
6357 r = create_launchcondition_table( hdb );
6358 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
6360 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
6361 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
6363 /* invalid condition */
6364 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
6365 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
6367 hpkg = package_from_db( hdb );
6368 ok( hpkg, "failed to create package\n");
6370 MsiCloseHandle( hdb );
6372 r = MsiSetProperty( hpkg, "X", "1" );
6373 ok( r == ERROR_SUCCESS, "failed to set property\n" );
6375 /* invalid conditions are ignored */
6376 r = MsiDoAction( hpkg, "LaunchConditions" );
6377 ok( r == ERROR_SUCCESS, "cost init failed\n" );
6379 /* verify LaunchConditions still does some verification */
6380 r = MsiSetProperty( hpkg, "X", "2" );
6381 ok( r == ERROR_SUCCESS, "failed to set property\n" );
6383 r = MsiDoAction( hpkg, "LaunchConditions" );
6384 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
6386 MsiCloseHandle( hpkg );
6387 DeleteFile( msifile );
6390 static void test_ccpsearch(void)
6392 MSIHANDLE hdb, hpkg;
6393 CHAR prop[MAX_PATH];
6394 DWORD size = MAX_PATH;
6395 UINT r;
6397 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6399 hdb = create_package_db();
6400 ok(hdb, "failed to create package database\n");
6402 r = create_ccpsearch_table(hdb);
6403 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6405 r = add_ccpsearch_entry(hdb, "'CCP_random'");
6406 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6408 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
6409 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6411 r = create_reglocator_table(hdb);
6412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6414 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
6415 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6417 r = create_drlocator_table(hdb);
6418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6420 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
6421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6423 r = create_signature_table(hdb);
6424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6426 hpkg = package_from_db(hdb);
6427 ok(hpkg, "failed to create package\n");
6429 MsiCloseHandle(hdb);
6431 r = MsiDoAction(hpkg, "CCPSearch");
6432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6434 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
6435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6436 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
6438 MsiCloseHandle(hpkg);
6439 DeleteFileA(msifile);
6442 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
6444 DWORD i,n=1;
6445 GUID guid;
6447 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
6448 return FALSE;
6450 for(i=0; i<8; i++)
6451 out[7-i] = in[n++];
6452 n++;
6453 for(i=0; i<4; i++)
6454 out[11-i] = in[n++];
6455 n++;
6456 for(i=0; i<4; i++)
6457 out[15-i] = in[n++];
6458 n++;
6459 for(i=0; i<2; i++)
6461 out[17+i*2] = in[n++];
6462 out[16+i*2] = in[n++];
6464 n++;
6465 for( ; i<8; i++)
6467 out[17+i*2] = in[n++];
6468 out[16+i*2] = in[n++];
6470 out[32]=0;
6471 return TRUE;
6474 static void set_component_path(LPCSTR filename, LPCSTR guid)
6476 WCHAR guidW[MAX_PATH];
6477 WCHAR squashedW[MAX_PATH];
6478 CHAR squashed[MAX_PATH];
6479 CHAR substr[MAX_PATH];
6480 CHAR path[MAX_PATH];
6481 HKEY hkey;
6483 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
6484 squash_guid(guidW, squashedW);
6485 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
6487 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6488 "Installer\\UserData\\S-1-5-18\\Components\\");
6489 lstrcatA(substr, squashed);
6491 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
6493 lstrcpyA(path, CURR_DIR);
6494 lstrcatA(path, "\\");
6495 lstrcatA(path, filename);
6497 /* just using a random squashed product code */
6498 RegSetValueExA(hkey, "7D2F387510109040002000060BECB6AB", 0,
6499 REG_SZ, (LPBYTE)path, lstrlenA(path));
6501 RegCloseKey(hkey);
6503 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6504 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
6507 static void delete_component_path(LPCSTR guid)
6509 WCHAR guidW[MAX_PATH];
6510 WCHAR squashedW[MAX_PATH];
6511 WCHAR substrW[MAX_PATH];
6512 CHAR squashed[MAX_PATH];
6513 CHAR substr[MAX_PATH];
6515 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
6516 squash_guid(guidW, squashedW);
6517 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
6519 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6520 "Installer\\UserData\\S-1-5-18\\Components\\");
6521 lstrcatA(substr, squashed);
6523 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
6524 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
6526 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6527 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
6528 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
6531 static void test_complocator(void)
6533 MSIHANDLE hdb, hpkg;
6534 UINT r;
6535 CHAR prop[MAX_PATH];
6536 CHAR expected[MAX_PATH];
6537 DWORD size = MAX_PATH;
6539 hdb = create_package_db();
6540 ok(hdb, "failed to create package database\n");
6542 r = create_appsearch_table(hdb);
6543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6545 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
6546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6548 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
6549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6551 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
6552 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6554 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
6555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6557 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
6558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6560 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
6561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6563 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
6564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6566 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
6567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6569 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
6570 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6572 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
6573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6575 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
6576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6578 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
6579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6581 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
6582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6584 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
6585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6587 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
6588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6590 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
6591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6593 r = create_complocator_table(hdb);
6594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6596 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
6597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6599 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
6600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6602 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
6603 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6605 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
6606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6608 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
6609 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6611 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
6612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6614 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
6615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6617 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
6618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6620 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
6621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6623 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
6624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6626 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
6627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6629 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
6630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6632 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
6633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6635 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
6636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6638 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
6639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6641 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
6642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6644 r = create_signature_table(hdb);
6645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6647 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
6648 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6650 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
6651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6653 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
6654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6656 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
6657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6659 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
6660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6662 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
6663 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6665 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
6666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6668 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
6669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6671 hpkg = package_from_db(hdb);
6672 ok(hpkg, "failed to create package\n");
6674 MsiCloseHandle(hdb);
6676 create_test_file("abelisaurus");
6677 create_test_file("bactrosaurus");
6678 create_test_file("camelotia");
6679 create_test_file("diclonius");
6680 create_test_file("echinodon");
6681 create_test_file("falcarius");
6682 create_test_file("gallimimus");
6683 create_test_file("hagryphus");
6684 CreateDirectoryA("iguanodon", NULL);
6685 CreateDirectoryA("jobaria", NULL);
6686 CreateDirectoryA("kakuru", NULL);
6687 CreateDirectoryA("labocania", NULL);
6688 CreateDirectoryA("megaraptor", NULL);
6689 CreateDirectoryA("neosodon", NULL);
6690 CreateDirectoryA("olorotitan", NULL);
6691 CreateDirectoryA("pantydraco", NULL);
6693 set_component_path("abelisaurus", "{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6694 set_component_path("bactrosaurus", "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6695 set_component_path("echinodon", "{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6696 set_component_path("falcarius", "{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6697 set_component_path("iguanodon", "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6698 set_component_path("jobaria", "{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6699 set_component_path("megaraptor", "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6700 set_component_path("neosodon", "{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6702 r = MsiDoAction(hpkg, "AppSearch");
6703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6705 size = MAX_PATH;
6706 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
6707 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6709 lstrcpyA(expected, CURR_DIR);
6710 lstrcatA(expected, "\\abelisaurus");
6711 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6712 "Expected %s or empty string, got %s\n", expected, prop);
6714 size = MAX_PATH;
6715 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
6716 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6717 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6719 size = MAX_PATH;
6720 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
6721 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6722 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6724 size = MAX_PATH;
6725 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
6726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6727 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6729 size = MAX_PATH;
6730 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
6731 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6733 lstrcpyA(expected, CURR_DIR);
6734 lstrcatA(expected, "\\");
6735 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6736 "Expected %s or empty string, got %s\n", expected, prop);
6738 size = MAX_PATH;
6739 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
6740 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6741 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6743 size = MAX_PATH;
6744 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
6745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6746 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6748 size = MAX_PATH;
6749 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
6750 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6751 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6753 size = MAX_PATH;
6754 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
6755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6756 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6758 size = MAX_PATH;
6759 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
6760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6761 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6763 size = MAX_PATH;
6764 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
6765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6766 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6768 size = MAX_PATH;
6769 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
6770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6771 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6773 size = MAX_PATH;
6774 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
6775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6777 lstrcpyA(expected, CURR_DIR);
6778 lstrcatA(expected, "\\");
6779 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6780 "Expected %s or empty string, got %s\n", expected, prop);
6782 size = MAX_PATH;
6783 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
6784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6786 lstrcpyA(expected, CURR_DIR);
6787 lstrcatA(expected, "\\neosodon\\");
6788 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6789 "Expected %s or empty string, got %s\n", expected, prop);
6791 size = MAX_PATH;
6792 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
6793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6794 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6796 size = MAX_PATH;
6797 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
6798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6799 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6801 MsiCloseHandle(hpkg);
6802 DeleteFileA("abelisaurus");
6803 DeleteFileA("bactrosaurus");
6804 DeleteFileA("camelotia");
6805 DeleteFileA("diclonius");
6806 DeleteFileA("echinodon");
6807 DeleteFileA("falcarius");
6808 DeleteFileA("gallimimus");
6809 DeleteFileA("hagryphus");
6810 RemoveDirectoryA("iguanodon");
6811 RemoveDirectoryA("jobaria");
6812 RemoveDirectoryA("kakuru");
6813 RemoveDirectoryA("labocania");
6814 RemoveDirectoryA("megaraptor");
6815 RemoveDirectoryA("neosodon");
6816 RemoveDirectoryA("olorotitan");
6817 RemoveDirectoryA("pantydraco");
6818 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6819 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6820 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6821 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6822 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6823 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6824 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6825 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6826 DeleteFileA(msifile);
6829 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
6831 MSIHANDLE summary;
6832 UINT r;
6834 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
6835 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6837 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
6838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6840 r = MsiSummaryInfoPersist(summary);
6841 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6843 MsiCloseHandle(summary);
6846 static void test_MsiGetSourcePath(void)
6848 MSIHANDLE hdb, hpkg;
6849 CHAR path[MAX_PATH];
6850 CHAR cwd[MAX_PATH];
6851 CHAR subsrc[MAX_PATH];
6852 CHAR sub2[MAX_PATH];
6853 DWORD size;
6854 UINT r;
6856 lstrcpyA(cwd, CURR_DIR);
6857 lstrcatA(cwd, "\\");
6859 lstrcpyA(subsrc, cwd);
6860 lstrcatA(subsrc, "subsource");
6861 lstrcatA(subsrc, "\\");
6863 lstrcpyA(sub2, subsrc);
6864 lstrcatA(sub2, "sub2");
6865 lstrcatA(sub2, "\\");
6867 /* uncompressed source */
6869 hdb = create_package_db();
6870 ok( hdb, "failed to create database\n");
6872 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
6874 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
6875 ok(r == S_OK, "failed\n");
6877 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
6878 ok(r == S_OK, "failed\n");
6880 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
6881 ok(r == S_OK, "failed\n");
6883 r = MsiDatabaseCommit(hdb);
6884 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
6886 hpkg = package_from_db(hdb);
6887 ok(hpkg, "failed to create package\n");
6889 MsiCloseHandle(hdb);
6891 /* invalid database handle */
6892 size = MAX_PATH;
6893 lstrcpyA(path, "kiwi");
6894 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
6895 ok(r == ERROR_INVALID_HANDLE,
6896 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
6897 ok(!lstrcmpA(path, "kiwi"),
6898 "Expected path to be unchanged, got \"%s\"\n", path);
6899 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6901 /* NULL szFolder */
6902 size = MAX_PATH;
6903 lstrcpyA(path, "kiwi");
6904 r = MsiGetSourcePath(hpkg, NULL, path, &size);
6905 ok(r == ERROR_INVALID_PARAMETER,
6906 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
6907 ok(!lstrcmpA(path, "kiwi"),
6908 "Expected path to be unchanged, got \"%s\"\n", path);
6909 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6911 /* empty szFolder */
6912 size = MAX_PATH;
6913 lstrcpyA(path, "kiwi");
6914 r = MsiGetSourcePath(hpkg, "", path, &size);
6915 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6916 ok(!lstrcmpA(path, "kiwi"),
6917 "Expected path to be unchanged, got \"%s\"\n", path);
6918 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6920 /* try TARGETDIR */
6921 size = MAX_PATH;
6922 lstrcpyA(path, "kiwi");
6923 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6924 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6925 ok(!lstrcmpA(path, "kiwi"),
6926 "Expected path to be unchanged, got \"%s\"\n", path);
6927 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6929 /* try SourceDir */
6930 size = MAX_PATH;
6931 lstrcpyA(path, "kiwi");
6932 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6933 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6934 ok(!lstrcmpA(path, "kiwi"),
6935 "Expected path to be unchanged, got \"%s\"\n", path);
6936 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6938 /* try SOURCEDIR */
6939 size = MAX_PATH;
6940 lstrcpyA(path, "kiwi");
6941 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6942 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6943 ok(!lstrcmpA(path, "kiwi"),
6944 "Expected path to be unchanged, got \"%s\"\n", path);
6945 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6947 /* source path does not exist, but the property exists */
6948 size = MAX_PATH;
6949 lstrcpyA(path, "kiwi");
6950 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
6951 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6952 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
6953 ok(size == 0, "Expected 0, got %d\n", size);
6955 /* try SubDir */
6956 size = MAX_PATH;
6957 lstrcpyA(path, "kiwi");
6958 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6959 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6960 ok(!lstrcmpA(path, "kiwi"),
6961 "Expected path to be unchanged, got \"%s\"\n", path);
6962 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6964 /* try SubDir2 */
6965 size = MAX_PATH;
6966 lstrcpyA(path, "kiwi");
6967 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6968 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6969 ok(!lstrcmpA(path, "kiwi"),
6970 "Expected path to be unchanged, got \"%s\"\n", path);
6971 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6973 r = MsiDoAction(hpkg, "CostInitialize");
6974 ok(r == ERROR_SUCCESS, "cost init failed\n");
6976 /* try TARGETDIR after CostInitialize */
6977 size = MAX_PATH;
6978 lstrcpyA(path, "kiwi");
6979 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6981 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6982 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6984 /* try SourceDir after CostInitialize */
6985 size = MAX_PATH;
6986 lstrcpyA(path, "kiwi");
6987 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6988 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6989 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6990 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6992 /* try SOURCEDIR after CostInitialize */
6993 size = MAX_PATH;
6994 lstrcpyA(path, "kiwi");
6995 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6996 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6997 ok(!lstrcmpA(path, "kiwi"),
6998 "Expected path to be unchanged, got \"%s\"\n", path);
6999 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7001 /* source path does not exist, but the property exists */
7002 size = MAX_PATH;
7003 lstrcpyA(path, "kiwi");
7004 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7006 todo_wine
7008 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7009 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7012 /* try SubDir after CostInitialize */
7013 size = MAX_PATH;
7014 lstrcpyA(path, "kiwi");
7015 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7016 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7017 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7018 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7020 /* try SubDir2 after CostInitialize */
7021 size = MAX_PATH;
7022 lstrcpyA(path, "kiwi");
7023 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7024 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7025 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
7026 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
7028 r = MsiDoAction(hpkg, "ResolveSource");
7029 ok(r == ERROR_SUCCESS, "file cost failed\n");
7031 /* try TARGETDIR after ResolveSource */
7032 size = MAX_PATH;
7033 lstrcpyA(path, "kiwi");
7034 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
7035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7036 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7037 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7039 /* try SourceDir after ResolveSource */
7040 size = MAX_PATH;
7041 lstrcpyA(path, "kiwi");
7042 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7044 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7045 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7047 /* try SOURCEDIR after ResolveSource */
7048 size = MAX_PATH;
7049 lstrcpyA(path, "kiwi");
7050 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7051 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7052 ok(!lstrcmpA(path, "kiwi"),
7053 "Expected path to be unchanged, got \"%s\"\n", path);
7054 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7056 /* source path does not exist, but the property exists */
7057 size = MAX_PATH;
7058 lstrcpyA(path, "kiwi");
7059 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7061 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7062 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7064 /* try SubDir after ResolveSource */
7065 size = MAX_PATH;
7066 lstrcpyA(path, "kiwi");
7067 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7068 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7069 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7070 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7072 /* try SubDir2 after ResolveSource */
7073 size = MAX_PATH;
7074 lstrcpyA(path, "kiwi");
7075 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7077 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
7078 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
7080 r = MsiDoAction(hpkg, "FileCost");
7081 ok(r == ERROR_SUCCESS, "file cost failed\n");
7083 /* try TARGETDIR after FileCost */
7084 size = MAX_PATH;
7085 lstrcpyA(path, "kiwi");
7086 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
7087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7088 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7089 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7091 /* try SourceDir after FileCost */
7092 size = MAX_PATH;
7093 lstrcpyA(path, "kiwi");
7094 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7096 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7097 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7099 /* try SOURCEDIR after FileCost */
7100 size = MAX_PATH;
7101 lstrcpyA(path, "kiwi");
7102 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7103 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7104 ok(!lstrcmpA(path, "kiwi"),
7105 "Expected path to be unchanged, got \"%s\"\n", path);
7106 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7108 /* try SubDir after FileCost */
7109 size = MAX_PATH;
7110 lstrcpyA(path, "kiwi");
7111 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7113 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7114 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7116 /* try SubDir2 after FileCost */
7117 size = MAX_PATH;
7118 lstrcpyA(path, "kiwi");
7119 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7121 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
7122 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
7124 r = MsiDoAction(hpkg, "CostFinalize");
7125 ok(r == ERROR_SUCCESS, "file cost failed\n");
7127 /* try TARGETDIR after CostFinalize */
7128 size = MAX_PATH;
7129 lstrcpyA(path, "kiwi");
7130 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
7131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7132 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7133 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7135 /* try SourceDir after CostFinalize */
7136 size = MAX_PATH;
7137 lstrcpyA(path, "kiwi");
7138 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7140 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7141 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7143 /* try SOURCEDIR after CostFinalize */
7144 size = MAX_PATH;
7145 lstrcpyA(path, "kiwi");
7146 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7147 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7148 ok(!lstrcmpA(path, "kiwi"),
7149 "Expected path to be unchanged, got \"%s\"\n", path);
7150 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7152 /* try SubDir after CostFinalize */
7153 size = MAX_PATH;
7154 lstrcpyA(path, "kiwi");
7155 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7157 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7158 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7160 /* try SubDir2 after CostFinalize */
7161 size = MAX_PATH;
7162 lstrcpyA(path, "kiwi");
7163 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7164 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7165 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
7166 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
7168 /* nonexistent directory */
7169 size = MAX_PATH;
7170 lstrcpyA(path, "kiwi");
7171 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
7172 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7173 ok(!lstrcmpA(path, "kiwi"),
7174 "Expected path to be unchanged, got \"%s\"\n", path);
7175 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7177 /* NULL szPathBuf */
7178 size = MAX_PATH;
7179 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
7180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7181 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7183 /* NULL pcchPathBuf */
7184 lstrcpyA(path, "kiwi");
7185 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
7186 ok(r == ERROR_INVALID_PARAMETER,
7187 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
7188 ok(!lstrcmpA(path, "kiwi"),
7189 "Expected path to be unchanged, got \"%s\"\n", path);
7191 /* pcchPathBuf is 0 */
7192 size = 0;
7193 lstrcpyA(path, "kiwi");
7194 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7195 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7196 ok(!lstrcmpA(path, "kiwi"),
7197 "Expected path to be unchanged, got \"%s\"\n", path);
7198 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7200 /* pcchPathBuf does not have room for NULL terminator */
7201 size = lstrlenA(cwd);
7202 lstrcpyA(path, "kiwi");
7203 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7204 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7205 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
7206 "Expected path with no backslash, got \"%s\"\n", path);
7207 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7209 /* pcchPathBuf has room for NULL terminator */
7210 size = lstrlenA(cwd) + 1;
7211 lstrcpyA(path, "kiwi");
7212 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7214 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7215 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7217 MsiCloseHandle(hpkg);
7219 /* compressed source */
7221 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
7222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7224 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
7226 hpkg = package_from_db(hdb);
7227 ok(hpkg, "failed to create package\n");
7229 r = MsiDoAction(hpkg, "CostInitialize");
7230 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7231 r = MsiDoAction(hpkg, "FileCost");
7232 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7233 r = MsiDoAction(hpkg, "CostFinalize");
7234 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7236 /* try TARGETDIR after CostFinalize */
7237 size = MAX_PATH;
7238 lstrcpyA(path, "kiwi");
7239 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
7240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7241 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7242 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7244 /* try SourceDir after CostFinalize */
7245 size = MAX_PATH;
7246 lstrcpyA(path, "kiwi");
7247 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7248 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7249 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7250 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7252 /* try SOURCEDIR after CostFinalize */
7253 size = MAX_PATH;
7254 lstrcpyA(path, "kiwi");
7255 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7256 todo_wine
7258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7259 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7260 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7263 /* try SubDir after CostFinalize */
7264 size = MAX_PATH;
7265 lstrcpyA(path, "kiwi");
7266 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7268 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7269 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7271 /* try SubDir2 after CostFinalize */
7272 size = MAX_PATH;
7273 lstrcpyA(path, "kiwi");
7274 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7275 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7276 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7277 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7279 MsiCloseHandle(hpkg);
7280 DeleteFile(msifile);
7283 static void test_shortlongsource(void)
7285 MSIHANDLE hdb, hpkg;
7286 CHAR path[MAX_PATH];
7287 CHAR cwd[MAX_PATH];
7288 CHAR subsrc[MAX_PATH];
7289 DWORD size;
7290 UINT r;
7292 lstrcpyA(cwd, CURR_DIR);
7293 lstrcatA(cwd, "\\");
7295 lstrcpyA(subsrc, cwd);
7296 lstrcatA(subsrc, "long");
7297 lstrcatA(subsrc, "\\");
7299 /* long file names */
7301 hdb = create_package_db();
7302 ok( hdb, "failed to create database\n");
7304 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
7306 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
7307 ok(r == S_OK, "failed\n");
7309 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
7310 ok(r == S_OK, "failed\n");
7312 /* CostInitialize:short */
7313 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
7314 ok(r == S_OK, "failed\n");
7316 /* CostInitialize:long */
7317 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
7318 ok(r == S_OK, "failed\n");
7320 /* FileCost:short */
7321 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
7322 ok(r == S_OK, "failed\n");
7324 /* FileCost:long */
7325 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
7326 ok(r == S_OK, "failed\n");
7328 /* CostFinalize:short */
7329 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
7330 ok(r == S_OK, "failed\n");
7332 /* CostFinalize:long */
7333 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
7334 ok(r == S_OK, "failed\n");
7336 MsiDatabaseCommit(hdb);
7338 hpkg = package_from_db(hdb);
7339 ok(hpkg, "failed to create package\n");
7341 MsiCloseHandle(hdb);
7343 CreateDirectoryA("one", NULL);
7344 CreateDirectoryA("four", NULL);
7346 r = MsiDoAction(hpkg, "CostInitialize");
7347 ok(r == ERROR_SUCCESS, "file cost failed\n");
7349 CreateDirectory("five", NULL);
7350 CreateDirectory("eight", NULL);
7352 r = MsiDoAction(hpkg, "FileCost");
7353 ok(r == ERROR_SUCCESS, "file cost failed\n");
7355 CreateDirectory("nine", NULL);
7356 CreateDirectory("twelve", NULL);
7358 r = MsiDoAction(hpkg, "CostFinalize");
7359 ok(r == ERROR_SUCCESS, "file cost failed\n");
7361 /* neither short nor long source directories exist */
7362 size = MAX_PATH;
7363 lstrcpyA(path, "kiwi");
7364 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7366 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7367 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7369 CreateDirectoryA("short", NULL);
7371 /* short source directory exists */
7372 size = MAX_PATH;
7373 lstrcpyA(path, "kiwi");
7374 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7376 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7377 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7379 CreateDirectoryA("long", NULL);
7381 /* both short and long source directories exist */
7382 size = MAX_PATH;
7383 lstrcpyA(path, "kiwi");
7384 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7386 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7387 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7389 lstrcpyA(subsrc, cwd);
7390 lstrcatA(subsrc, "two");
7391 lstrcatA(subsrc, "\\");
7393 /* short dir exists before CostInitialize */
7394 size = MAX_PATH;
7395 lstrcpyA(path, "kiwi");
7396 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7398 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7399 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7401 lstrcpyA(subsrc, cwd);
7402 lstrcatA(subsrc, "four");
7403 lstrcatA(subsrc, "\\");
7405 /* long dir exists before CostInitialize */
7406 size = MAX_PATH;
7407 lstrcpyA(path, "kiwi");
7408 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
7409 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7410 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7411 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7413 lstrcpyA(subsrc, cwd);
7414 lstrcatA(subsrc, "six");
7415 lstrcatA(subsrc, "\\");
7417 /* short dir exists before FileCost */
7418 size = MAX_PATH;
7419 lstrcpyA(path, "kiwi");
7420 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
7421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7422 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7423 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7425 lstrcpyA(subsrc, cwd);
7426 lstrcatA(subsrc, "eight");
7427 lstrcatA(subsrc, "\\");
7429 /* long dir exists before FileCost */
7430 size = MAX_PATH;
7431 lstrcpyA(path, "kiwi");
7432 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
7433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7434 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7435 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7437 lstrcpyA(subsrc, cwd);
7438 lstrcatA(subsrc, "ten");
7439 lstrcatA(subsrc, "\\");
7441 /* short dir exists before CostFinalize */
7442 size = MAX_PATH;
7443 lstrcpyA(path, "kiwi");
7444 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
7445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7446 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7447 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7449 lstrcpyA(subsrc, cwd);
7450 lstrcatA(subsrc, "twelve");
7451 lstrcatA(subsrc, "\\");
7453 /* long dir exists before CostFinalize */
7454 size = MAX_PATH;
7455 lstrcpyA(path, "kiwi");
7456 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
7457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7458 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7459 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7461 MsiCloseHandle(hpkg);
7462 RemoveDirectoryA("short");
7463 RemoveDirectoryA("long");
7464 RemoveDirectoryA("one");
7465 RemoveDirectoryA("four");
7466 RemoveDirectoryA("five");
7467 RemoveDirectoryA("eight");
7468 RemoveDirectoryA("nine");
7469 RemoveDirectoryA("twelve");
7471 /* short file names */
7473 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
7474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7476 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
7478 hpkg = package_from_db(hdb);
7479 ok(hpkg, "failed to create package\n");
7481 MsiCloseHandle(hdb);
7483 CreateDirectoryA("one", NULL);
7484 CreateDirectoryA("four", NULL);
7486 r = MsiDoAction(hpkg, "CostInitialize");
7487 ok(r == ERROR_SUCCESS, "file cost failed\n");
7489 CreateDirectory("five", NULL);
7490 CreateDirectory("eight", NULL);
7492 r = MsiDoAction(hpkg, "FileCost");
7493 ok(r == ERROR_SUCCESS, "file cost failed\n");
7495 CreateDirectory("nine", NULL);
7496 CreateDirectory("twelve", NULL);
7498 r = MsiDoAction(hpkg, "CostFinalize");
7499 ok(r == ERROR_SUCCESS, "file cost failed\n");
7501 lstrcpyA(subsrc, cwd);
7502 lstrcatA(subsrc, "short");
7503 lstrcatA(subsrc, "\\");
7505 /* neither short nor long source directories exist */
7506 size = MAX_PATH;
7507 lstrcpyA(path, "kiwi");
7508 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7510 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7511 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7513 CreateDirectoryA("short", NULL);
7515 /* short source directory exists */
7516 size = MAX_PATH;
7517 lstrcpyA(path, "kiwi");
7518 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7520 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7521 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7523 CreateDirectoryA("long", NULL);
7525 /* both short and long source directories exist */
7526 size = MAX_PATH;
7527 lstrcpyA(path, "kiwi");
7528 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7530 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7531 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7533 lstrcpyA(subsrc, cwd);
7534 lstrcatA(subsrc, "one");
7535 lstrcatA(subsrc, "\\");
7537 /* short dir exists before CostInitialize */
7538 size = MAX_PATH;
7539 lstrcpyA(path, "kiwi");
7540 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7542 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7543 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7545 lstrcpyA(subsrc, cwd);
7546 lstrcatA(subsrc, "three");
7547 lstrcatA(subsrc, "\\");
7549 /* long dir exists before CostInitialize */
7550 size = MAX_PATH;
7551 lstrcpyA(path, "kiwi");
7552 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
7553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7554 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7555 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7557 lstrcpyA(subsrc, cwd);
7558 lstrcatA(subsrc, "five");
7559 lstrcatA(subsrc, "\\");
7561 /* short dir exists before FileCost */
7562 size = MAX_PATH;
7563 lstrcpyA(path, "kiwi");
7564 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
7565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7566 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7567 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7569 lstrcpyA(subsrc, cwd);
7570 lstrcatA(subsrc, "seven");
7571 lstrcatA(subsrc, "\\");
7573 /* long dir exists before FileCost */
7574 size = MAX_PATH;
7575 lstrcpyA(path, "kiwi");
7576 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
7577 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7578 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7579 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7581 lstrcpyA(subsrc, cwd);
7582 lstrcatA(subsrc, "nine");
7583 lstrcatA(subsrc, "\\");
7585 /* short dir exists before CostFinalize */
7586 size = MAX_PATH;
7587 lstrcpyA(path, "kiwi");
7588 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
7589 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7590 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7591 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7593 lstrcpyA(subsrc, cwd);
7594 lstrcatA(subsrc, "eleven");
7595 lstrcatA(subsrc, "\\");
7597 /* long dir exists before CostFinalize */
7598 size = MAX_PATH;
7599 lstrcpyA(path, "kiwi");
7600 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
7601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7602 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7603 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7605 MsiCloseHandle(hpkg);
7606 RemoveDirectoryA("short");
7607 RemoveDirectoryA("long");
7608 RemoveDirectoryA("one");
7609 RemoveDirectoryA("four");
7610 RemoveDirectoryA("five");
7611 RemoveDirectoryA("eight");
7612 RemoveDirectoryA("nine");
7613 RemoveDirectoryA("twelve");
7614 DeleteFileA(msifile);
7617 static void test_sourcedir(void)
7619 MSIHANDLE hdb, hpkg;
7620 CHAR package[10];
7621 CHAR path[MAX_PATH];
7622 CHAR cwd[MAX_PATH];
7623 CHAR subsrc[MAX_PATH];
7624 DWORD size;
7625 UINT r;
7627 lstrcpyA(cwd, CURR_DIR);
7628 lstrcatA(cwd, "\\");
7630 lstrcpyA(subsrc, cwd);
7631 lstrcatA(subsrc, "long");
7632 lstrcatA(subsrc, "\\");
7634 hdb = create_package_db();
7635 ok( hdb, "failed to create database\n");
7637 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
7638 ok(r == S_OK, "failed\n");
7640 sprintf(package, "#%li", hdb);
7641 r = MsiOpenPackage(package, &hpkg);
7642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7644 /* properties only */
7646 /* SourceDir prop */
7647 size = MAX_PATH;
7648 lstrcpyA(path, "kiwi");
7649 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7650 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7651 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7652 ok(size == 0, "Expected 0, got %d\n", size);
7654 /* SOURCEDIR prop */
7655 size = MAX_PATH;
7656 lstrcpyA(path, "kiwi");
7657 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7659 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7660 ok(size == 0, "Expected 0, got %d\n", size);
7662 r = MsiDoAction(hpkg, "CostInitialize");
7663 ok(r == ERROR_SUCCESS, "file cost failed\n");
7665 /* SourceDir after CostInitialize */
7666 size = MAX_PATH;
7667 lstrcpyA(path, "kiwi");
7668 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7670 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7671 ok(size == 0, "Expected 0, got %d\n", size);
7673 /* SOURCEDIR after CostInitialize */
7674 size = MAX_PATH;
7675 lstrcpyA(path, "kiwi");
7676 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7678 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7679 ok(size == 0, "Expected 0, got %d\n", size);
7681 r = MsiDoAction(hpkg, "FileCost");
7682 ok(r == ERROR_SUCCESS, "file cost failed\n");
7684 /* SourceDir after FileCost */
7685 size = MAX_PATH;
7686 lstrcpyA(path, "kiwi");
7687 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7688 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7689 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7690 ok(size == 0, "Expected 0, got %d\n", size);
7692 /* SOURCEDIR after FileCost */
7693 size = MAX_PATH;
7694 lstrcpyA(path, "kiwi");
7695 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7697 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7698 ok(size == 0, "Expected 0, got %d\n", size);
7700 r = MsiDoAction(hpkg, "CostFinalize");
7701 ok(r == ERROR_SUCCESS, "file cost failed\n");
7703 /* SourceDir after CostFinalize */
7704 size = MAX_PATH;
7705 lstrcpyA(path, "kiwi");
7706 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7707 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7708 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7709 ok(size == 0, "Expected 0, got %d\n", size);
7711 /* SOURCEDIR after CostFinalize */
7712 size = MAX_PATH;
7713 lstrcpyA(path, "kiwi");
7714 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7716 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7717 ok(size == 0, "Expected 0, got %d\n", size);
7719 r = MsiDoAction(hpkg, "ResolveSource");
7720 ok(r == ERROR_SUCCESS, "file cost failed\n");
7722 /* SourceDir after ResolveSource */
7723 size = MAX_PATH;
7724 lstrcpyA(path, "kiwi");
7725 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7727 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7728 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7730 /* SOURCEDIR after ResolveSource */
7731 size = MAX_PATH;
7732 lstrcpyA(path, "kiwi");
7733 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7735 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7736 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7738 /* random casing */
7739 size = MAX_PATH;
7740 lstrcpyA(path, "kiwi");
7741 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
7742 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7743 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7744 ok(size == 0, "Expected 0, got %d\n", size);
7746 MsiCloseHandle(hpkg);
7748 /* reset the package state */
7749 sprintf(package, "#%li", hdb);
7750 r = MsiOpenPackage(package, &hpkg);
7751 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7753 /* test how MsiGetSourcePath affects the properties */
7755 /* SourceDir prop */
7756 size = MAX_PATH;
7757 lstrcpyA(path, "kiwi");
7758 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7760 todo_wine
7762 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7763 ok(size == 0, "Expected 0, got %d\n", size);
7766 size = MAX_PATH;
7767 lstrcpyA(path, "kiwi");
7768 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7769 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7770 ok(!lstrcmpA(path, "kiwi"),
7771 "Expected path to be unchanged, got \"%s\"\n", path);
7772 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7774 /* SourceDir after MsiGetSourcePath */
7775 size = MAX_PATH;
7776 lstrcpyA(path, "kiwi");
7777 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7778 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7779 todo_wine
7781 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7782 ok(size == 0, "Expected 0, got %d\n", size);
7785 /* SOURCEDIR prop */
7786 size = MAX_PATH;
7787 lstrcpyA(path, "kiwi");
7788 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7790 todo_wine
7792 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7793 ok(size == 0, "Expected 0, got %d\n", size);
7796 size = MAX_PATH;
7797 lstrcpyA(path, "kiwi");
7798 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7799 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7800 ok(!lstrcmpA(path, "kiwi"),
7801 "Expected path to be unchanged, got \"%s\"\n", path);
7802 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7804 /* SOURCEDIR prop after MsiGetSourcePath */
7805 size = MAX_PATH;
7806 lstrcpyA(path, "kiwi");
7807 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7808 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7809 todo_wine
7811 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7812 ok(size == 0, "Expected 0, got %d\n", size);
7815 r = MsiDoAction(hpkg, "CostInitialize");
7816 ok(r == ERROR_SUCCESS, "file cost failed\n");
7818 /* SourceDir after CostInitialize */
7819 size = MAX_PATH;
7820 lstrcpyA(path, "kiwi");
7821 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7823 todo_wine
7825 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7826 ok(size == 0, "Expected 0, got %d\n", size);
7829 size = MAX_PATH;
7830 lstrcpyA(path, "kiwi");
7831 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7832 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7833 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7834 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7836 /* SourceDir after MsiGetSourcePath */
7837 size = MAX_PATH;
7838 lstrcpyA(path, "kiwi");
7839 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7841 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7842 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7844 /* SOURCEDIR after CostInitialize */
7845 size = MAX_PATH;
7846 lstrcpyA(path, "kiwi");
7847 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7849 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7850 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7852 /* SOURCEDIR source path still does not exist */
7853 size = MAX_PATH;
7854 lstrcpyA(path, "kiwi");
7855 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7856 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7857 ok(!lstrcmpA(path, "kiwi"),
7858 "Expected path to be unchanged, got \"%s\"\n", path);
7859 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7861 r = MsiDoAction(hpkg, "FileCost");
7862 ok(r == ERROR_SUCCESS, "file cost failed\n");
7864 /* SourceDir after FileCost */
7865 size = MAX_PATH;
7866 lstrcpyA(path, "kiwi");
7867 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7868 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7869 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7870 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7872 /* SOURCEDIR after FileCost */
7873 size = MAX_PATH;
7874 lstrcpyA(path, "kiwi");
7875 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7877 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7878 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7880 /* SOURCEDIR source path still does not exist */
7881 size = MAX_PATH;
7882 lstrcpyA(path, "kiwi");
7883 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7884 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7885 ok(!lstrcmpA(path, "kiwi"),
7886 "Expected path to be unchanged, got \"%s\"\n", path);
7887 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7889 r = MsiDoAction(hpkg, "CostFinalize");
7890 ok(r == ERROR_SUCCESS, "file cost failed\n");
7892 /* SourceDir after CostFinalize */
7893 size = MAX_PATH;
7894 lstrcpyA(path, "kiwi");
7895 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7897 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7898 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7900 /* SOURCEDIR after CostFinalize */
7901 size = MAX_PATH;
7902 lstrcpyA(path, "kiwi");
7903 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7904 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7905 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7906 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7908 /* SOURCEDIR source path still does not exist */
7909 size = MAX_PATH;
7910 lstrcpyA(path, "kiwi");
7911 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7912 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7913 ok(!lstrcmpA(path, "kiwi"),
7914 "Expected path to be unchanged, got \"%s\"\n", path);
7915 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7917 r = MsiDoAction(hpkg, "ResolveSource");
7918 ok(r == ERROR_SUCCESS, "file cost failed\n");
7920 /* SourceDir after ResolveSource */
7921 size = MAX_PATH;
7922 lstrcpyA(path, "kiwi");
7923 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7924 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7925 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7926 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7928 /* SOURCEDIR after ResolveSource */
7929 size = MAX_PATH;
7930 lstrcpyA(path, "kiwi");
7931 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7933 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7934 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7936 /* SOURCEDIR source path still does not exist */
7937 size = MAX_PATH;
7938 lstrcpyA(path, "kiwi");
7939 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7940 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7941 ok(!lstrcmpA(path, "kiwi"),
7942 "Expected path to be unchanged, got \"%s\"\n", path);
7943 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7945 MsiCloseHandle(hdb);
7946 MsiCloseHandle(hpkg);
7947 DeleteFileA(msifile);
7950 struct access_res
7952 BOOL gothandle;
7953 DWORD lasterr;
7956 static const struct access_res create[16] =
7958 { TRUE, ERROR_SUCCESS },
7959 { TRUE, ERROR_SUCCESS },
7960 { TRUE, ERROR_SUCCESS },
7961 { TRUE, ERROR_SUCCESS },
7962 { FALSE, ERROR_SHARING_VIOLATION },
7963 { FALSE, ERROR_SHARING_VIOLATION },
7964 { FALSE, ERROR_SHARING_VIOLATION },
7965 { TRUE, ERROR_SUCCESS },
7966 { FALSE, ERROR_SHARING_VIOLATION },
7967 { FALSE, ERROR_SHARING_VIOLATION },
7968 { FALSE, ERROR_SHARING_VIOLATION },
7969 { TRUE, ERROR_SUCCESS },
7970 { FALSE, ERROR_SHARING_VIOLATION },
7971 { FALSE, ERROR_SHARING_VIOLATION },
7972 { FALSE, ERROR_SHARING_VIOLATION },
7973 { TRUE, ERROR_SUCCESS }
7976 static const struct access_res create_commit[16] =
7978 { TRUE, ERROR_SUCCESS },
7979 { TRUE, ERROR_SUCCESS },
7980 { TRUE, ERROR_SUCCESS },
7981 { TRUE, ERROR_SUCCESS },
7982 { FALSE, ERROR_SHARING_VIOLATION },
7983 { FALSE, ERROR_SHARING_VIOLATION },
7984 { FALSE, ERROR_SHARING_VIOLATION },
7985 { TRUE, ERROR_SUCCESS },
7986 { FALSE, ERROR_SHARING_VIOLATION },
7987 { FALSE, ERROR_SHARING_VIOLATION },
7988 { FALSE, ERROR_SHARING_VIOLATION },
7989 { TRUE, ERROR_SUCCESS },
7990 { FALSE, ERROR_SHARING_VIOLATION },
7991 { FALSE, ERROR_SHARING_VIOLATION },
7992 { FALSE, ERROR_SHARING_VIOLATION },
7993 { TRUE, ERROR_SUCCESS }
7996 static const struct access_res create_close[16] =
7998 { TRUE, ERROR_SUCCESS },
7999 { TRUE, ERROR_SUCCESS },
8000 { TRUE, ERROR_SUCCESS },
8001 { TRUE, ERROR_SUCCESS },
8002 { TRUE, ERROR_SUCCESS },
8003 { TRUE, ERROR_SUCCESS },
8004 { TRUE, ERROR_SUCCESS },
8005 { TRUE, ERROR_SUCCESS },
8006 { TRUE, ERROR_SUCCESS },
8007 { TRUE, ERROR_SUCCESS },
8008 { TRUE, ERROR_SUCCESS },
8009 { TRUE, ERROR_SUCCESS },
8010 { TRUE, ERROR_SUCCESS },
8011 { TRUE, ERROR_SUCCESS },
8012 { TRUE, ERROR_SUCCESS },
8013 { TRUE, ERROR_SUCCESS }
8016 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
8018 DWORD access = 0, share = 0;
8019 DWORD lasterr;
8020 HANDLE hfile;
8021 int i, j, idx = 0;
8023 for (i = 0; i < 4; i++)
8025 if (i == 0) access = 0;
8026 if (i == 1) access = GENERIC_READ;
8027 if (i == 2) access = GENERIC_WRITE;
8028 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
8030 for (j = 0; j < 4; j++)
8032 if (j == 0) share = 0;
8033 if (j == 1) share = FILE_SHARE_READ;
8034 if (j == 2) share = FILE_SHARE_WRITE;
8035 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
8037 SetLastError(0xdeadbeef);
8038 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
8039 FILE_ATTRIBUTE_NORMAL, 0);
8040 lasterr = GetLastError();
8042 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
8043 "(%d, handle, %d): Expected %d, got %d\n",
8044 line, idx, ares[idx].gothandle,
8045 (hfile != INVALID_HANDLE_VALUE));
8047 ok(lasterr == ares[idx].lasterr,
8048 "(%d, lasterr, %d): Expected %d, got %d\n",
8049 line, idx, ares[idx].lasterr, lasterr);
8051 CloseHandle(hfile);
8052 idx++;
8057 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
8059 static void test_access(void)
8061 MSIHANDLE hdb;
8062 UINT r;
8064 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
8065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8067 test_file_access(msifile, create);
8069 r = MsiDatabaseCommit(hdb);
8070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8072 test_file_access(msifile, create_commit);
8074 MsiCloseHandle(hdb);
8076 test_file_access(msifile, create_close);
8078 DeleteFileA(msifile);
8080 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
8081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8083 test_file_access(msifile, create);
8085 r = MsiDatabaseCommit(hdb);
8086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8088 test_file_access(msifile, create_commit);
8090 MsiCloseHandle(hdb);
8092 test_file_access(msifile, create_close);
8094 DeleteFileA(msifile);
8097 START_TEST(package)
8099 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
8101 test_createpackage();
8102 test_doaction();
8103 test_gettargetpath_bad();
8104 test_settargetpath();
8105 test_props();
8106 test_property_table();
8107 test_condition();
8108 test_msipackage();
8109 test_formatrecord2();
8110 test_states();
8111 test_getproperty();
8112 test_removefiles();
8113 test_appsearch();
8114 test_featureparents();
8115 test_installprops();
8116 test_launchconditions();
8117 test_ccpsearch();
8118 test_complocator();
8119 test_MsiGetSourcePath();
8120 test_shortlongsource();
8121 test_sourcedir();
8122 test_access();