push e5b2529cdc55a2e67d855677d8651b2d2fa8d45f
[wine/hacks.git] / dlls / msi / tests / package.c
blobec299ead9045f50c025b2b0615c309bd317ece11
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 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3032 state = 0xdeadbee;
3033 action = 0xdeadbee;
3034 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3036 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3037 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3039 state = 0xdeadbee;
3040 action = 0xdeadbee;
3041 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3042 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3043 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3044 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3046 state = 0xdeadbee;
3047 action = 0xdeadbee;
3048 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3049 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3050 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3051 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3053 state = 0xdeadbee;
3054 action = 0xdeadbee;
3055 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3056 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3057 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3058 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3060 state = 0xdeadbee;
3061 action = 0xdeadbee;
3062 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3064 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3065 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3067 state = 0xdeadbee;
3068 action = 0xdeadbee;
3069 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3071 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3072 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3074 state = 0xdeadbee;
3075 action = 0xdeadbee;
3076 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3078 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3079 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3081 state = 0xdeadbee;
3082 action = 0xdeadbee;
3083 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3085 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3086 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3088 state = 0xdeadbee;
3089 action = 0xdeadbee;
3090 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3092 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3093 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3095 state = 0xdeadbee;
3096 action = 0xdeadbee;
3097 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3098 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3099 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3100 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3102 state = 0xdeadbee;
3103 action = 0xdeadbee;
3104 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3105 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3106 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3107 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3109 state = 0xdeadbee;
3110 action = 0xdeadbee;
3111 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3112 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3113 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3114 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3116 state = 0xdeadbee;
3117 action = 0xdeadbee;
3118 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3119 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3120 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3121 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3123 state = 0xdeadbee;
3124 action = 0xdeadbee;
3125 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3126 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3127 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3128 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3130 state = 0xdeadbee;
3131 action = 0xdeadbee;
3132 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3133 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3134 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3135 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3137 state = 0xdeadbee;
3138 action = 0xdeadbee;
3139 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3140 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3141 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3142 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3144 state = 0xdeadbee;
3145 action = 0xdeadbee;
3146 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3147 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3148 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3149 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3151 state = 0xdeadbee;
3152 action = 0xdeadbee;
3153 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3155 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3156 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3158 state = 0xdeadbee;
3159 action = 0xdeadbee;
3160 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3161 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3162 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3163 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3165 MsiCloseHandle( hpkg );
3167 /* publish the features and components */
3168 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3171 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3172 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3174 /* these properties must not be in the saved msi file */
3175 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3176 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3178 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3179 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3181 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3182 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3184 hpkg = package_from_db( hdb );
3185 ok( hpkg, "failed to create package\n");
3187 MsiCloseHandle(hdb);
3189 state = 0xdeadbee;
3190 action = 0xdeadbee;
3191 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3192 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3193 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3194 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3196 state = 0xdeadbee;
3197 action = 0xdeadbee;
3198 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3199 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3200 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3201 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3203 state = 0xdeadbee;
3204 action = 0xdeadbee;
3205 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3206 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3207 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3208 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3210 state = 0xdeadbee;
3211 action = 0xdeadbee;
3212 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3213 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3214 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3215 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3217 state = 0xdeadbee;
3218 action = 0xdeadbee;
3219 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3220 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3221 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3222 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3224 state = 0xdeadbee;
3225 action = 0xdeadbee;
3226 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3227 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3228 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3229 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3231 state = 0xdeadbee;
3232 action = 0xdeadbee;
3233 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3234 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3235 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3236 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3238 state = 0xdeadbee;
3239 action = 0xdeadbee;
3240 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3241 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3242 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3243 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3245 state = 0xdeadbee;
3246 action = 0xdeadbee;
3247 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3248 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3249 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3250 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3252 state = 0xdeadbee;
3253 action = 0xdeadbee;
3254 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3255 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3256 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3257 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3259 state = 0xdeadbee;
3260 action = 0xdeadbee;
3261 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3262 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3263 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3264 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3266 state = 0xdeadbee;
3267 action = 0xdeadbee;
3268 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3269 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3270 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3271 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3273 state = 0xdeadbee;
3274 action = 0xdeadbee;
3275 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3276 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3277 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3278 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3280 state = 0xdeadbee;
3281 action = 0xdeadbee;
3282 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3283 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3284 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3285 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3287 state = 0xdeadbee;
3288 action = 0xdeadbee;
3289 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3290 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3291 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3292 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3294 state = 0xdeadbee;
3295 action = 0xdeadbee;
3296 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3297 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3298 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3299 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3301 state = 0xdeadbee;
3302 action = 0xdeadbee;
3303 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3304 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3305 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3306 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3308 state = 0xdeadbee;
3309 action = 0xdeadbee;
3310 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3311 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3312 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3313 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3315 state = 0xdeadbee;
3316 action = 0xdeadbee;
3317 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3318 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3319 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3320 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3322 state = 0xdeadbee;
3323 action = 0xdeadbee;
3324 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3325 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3326 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3327 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3329 state = 0xdeadbee;
3330 action = 0xdeadbee;
3331 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3332 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3333 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3334 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3336 state = 0xdeadbee;
3337 action = 0xdeadbee;
3338 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3339 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3340 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3341 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3343 state = 0xdeadbee;
3344 action = 0xdeadbee;
3345 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3346 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3347 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3348 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3350 state = 0xdeadbee;
3351 action = 0xdeadbee;
3352 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3353 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3354 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3355 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3357 state = 0xdeadbee;
3358 action = 0xdeadbee;
3359 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3360 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3361 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3362 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3364 r = MsiDoAction( hpkg, "CostInitialize");
3365 ok( r == ERROR_SUCCESS, "cost init failed\n");
3367 state = 0xdeadbee;
3368 action = 0xdeadbee;
3369 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3371 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3372 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3374 state = 0xdeadbee;
3375 action = 0xdeadbee;
3376 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3378 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3381 state = 0xdeadbee;
3382 action = 0xdeadbee;
3383 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3388 state = 0xdeadbee;
3389 action = 0xdeadbee;
3390 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3391 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3392 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3393 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3395 state = 0xdeadbee;
3396 action = 0xdeadbee;
3397 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3399 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3402 state = 0xdeadbee;
3403 action = 0xdeadbee;
3404 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3406 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3407 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3409 state = 0xdeadbee;
3410 action = 0xdeadbee;
3411 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3413 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3416 state = 0xdeadbee;
3417 action = 0xdeadbee;
3418 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3420 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3423 state = 0xdeadbee;
3424 action = 0xdeadbee;
3425 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3430 state = 0xdeadbee;
3431 action = 0xdeadbee;
3432 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3437 state = 0xdeadbee;
3438 action = 0xdeadbee;
3439 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3441 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3442 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3444 state = 0xdeadbee;
3445 action = 0xdeadbee;
3446 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3448 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3449 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3451 state = 0xdeadbee;
3452 action = 0xdeadbee;
3453 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3455 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3456 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3458 state = 0xdeadbee;
3459 action = 0xdeadbee;
3460 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3462 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3463 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3465 state = 0xdeadbee;
3466 action = 0xdeadbee;
3467 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3469 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3472 state = 0xdeadbee;
3473 action = 0xdeadbee;
3474 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3475 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3476 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3477 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3479 state = 0xdeadbee;
3480 action = 0xdeadbee;
3481 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3482 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3483 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3484 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3486 state = 0xdeadbee;
3487 action = 0xdeadbee;
3488 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3490 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3491 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3493 state = 0xdeadbee;
3494 action = 0xdeadbee;
3495 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3496 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3497 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3498 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3500 state = 0xdeadbee;
3501 action = 0xdeadbee;
3502 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3503 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3504 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3505 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3507 state = 0xdeadbee;
3508 action = 0xdeadbee;
3509 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3510 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3511 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3512 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3514 state = 0xdeadbee;
3515 action = 0xdeadbee;
3516 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3517 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3518 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3519 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3521 state = 0xdeadbee;
3522 action = 0xdeadbee;
3523 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3524 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3525 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3526 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3528 state = 0xdeadbee;
3529 action = 0xdeadbee;
3530 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3531 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3532 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3533 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3535 state = 0xdeadbee;
3536 action = 0xdeadbee;
3537 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3538 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3539 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3540 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3542 r = MsiDoAction( hpkg, "FileCost");
3543 ok( r == ERROR_SUCCESS, "file cost failed\n");
3545 state = 0xdeadbee;
3546 action = 0xdeadbee;
3547 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3549 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3550 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3552 state = 0xdeadbee;
3553 action = 0xdeadbee;
3554 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3556 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3557 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3559 state = 0xdeadbee;
3560 action = 0xdeadbee;
3561 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3563 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3564 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3566 state = 0xdeadbee;
3567 action = 0xdeadbee;
3568 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3569 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3570 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3571 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3573 state = 0xdeadbee;
3574 action = 0xdeadbee;
3575 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3576 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3577 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3578 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3580 state = 0xdeadbee;
3581 action = 0xdeadbee;
3582 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3583 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3584 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3585 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3587 state = 0xdeadbee;
3588 action = 0xdeadbee;
3589 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3590 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3591 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3592 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3594 state = 0xdeadbee;
3595 action = 0xdeadbee;
3596 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3597 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3598 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3599 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3601 state = 0xdeadbee;
3602 action = 0xdeadbee;
3603 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3604 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3605 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3606 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3608 state = 0xdeadbee;
3609 action = 0xdeadbee;
3610 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3612 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3613 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3615 state = 0xdeadbee;
3616 action = 0xdeadbee;
3617 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3619 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3620 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3622 state = 0xdeadbee;
3623 action = 0xdeadbee;
3624 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3625 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3626 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3627 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3629 state = 0xdeadbee;
3630 action = 0xdeadbee;
3631 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3633 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3634 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3636 state = 0xdeadbee;
3637 action = 0xdeadbee;
3638 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3639 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3640 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3641 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3643 state = 0xdeadbee;
3644 action = 0xdeadbee;
3645 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3647 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3648 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3650 state = 0xdeadbee;
3651 action = 0xdeadbee;
3652 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3654 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3655 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3657 state = 0xdeadbee;
3658 action = 0xdeadbee;
3659 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3661 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3664 state = 0xdeadbee;
3665 action = 0xdeadbee;
3666 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3668 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3671 state = 0xdeadbee;
3672 action = 0xdeadbee;
3673 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3675 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3676 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3678 state = 0xdeadbee;
3679 action = 0xdeadbee;
3680 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3682 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3683 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3685 state = 0xdeadbee;
3686 action = 0xdeadbee;
3687 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3689 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3690 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3692 state = 0xdeadbee;
3693 action = 0xdeadbee;
3694 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3696 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3697 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3699 state = 0xdeadbee;
3700 action = 0xdeadbee;
3701 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3703 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3704 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3706 state = 0xdeadbee;
3707 action = 0xdeadbee;
3708 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3710 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3711 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3713 state = 0xdeadbee;
3714 action = 0xdeadbee;
3715 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3717 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3718 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3720 r = MsiDoAction( hpkg, "CostFinalize");
3721 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3723 state = 0xdeadbee;
3724 action = 0xdeadbee;
3725 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3726 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3727 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3728 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3730 state = 0xdeadbee;
3731 action = 0xdeadbee;
3732 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3733 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3734 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3735 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3737 state = 0xdeadbee;
3738 action = 0xdeadbee;
3739 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3740 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3741 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3742 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3744 state = 0xdeadbee;
3745 action = 0xdeadbee;
3746 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3747 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3748 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3749 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3751 state = 0xdeadbee;
3752 action = 0xdeadbee;
3753 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3755 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3756 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3758 state = 0xdeadbee;
3759 action = 0xdeadbee;
3760 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3762 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3763 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3765 state = 0xdeadbee;
3766 action = 0xdeadbee;
3767 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3768 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3769 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3770 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3772 state = 0xdeadbee;
3773 action = 0xdeadbee;
3774 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3775 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3776 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3777 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3779 state = 0xdeadbee;
3780 action = 0xdeadbee;
3781 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3783 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3784 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3786 state = 0xdeadbee;
3787 action = 0xdeadbee;
3788 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3790 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3791 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3793 state = 0xdeadbee;
3794 action = 0xdeadbee;
3795 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3797 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3798 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3800 state = 0xdeadbee;
3801 action = 0xdeadbee;
3802 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3804 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3805 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3807 state = 0xdeadbee;
3808 action = 0xdeadbee;
3809 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3811 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3812 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3814 state = 0xdeadbee;
3815 action = 0xdeadbee;
3816 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3818 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3819 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3821 state = 0xdeadbee;
3822 action = 0xdeadbee;
3823 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3824 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3825 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3826 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3828 state = 0xdeadbee;
3829 action = 0xdeadbee;
3830 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3831 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3832 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3833 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3835 state = 0xdeadbee;
3836 action = 0xdeadbee;
3837 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3839 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3840 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3842 state = 0xdeadbee;
3843 action = 0xdeadbee;
3844 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3845 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3846 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3847 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3849 state = 0xdeadbee;
3850 action = 0xdeadbee;
3851 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3852 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3853 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3854 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3856 state = 0xdeadbee;
3857 action = 0xdeadbee;
3858 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3859 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3860 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3861 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3863 state = 0xdeadbee;
3864 action = 0xdeadbee;
3865 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3867 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3868 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3870 state = 0xdeadbee;
3871 action = 0xdeadbee;
3872 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3874 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3875 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3877 state = 0xdeadbee;
3878 action = 0xdeadbee;
3879 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3881 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3882 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3884 state = 0xdeadbee;
3885 action = 0xdeadbee;
3886 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3888 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3889 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3891 state = 0xdeadbee;
3892 action = 0xdeadbee;
3893 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3894 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3895 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3896 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3898 MsiCloseHandle(hpkg);
3900 /* uninstall the product */
3901 r = MsiInstallProduct(msifile, "REMOVE=ALL");
3902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3904 /* all features installed locally */
3905 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
3906 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3908 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
3909 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3911 /* these properties must not be in the saved msi file */
3912 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven'");
3913 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3915 hpkg = package_from_db( hdb );
3916 ok( hpkg, "failed to create package\n");
3918 state = 0xdeadbee;
3919 action = 0xdeadbee;
3920 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3921 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3925 state = 0xdeadbee;
3926 action = 0xdeadbee;
3927 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3928 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3932 state = 0xdeadbee;
3933 action = 0xdeadbee;
3934 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3935 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3939 state = 0xdeadbee;
3940 action = 0xdeadbee;
3941 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3942 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3946 state = 0xdeadbee;
3947 action = 0xdeadbee;
3948 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3949 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3953 state = 0xdeadbee;
3954 action = 0xdeadbee;
3955 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3956 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3960 state = 0xdeadbee;
3961 action = 0xdeadbee;
3962 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3963 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3967 state = 0xdeadbee;
3968 action = 0xdeadbee;
3969 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3970 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3971 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3972 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3974 state = 0xdeadbee;
3975 action = 0xdeadbee;
3976 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3977 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3978 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3979 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3981 state = 0xdeadbee;
3982 action = 0xdeadbee;
3983 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3984 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3985 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3986 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3988 state = 0xdeadbee;
3989 action = 0xdeadbee;
3990 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3991 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3992 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3993 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3995 state = 0xdeadbee;
3996 action = 0xdeadbee;
3997 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3998 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3999 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4000 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4002 state = 0xdeadbee;
4003 action = 0xdeadbee;
4004 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4005 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4006 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4007 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4009 state = 0xdeadbee;
4010 action = 0xdeadbee;
4011 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4012 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4013 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4014 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4016 state = 0xdeadbee;
4017 action = 0xdeadbee;
4018 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4019 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4020 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4021 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4023 state = 0xdeadbee;
4024 action = 0xdeadbee;
4025 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4026 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4027 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4028 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4030 state = 0xdeadbee;
4031 action = 0xdeadbee;
4032 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4033 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4034 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4035 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4037 state = 0xdeadbee;
4038 action = 0xdeadbee;
4039 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4040 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4041 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4042 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4044 state = 0xdeadbee;
4045 action = 0xdeadbee;
4046 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4047 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4048 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4049 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4051 state = 0xdeadbee;
4052 action = 0xdeadbee;
4053 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4054 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4055 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4056 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4058 state = 0xdeadbee;
4059 action = 0xdeadbee;
4060 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4061 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4062 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4063 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4065 state = 0xdeadbee;
4066 action = 0xdeadbee;
4067 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4068 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4069 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4070 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4072 state = 0xdeadbee;
4073 action = 0xdeadbee;
4074 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4075 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4076 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4077 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4079 state = 0xdeadbee;
4080 action = 0xdeadbee;
4081 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4082 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4083 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4084 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4086 state = 0xdeadbee;
4087 action = 0xdeadbee;
4088 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4089 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4090 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4091 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4093 r = MsiDoAction( hpkg, "CostInitialize");
4094 ok( r == ERROR_SUCCESS, "cost init failed\n");
4096 state = 0xdeadbee;
4097 action = 0xdeadbee;
4098 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4103 state = 0xdeadbee;
4104 action = 0xdeadbee;
4105 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4110 state = 0xdeadbee;
4111 action = 0xdeadbee;
4112 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4117 state = 0xdeadbee;
4118 action = 0xdeadbee;
4119 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4124 state = 0xdeadbee;
4125 action = 0xdeadbee;
4126 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4131 state = 0xdeadbee;
4132 action = 0xdeadbee;
4133 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4138 state = 0xdeadbee;
4139 action = 0xdeadbee;
4140 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4145 state = 0xdeadbee;
4146 action = 0xdeadbee;
4147 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4152 state = 0xdeadbee;
4153 action = 0xdeadbee;
4154 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4159 state = 0xdeadbee;
4160 action = 0xdeadbee;
4161 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4166 state = 0xdeadbee;
4167 action = 0xdeadbee;
4168 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4173 state = 0xdeadbee;
4174 action = 0xdeadbee;
4175 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4180 state = 0xdeadbee;
4181 action = 0xdeadbee;
4182 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4187 state = 0xdeadbee;
4188 action = 0xdeadbee;
4189 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4190 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4191 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4194 state = 0xdeadbee;
4195 action = 0xdeadbee;
4196 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4197 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4198 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4199 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4201 state = 0xdeadbee;
4202 action = 0xdeadbee;
4203 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4204 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4205 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4206 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4208 state = 0xdeadbee;
4209 action = 0xdeadbee;
4210 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4211 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4212 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4213 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4215 state = 0xdeadbee;
4216 action = 0xdeadbee;
4217 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4219 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4220 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4222 state = 0xdeadbee;
4223 action = 0xdeadbee;
4224 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4226 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4227 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4229 state = 0xdeadbee;
4230 action = 0xdeadbee;
4231 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4233 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4234 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4236 state = 0xdeadbee;
4237 action = 0xdeadbee;
4238 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4240 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4241 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4243 state = 0xdeadbee;
4244 action = 0xdeadbee;
4245 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4247 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4250 state = 0xdeadbee;
4251 action = 0xdeadbee;
4252 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4254 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4255 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4257 state = 0xdeadbee;
4258 action = 0xdeadbee;
4259 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4261 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4264 state = 0xdeadbee;
4265 action = 0xdeadbee;
4266 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4268 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4269 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4271 r = MsiDoAction( hpkg, "FileCost");
4272 ok( r == ERROR_SUCCESS, "file cost failed\n");
4274 state = 0xdeadbee;
4275 action = 0xdeadbee;
4276 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4281 state = 0xdeadbee;
4282 action = 0xdeadbee;
4283 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4288 state = 0xdeadbee;
4289 action = 0xdeadbee;
4290 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4295 state = 0xdeadbee;
4296 action = 0xdeadbee;
4297 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4302 state = 0xdeadbee;
4303 action = 0xdeadbee;
4304 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4309 state = 0xdeadbee;
4310 action = 0xdeadbee;
4311 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4316 state = 0xdeadbee;
4317 action = 0xdeadbee;
4318 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4323 state = 0xdeadbee;
4324 action = 0xdeadbee;
4325 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4330 state = 0xdeadbee;
4331 action = 0xdeadbee;
4332 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4337 state = 0xdeadbee;
4338 action = 0xdeadbee;
4339 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4344 state = 0xdeadbee;
4345 action = 0xdeadbee;
4346 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4351 state = 0xdeadbee;
4352 action = 0xdeadbee;
4353 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4358 state = 0xdeadbee;
4359 action = 0xdeadbee;
4360 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4362 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4365 state = 0xdeadbee;
4366 action = 0xdeadbee;
4367 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4372 state = 0xdeadbee;
4373 action = 0xdeadbee;
4374 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4376 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4379 state = 0xdeadbee;
4380 action = 0xdeadbee;
4381 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4383 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4386 state = 0xdeadbee;
4387 action = 0xdeadbee;
4388 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4390 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4391 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4393 state = 0xdeadbee;
4394 action = 0xdeadbee;
4395 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4397 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4398 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4400 state = 0xdeadbee;
4401 action = 0xdeadbee;
4402 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4404 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4405 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4407 state = 0xdeadbee;
4408 action = 0xdeadbee;
4409 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4411 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4412 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4414 state = 0xdeadbee;
4415 action = 0xdeadbee;
4416 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4418 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4419 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4421 state = 0xdeadbee;
4422 action = 0xdeadbee;
4423 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4424 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4425 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4426 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4428 state = 0xdeadbee;
4429 action = 0xdeadbee;
4430 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4431 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4432 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4433 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4435 state = 0xdeadbee;
4436 action = 0xdeadbee;
4437 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4438 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4439 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4440 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4442 state = 0xdeadbee;
4443 action = 0xdeadbee;
4444 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4445 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4446 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4447 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4449 r = MsiDoAction( hpkg, "CostFinalize");
4450 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4452 state = 0xdeadbee;
4453 action = 0xdeadbee;
4454 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4456 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4457 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4459 state = 0xdeadbee;
4460 action = 0xdeadbee;
4461 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4463 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4464 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4466 state = 0xdeadbee;
4467 action = 0xdeadbee;
4468 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4470 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4471 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4473 state = 0xdeadbee;
4474 action = 0xdeadbee;
4475 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4477 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4478 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4480 state = 0xdeadbee;
4481 action = 0xdeadbee;
4482 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4484 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4485 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4487 state = 0xdeadbee;
4488 action = 0xdeadbee;
4489 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4491 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4492 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4494 state = 0xdeadbee;
4495 action = 0xdeadbee;
4496 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4498 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4499 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4501 state = 0xdeadbee;
4502 action = 0xdeadbee;
4503 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4505 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4506 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4508 state = 0xdeadbee;
4509 action = 0xdeadbee;
4510 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4512 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4513 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4515 state = 0xdeadbee;
4516 action = 0xdeadbee;
4517 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4519 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4520 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4522 state = 0xdeadbee;
4523 action = 0xdeadbee;
4524 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4526 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4527 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4529 state = 0xdeadbee;
4530 action = 0xdeadbee;
4531 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4533 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4534 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4536 state = 0xdeadbee;
4537 action = 0xdeadbee;
4538 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4540 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4541 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4543 state = 0xdeadbee;
4544 action = 0xdeadbee;
4545 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4547 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4548 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4550 state = 0xdeadbee;
4551 action = 0xdeadbee;
4552 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4554 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4555 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4557 state = 0xdeadbee;
4558 action = 0xdeadbee;
4559 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4561 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4562 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4564 state = 0xdeadbee;
4565 action = 0xdeadbee;
4566 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4568 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4569 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4571 state = 0xdeadbee;
4572 action = 0xdeadbee;
4573 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4575 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4576 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4578 state = 0xdeadbee;
4579 action = 0xdeadbee;
4580 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4582 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4583 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4585 state = 0xdeadbee;
4586 action = 0xdeadbee;
4587 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4589 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4590 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4592 state = 0xdeadbee;
4593 action = 0xdeadbee;
4594 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4596 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4597 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4599 state = 0xdeadbee;
4600 action = 0xdeadbee;
4601 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4603 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4604 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4606 state = 0xdeadbee;
4607 action = 0xdeadbee;
4608 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4610 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4611 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4613 state = 0xdeadbee;
4614 action = 0xdeadbee;
4615 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4617 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4618 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4620 state = 0xdeadbee;
4621 action = 0xdeadbee;
4622 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4624 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4625 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4627 MsiCloseHandle(hpkg);
4629 /* uninstall the product */
4630 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
4631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4633 /* all features installed from source */
4634 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
4635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4637 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
4638 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4640 /* this property must not be in the saved msi file */
4641 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven'");
4642 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4644 hpkg = package_from_db( hdb );
4645 ok( hpkg, "failed to create package\n");
4647 state = 0xdeadbee;
4648 action = 0xdeadbee;
4649 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4650 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4651 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4652 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4654 state = 0xdeadbee;
4655 action = 0xdeadbee;
4656 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4657 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4658 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4659 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4661 state = 0xdeadbee;
4662 action = 0xdeadbee;
4663 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4664 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4665 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4666 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4668 state = 0xdeadbee;
4669 action = 0xdeadbee;
4670 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4671 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4672 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4673 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4675 state = 0xdeadbee;
4676 action = 0xdeadbee;
4677 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4678 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4679 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4680 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4682 state = 0xdeadbee;
4683 action = 0xdeadbee;
4684 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4685 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4686 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4687 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4689 state = 0xdeadbee;
4690 action = 0xdeadbee;
4691 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4692 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4693 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4694 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4696 state = 0xdeadbee;
4697 action = 0xdeadbee;
4698 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4699 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4700 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4701 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4703 state = 0xdeadbee;
4704 action = 0xdeadbee;
4705 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4706 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4707 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4708 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4710 state = 0xdeadbee;
4711 action = 0xdeadbee;
4712 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4713 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4714 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4715 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4717 state = 0xdeadbee;
4718 action = 0xdeadbee;
4719 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4720 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4721 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4722 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4724 state = 0xdeadbee;
4725 action = 0xdeadbee;
4726 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4727 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4728 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4729 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4731 state = 0xdeadbee;
4732 action = 0xdeadbee;
4733 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4734 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4735 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4736 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4738 state = 0xdeadbee;
4739 action = 0xdeadbee;
4740 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4741 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4742 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4743 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4745 state = 0xdeadbee;
4746 action = 0xdeadbee;
4747 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4748 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4749 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4750 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4752 state = 0xdeadbee;
4753 action = 0xdeadbee;
4754 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4755 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4756 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4757 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4759 state = 0xdeadbee;
4760 action = 0xdeadbee;
4761 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4762 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4763 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4764 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4766 state = 0xdeadbee;
4767 action = 0xdeadbee;
4768 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4769 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4770 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4771 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4773 state = 0xdeadbee;
4774 action = 0xdeadbee;
4775 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4776 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4777 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4778 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4780 state = 0xdeadbee;
4781 action = 0xdeadbee;
4782 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4783 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4784 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4785 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4787 state = 0xdeadbee;
4788 action = 0xdeadbee;
4789 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4790 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4794 state = 0xdeadbee;
4795 action = 0xdeadbee;
4796 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4797 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4801 state = 0xdeadbee;
4802 action = 0xdeadbee;
4803 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4804 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4808 state = 0xdeadbee;
4809 action = 0xdeadbee;
4810 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4811 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4815 state = 0xdeadbee;
4816 action = 0xdeadbee;
4817 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4818 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4822 r = MsiDoAction( hpkg, "CostInitialize");
4823 ok( r == ERROR_SUCCESS, "cost init failed\n");
4825 state = 0xdeadbee;
4826 action = 0xdeadbee;
4827 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4829 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4830 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4832 state = 0xdeadbee;
4833 action = 0xdeadbee;
4834 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4835 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4836 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4837 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4839 state = 0xdeadbee;
4840 action = 0xdeadbee;
4841 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4842 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4843 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4844 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4846 state = 0xdeadbee;
4847 action = 0xdeadbee;
4848 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4850 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4851 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4853 state = 0xdeadbee;
4854 action = 0xdeadbee;
4855 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4856 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4857 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4858 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4860 state = 0xdeadbee;
4861 action = 0xdeadbee;
4862 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4863 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4864 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4865 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4867 state = 0xdeadbee;
4868 action = 0xdeadbee;
4869 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4870 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4871 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4872 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4874 state = 0xdeadbee;
4875 action = 0xdeadbee;
4876 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4877 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4878 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4879 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4881 state = 0xdeadbee;
4882 action = 0xdeadbee;
4883 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4884 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4885 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4886 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4888 state = 0xdeadbee;
4889 action = 0xdeadbee;
4890 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4891 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4892 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4893 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4895 state = 0xdeadbee;
4896 action = 0xdeadbee;
4897 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4898 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4899 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4900 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4902 state = 0xdeadbee;
4903 action = 0xdeadbee;
4904 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4905 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4906 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4907 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4909 state = 0xdeadbee;
4910 action = 0xdeadbee;
4911 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4912 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4913 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4914 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4916 state = 0xdeadbee;
4917 action = 0xdeadbee;
4918 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4920 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4921 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4923 state = 0xdeadbee;
4924 action = 0xdeadbee;
4925 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4927 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4930 state = 0xdeadbee;
4931 action = 0xdeadbee;
4932 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4934 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4935 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4937 state = 0xdeadbee;
4938 action = 0xdeadbee;
4939 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4941 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4942 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4944 state = 0xdeadbee;
4945 action = 0xdeadbee;
4946 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4948 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4951 state = 0xdeadbee;
4952 action = 0xdeadbee;
4953 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4955 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4956 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4958 state = 0xdeadbee;
4959 action = 0xdeadbee;
4960 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4962 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4963 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4965 state = 0xdeadbee;
4966 action = 0xdeadbee;
4967 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4969 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4972 state = 0xdeadbee;
4973 action = 0xdeadbee;
4974 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4979 state = 0xdeadbee;
4980 action = 0xdeadbee;
4981 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4986 state = 0xdeadbee;
4987 action = 0xdeadbee;
4988 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4993 state = 0xdeadbee;
4994 action = 0xdeadbee;
4995 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5000 r = MsiDoAction( hpkg, "FileCost");
5001 ok( r == ERROR_SUCCESS, "file cost failed\n");
5003 state = 0xdeadbee;
5004 action = 0xdeadbee;
5005 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5006 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5007 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5008 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5010 state = 0xdeadbee;
5011 action = 0xdeadbee;
5012 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5014 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5015 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5017 state = 0xdeadbee;
5018 action = 0xdeadbee;
5019 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5020 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5021 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5022 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5024 state = 0xdeadbee;
5025 action = 0xdeadbee;
5026 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5027 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5028 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5029 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5031 state = 0xdeadbee;
5032 action = 0xdeadbee;
5033 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5035 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5036 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5038 state = 0xdeadbee;
5039 action = 0xdeadbee;
5040 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5042 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5043 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5045 state = 0xdeadbee;
5046 action = 0xdeadbee;
5047 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5049 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5050 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5052 state = 0xdeadbee;
5053 action = 0xdeadbee;
5054 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5056 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5057 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5059 state = 0xdeadbee;
5060 action = 0xdeadbee;
5061 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5063 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5064 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5066 state = 0xdeadbee;
5067 action = 0xdeadbee;
5068 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5070 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5071 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5073 state = 0xdeadbee;
5074 action = 0xdeadbee;
5075 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5077 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5078 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5080 state = 0xdeadbee;
5081 action = 0xdeadbee;
5082 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5087 state = 0xdeadbee;
5088 action = 0xdeadbee;
5089 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5091 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5092 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5094 state = 0xdeadbee;
5095 action = 0xdeadbee;
5096 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5098 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5101 state = 0xdeadbee;
5102 action = 0xdeadbee;
5103 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5105 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5108 state = 0xdeadbee;
5109 action = 0xdeadbee;
5110 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5112 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5115 state = 0xdeadbee;
5116 action = 0xdeadbee;
5117 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5122 state = 0xdeadbee;
5123 action = 0xdeadbee;
5124 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5129 state = 0xdeadbee;
5130 action = 0xdeadbee;
5131 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5136 state = 0xdeadbee;
5137 action = 0xdeadbee;
5138 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5143 state = 0xdeadbee;
5144 action = 0xdeadbee;
5145 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5150 state = 0xdeadbee;
5151 action = 0xdeadbee;
5152 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5157 state = 0xdeadbee;
5158 action = 0xdeadbee;
5159 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5164 state = 0xdeadbee;
5165 action = 0xdeadbee;
5166 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5171 state = 0xdeadbee;
5172 action = 0xdeadbee;
5173 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5178 r = MsiDoAction( hpkg, "CostFinalize");
5179 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5181 state = 0xdeadbee;
5182 action = 0xdeadbee;
5183 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5184 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5185 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5186 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5188 state = 0xdeadbee;
5189 action = 0xdeadbee;
5190 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5191 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5192 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5193 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5195 state = 0xdeadbee;
5196 action = 0xdeadbee;
5197 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5199 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5200 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5202 state = 0xdeadbee;
5203 action = 0xdeadbee;
5204 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5205 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5206 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5207 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5209 state = 0xdeadbee;
5210 action = 0xdeadbee;
5211 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5212 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5213 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5214 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5216 state = 0xdeadbee;
5217 action = 0xdeadbee;
5218 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5219 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5220 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5221 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5223 state = 0xdeadbee;
5224 action = 0xdeadbee;
5225 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5226 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5227 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5228 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5230 state = 0xdeadbee;
5231 action = 0xdeadbee;
5232 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5234 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5235 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5237 state = 0xdeadbee;
5238 action = 0xdeadbee;
5239 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5240 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5241 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5242 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5244 state = 0xdeadbee;
5245 action = 0xdeadbee;
5246 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5247 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5248 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5249 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5251 state = 0xdeadbee;
5252 action = 0xdeadbee;
5253 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5254 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5255 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5256 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5258 state = 0xdeadbee;
5259 action = 0xdeadbee;
5260 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5261 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5262 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5263 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5265 state = 0xdeadbee;
5266 action = 0xdeadbee;
5267 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5268 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5269 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5270 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5272 state = 0xdeadbee;
5273 action = 0xdeadbee;
5274 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5275 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5276 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5277 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5279 state = 0xdeadbee;
5280 action = 0xdeadbee;
5281 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5282 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5283 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5284 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5286 state = 0xdeadbee;
5287 action = 0xdeadbee;
5288 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5289 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5290 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5291 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5293 state = 0xdeadbee;
5294 action = 0xdeadbee;
5295 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5296 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5297 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5300 state = 0xdeadbee;
5301 action = 0xdeadbee;
5302 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5303 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5304 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5305 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5307 state = 0xdeadbee;
5308 action = 0xdeadbee;
5309 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5310 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5311 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5312 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5314 state = 0xdeadbee;
5315 action = 0xdeadbee;
5316 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5318 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5321 state = 0xdeadbee;
5322 action = 0xdeadbee;
5323 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5325 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5326 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5328 state = 0xdeadbee;
5329 action = 0xdeadbee;
5330 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5332 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5333 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5335 state = 0xdeadbee;
5336 action = 0xdeadbee;
5337 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5339 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5342 state = 0xdeadbee;
5343 action = 0xdeadbee;
5344 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5346 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5349 state = 0xdeadbee;
5350 action = 0xdeadbee;
5351 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5353 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5354 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5356 MsiCloseHandle(hpkg);
5358 /* uninstall the product */
5359 r = MsiInstallProduct(msifile3, "REMOVE=ALL");
5360 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5362 DeleteFileA(msifile);
5363 DeleteFileA(msifile2);
5364 DeleteFileA(msifile3);
5367 static void test_getproperty(void)
5369 MSIHANDLE hPackage = 0;
5370 char prop[100];
5371 static CHAR empty[] = "";
5372 DWORD size;
5373 UINT r;
5375 hPackage = package_from_db(create_package_db());
5376 ok( hPackage != 0, " Failed to create package\n");
5378 /* set the property */
5379 r = MsiSetProperty(hPackage, "Name", "Value");
5380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5382 /* retrieve the size, NULL pointer */
5383 size = 0;
5384 r = MsiGetProperty(hPackage, "Name", NULL, &size);
5385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5386 ok( size == 5, "Expected 5, got %d\n", size);
5388 /* retrieve the size, empty string */
5389 size = 0;
5390 r = MsiGetProperty(hPackage, "Name", empty, &size);
5391 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5392 ok( size == 5, "Expected 5, got %d\n", size);
5394 /* don't change size */
5395 r = MsiGetProperty(hPackage, "Name", prop, &size);
5396 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5397 ok( size == 5, "Expected 5, got %d\n", size);
5398 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
5400 /* increase the size by 1 */
5401 size++;
5402 r = MsiGetProperty(hPackage, "Name", prop, &size);
5403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5404 ok( size == 5, "Expected 5, got %d\n", size);
5405 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
5407 r = MsiCloseHandle( hPackage);
5408 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
5409 DeleteFile(msifile);
5412 static void test_removefiles(void)
5414 MSIHANDLE hpkg;
5415 UINT r;
5416 MSIHANDLE hdb;
5418 hdb = create_package_db();
5419 ok ( hdb, "failed to create package database\n" );
5421 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
5422 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
5424 r = create_feature_table( hdb );
5425 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
5427 r = create_component_table( hdb );
5428 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
5430 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
5431 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5433 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
5434 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5436 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
5437 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5439 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
5440 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5442 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
5443 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5445 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
5446 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5448 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
5449 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5451 r = create_feature_components_table( hdb );
5452 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
5454 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
5455 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5457 r = add_feature_components_entry( hdb, "'one', 'helium'" );
5458 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5460 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
5461 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5463 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
5464 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5466 r = add_feature_components_entry( hdb, "'one', 'boron'" );
5467 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5469 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
5470 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5472 r = create_file_table( hdb );
5473 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
5475 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
5476 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5478 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
5479 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5481 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
5482 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5484 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
5485 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5487 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
5488 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5490 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
5491 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5493 r = create_remove_file_table( hdb );
5494 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
5496 hpkg = package_from_db( hdb );
5497 ok( hpkg, "failed to create package\n");
5499 MsiCloseHandle( hdb );
5501 create_test_file( "hydrogen.txt" );
5502 create_test_file( "helium.txt" );
5503 create_test_file( "lithium.txt" );
5504 create_test_file( "beryllium.txt" );
5505 create_test_file( "boron.txt" );
5506 create_test_file( "carbon.txt" );
5508 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
5509 ok( r == ERROR_SUCCESS, "set property failed\n");
5511 r = MsiDoAction( hpkg, "CostInitialize");
5512 ok( r == ERROR_SUCCESS, "cost init failed\n");
5514 r = MsiDoAction( hpkg, "FileCost");
5515 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5517 r = MsiDoAction( hpkg, "CostFinalize");
5518 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5520 r = MsiDoAction( hpkg, "InstallValidate");
5521 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5523 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
5524 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5526 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
5527 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5529 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
5530 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5532 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
5533 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5535 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
5536 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5538 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
5539 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5541 r = MsiDoAction( hpkg, "RemoveFiles");
5542 ok( r == ERROR_SUCCESS, "remove files failed\n");
5544 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
5545 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
5546 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
5547 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
5548 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
5549 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
5551 MsiCloseHandle( hpkg );
5552 DeleteFileA(msifile);
5555 static void test_appsearch(void)
5557 MSIHANDLE hpkg;
5558 UINT r;
5559 MSIHANDLE hdb;
5560 CHAR prop[MAX_PATH];
5561 DWORD size = MAX_PATH;
5563 hdb = create_package_db();
5564 ok ( hdb, "failed to create package database\n" );
5566 r = create_appsearch_table( hdb );
5567 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
5569 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
5570 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
5572 r = create_reglocator_table( hdb );
5573 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5575 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
5576 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5578 r = create_signature_table( hdb );
5579 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5581 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
5582 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5584 hpkg = package_from_db( hdb );
5585 ok( hpkg, "failed to create package\n");
5587 MsiCloseHandle( hdb );
5589 r = MsiDoAction( hpkg, "AppSearch" );
5590 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
5592 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
5593 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
5594 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
5596 MsiCloseHandle( hpkg );
5597 DeleteFileA(msifile);
5600 static void test_featureparents(void)
5602 MSIHANDLE hpkg;
5603 UINT r;
5604 MSIHANDLE hdb;
5605 INSTALLSTATE state, action;
5607 hdb = create_package_db();
5608 ok ( hdb, "failed to create package database\n" );
5610 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
5611 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
5613 r = create_feature_table( hdb );
5614 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
5616 r = create_component_table( hdb );
5617 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
5619 r = create_feature_components_table( hdb );
5620 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
5622 r = create_file_table( hdb );
5623 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
5625 /* msidbFeatureAttributesFavorLocal */
5626 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
5627 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5629 /* msidbFeatureAttributesFavorSource */
5630 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
5631 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5633 /* msidbFeatureAttributesFavorLocal */
5634 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
5635 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5637 /* disabled because of install level */
5638 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
5639 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5641 /* child feature of disabled feature */
5642 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
5643 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5645 /* component of disabled feature (install level) */
5646 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
5647 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5649 /* component of disabled child feature (install level) */
5650 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
5651 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5653 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5654 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
5655 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5657 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5658 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
5659 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5661 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5662 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
5663 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5665 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
5666 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
5667 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5669 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
5670 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
5671 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5673 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
5674 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
5675 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5677 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5678 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
5679 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5681 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5682 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
5683 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5685 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5686 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
5688 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
5689 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5691 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
5692 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5694 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
5695 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5697 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
5698 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5700 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
5701 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5703 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
5704 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5706 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
5707 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5709 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
5710 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5712 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
5713 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5715 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
5716 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5718 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
5719 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5721 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
5722 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5724 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
5725 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5727 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
5728 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5730 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
5731 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5733 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
5734 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5736 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
5737 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5739 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
5740 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5742 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
5743 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5745 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
5746 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5748 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
5749 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5751 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
5752 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5754 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
5755 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5757 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
5758 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5760 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
5761 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5763 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
5764 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5766 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
5767 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5769 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
5770 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5772 hpkg = package_from_db( hdb );
5773 ok( hpkg, "failed to create package\n");
5775 MsiCloseHandle( hdb );
5777 r = MsiDoAction( hpkg, "CostInitialize");
5778 ok( r == ERROR_SUCCESS, "cost init failed\n");
5780 r = MsiDoAction( hpkg, "FileCost");
5781 ok( r == ERROR_SUCCESS, "file cost failed\n");
5783 r = MsiDoAction( hpkg, "CostFinalize");
5784 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5786 state = 0xdeadbee;
5787 action = 0xdeadbee;
5788 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
5789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5790 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5791 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5793 state = 0xdeadbee;
5794 action = 0xdeadbee;
5795 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
5796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5797 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5798 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5800 state = 0xdeadbee;
5801 action = 0xdeadbee;
5802 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
5803 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5804 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5805 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5807 state = 0xdeadbee;
5808 action = 0xdeadbee;
5809 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
5810 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5811 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5812 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5814 state = 0xdeadbee;
5815 action = 0xdeadbee;
5816 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
5817 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5818 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5819 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5821 state = 0xdeadbee;
5822 action = 0xdeadbee;
5823 r = MsiGetComponentState(hpkg, "leo", &state, &action);
5824 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5825 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5826 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5828 state = 0xdeadbee;
5829 action = 0xdeadbee;
5830 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
5831 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5832 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
5833 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
5835 state = 0xdeadbee;
5836 action = 0xdeadbee;
5837 r = MsiGetComponentState(hpkg, "libra", &state, &action);
5838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5839 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
5840 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
5842 state = 0xdeadbee;
5843 action = 0xdeadbee;
5844 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
5845 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5846 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
5847 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
5849 state = 0xdeadbee;
5850 action = 0xdeadbee;
5851 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
5852 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5853 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
5854 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
5856 state = 0xdeadbee;
5857 action = 0xdeadbee;
5858 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
5859 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5860 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
5861 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
5863 state = 0xdeadbee;
5864 action = 0xdeadbee;
5865 r = MsiGetComponentState(hpkg, "canis", &state, &action);
5866 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5867 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
5868 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
5870 state = 0xdeadbee;
5871 action = 0xdeadbee;
5872 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
5873 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5874 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
5875 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
5877 state = 0xdeadbee;
5878 action = 0xdeadbee;
5879 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
5880 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5881 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
5882 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
5884 state = 0xdeadbee;
5885 action = 0xdeadbee;
5886 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
5887 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5888 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
5889 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
5891 state = 0xdeadbee;
5892 action = 0xdeadbee;
5893 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
5894 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5895 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
5896 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
5898 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
5899 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
5901 state = 0xdeadbee;
5902 action = 0xdeadbee;
5903 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
5904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5905 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
5906 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
5908 state = 0xdeadbee;
5909 action = 0xdeadbee;
5910 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
5911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5912 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
5913 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
5915 state = 0xdeadbee;
5916 action = 0xdeadbee;
5917 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
5918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5919 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
5920 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
5922 state = 0xdeadbee;
5923 action = 0xdeadbee;
5924 r = MsiGetComponentState(hpkg, "leo", &state, &action);
5925 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5926 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
5927 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
5929 state = 0xdeadbee;
5930 action = 0xdeadbee;
5931 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
5932 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5933 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
5934 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
5936 state = 0xdeadbee;
5937 action = 0xdeadbee;
5938 r = MsiGetComponentState(hpkg, "libra", &state, &action);
5939 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5940 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
5941 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
5943 state = 0xdeadbee;
5944 action = 0xdeadbee;
5945 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
5946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5947 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
5948 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
5950 state = 0xdeadbee;
5951 action = 0xdeadbee;
5952 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
5953 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5954 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
5955 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
5957 state = 0xdeadbee;
5958 action = 0xdeadbee;
5959 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
5960 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5961 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
5962 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
5964 state = 0xdeadbee;
5965 action = 0xdeadbee;
5966 r = MsiGetComponentState(hpkg, "canis", &state, &action);
5967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5968 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
5969 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
5971 state = 0xdeadbee;
5972 action = 0xdeadbee;
5973 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
5974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5975 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
5976 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
5978 state = 0xdeadbee;
5979 action = 0xdeadbee;
5980 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
5981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5982 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
5983 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
5985 state = 0xdeadbee;
5986 action = 0xdeadbee;
5987 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
5988 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5989 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
5990 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
5992 state = 0xdeadbee;
5993 action = 0xdeadbee;
5994 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
5995 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5996 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
5997 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
5999 MsiCloseHandle(hpkg);
6000 DeleteFileA(msifile);
6003 static void test_installprops(void)
6005 MSIHANDLE hpkg, hdb;
6006 CHAR path[MAX_PATH];
6007 CHAR buf[MAX_PATH];
6008 DWORD size, type;
6009 LANGID langid;
6010 HKEY hkey1, hkey2;
6011 int res;
6012 UINT r;
6014 GetCurrentDirectory(MAX_PATH, path);
6015 lstrcat(path, "\\");
6016 lstrcat(path, msifile);
6018 hdb = create_package_db();
6019 ok( hdb, "failed to create database\n");
6021 hpkg = package_from_db(hdb);
6022 ok( hpkg, "failed to create package\n");
6024 MsiCloseHandle(hdb);
6026 size = MAX_PATH;
6027 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
6028 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6029 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6031 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
6033 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
6035 size = MAX_PATH;
6036 type = REG_SZ;
6037 *path = '\0';
6038 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
6040 size = MAX_PATH;
6041 type = REG_SZ;
6042 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
6045 /* win9x doesn't set this */
6046 if (*path)
6048 size = MAX_PATH;
6049 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
6050 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6051 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6054 size = MAX_PATH;
6055 type = REG_SZ;
6056 *path = '\0';
6057 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
6059 size = MAX_PATH;
6060 type = REG_SZ;
6061 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
6064 if (*path)
6066 size = MAX_PATH;
6067 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
6068 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6069 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6072 size = MAX_PATH;
6073 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
6074 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6075 trace("VersionDatabase = %s\n", buf);
6077 size = MAX_PATH;
6078 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
6079 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6080 trace("VersionMsi = %s\n", buf);
6082 size = MAX_PATH;
6083 r = MsiGetProperty(hpkg, "Date", buf, &size);
6084 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6085 trace("Date = %s\n", buf);
6087 size = MAX_PATH;
6088 r = MsiGetProperty(hpkg, "Time", buf, &size);
6089 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6090 trace("Time = %s\n", buf);
6092 size = MAX_PATH;
6093 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
6094 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6095 trace("PackageCode = %s\n", buf);
6097 langid = GetUserDefaultLangID();
6098 sprintf(path, "%d", langid);
6100 size = MAX_PATH;
6101 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
6102 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
6103 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
6105 res = GetSystemMetrics(SM_CXSCREEN);
6106 size = MAX_PATH;
6107 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
6108 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
6110 res = GetSystemMetrics(SM_CYSCREEN);
6111 size = MAX_PATH;
6112 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
6113 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
6115 CloseHandle(hkey1);
6116 CloseHandle(hkey2);
6117 MsiCloseHandle(hpkg);
6118 DeleteFile(msifile);
6121 static void test_launchconditions(void)
6123 MSIHANDLE hpkg;
6124 MSIHANDLE hdb;
6125 UINT r;
6127 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6129 hdb = create_package_db();
6130 ok( hdb, "failed to create package database\n" );
6132 r = create_launchcondition_table( hdb );
6133 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
6135 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
6136 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
6138 /* invalid condition */
6139 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
6140 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
6142 hpkg = package_from_db( hdb );
6143 ok( hpkg, "failed to create package\n");
6145 MsiCloseHandle( hdb );
6147 r = MsiSetProperty( hpkg, "X", "1" );
6148 ok( r == ERROR_SUCCESS, "failed to set property\n" );
6150 /* invalid conditions are ignored */
6151 r = MsiDoAction( hpkg, "LaunchConditions" );
6152 ok( r == ERROR_SUCCESS, "cost init failed\n" );
6154 /* verify LaunchConditions still does some verification */
6155 r = MsiSetProperty( hpkg, "X", "2" );
6156 ok( r == ERROR_SUCCESS, "failed to set property\n" );
6158 r = MsiDoAction( hpkg, "LaunchConditions" );
6159 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
6161 MsiCloseHandle( hpkg );
6162 DeleteFile( msifile );
6165 static void test_ccpsearch(void)
6167 MSIHANDLE hdb, hpkg;
6168 CHAR prop[MAX_PATH];
6169 DWORD size = MAX_PATH;
6170 UINT r;
6172 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6174 hdb = create_package_db();
6175 ok(hdb, "failed to create package database\n");
6177 r = create_ccpsearch_table(hdb);
6178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6180 r = add_ccpsearch_entry(hdb, "'CCP_random'");
6181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6183 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
6184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6186 r = create_reglocator_table(hdb);
6187 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6189 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
6190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6192 r = create_drlocator_table(hdb);
6193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6195 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
6196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6198 r = create_signature_table(hdb);
6199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6201 hpkg = package_from_db(hdb);
6202 ok(hpkg, "failed to create package\n");
6204 MsiCloseHandle(hdb);
6206 r = MsiDoAction(hpkg, "CCPSearch");
6207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6209 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
6210 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6211 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
6213 MsiCloseHandle(hpkg);
6214 DeleteFileA(msifile);
6217 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
6219 DWORD i,n=1;
6220 GUID guid;
6222 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
6223 return FALSE;
6225 for(i=0; i<8; i++)
6226 out[7-i] = in[n++];
6227 n++;
6228 for(i=0; i<4; i++)
6229 out[11-i] = in[n++];
6230 n++;
6231 for(i=0; i<4; i++)
6232 out[15-i] = in[n++];
6233 n++;
6234 for(i=0; i<2; i++)
6236 out[17+i*2] = in[n++];
6237 out[16+i*2] = in[n++];
6239 n++;
6240 for( ; i<8; i++)
6242 out[17+i*2] = in[n++];
6243 out[16+i*2] = in[n++];
6245 out[32]=0;
6246 return TRUE;
6249 static void set_component_path(LPCSTR filename, LPCSTR guid)
6251 WCHAR guidW[MAX_PATH];
6252 WCHAR squashedW[MAX_PATH];
6253 CHAR squashed[MAX_PATH];
6254 CHAR substr[MAX_PATH];
6255 CHAR path[MAX_PATH];
6256 HKEY hkey;
6258 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
6259 squash_guid(guidW, squashedW);
6260 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
6262 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6263 "Installer\\UserData\\S-1-5-18\\Components\\");
6264 lstrcatA(substr, squashed);
6266 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
6268 lstrcpyA(path, CURR_DIR);
6269 lstrcatA(path, "\\");
6270 lstrcatA(path, filename);
6272 /* just using a random squashed product code */
6273 RegSetValueExA(hkey, "7D2F387510109040002000060BECB6AB", 0,
6274 REG_SZ, (LPBYTE)path, lstrlenA(path));
6276 RegCloseKey(hkey);
6278 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6279 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
6282 static void delete_component_path(LPCSTR guid)
6284 WCHAR guidW[MAX_PATH];
6285 WCHAR squashedW[MAX_PATH];
6286 WCHAR substrW[MAX_PATH];
6287 CHAR squashed[MAX_PATH];
6288 CHAR substr[MAX_PATH];
6290 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
6291 squash_guid(guidW, squashedW);
6292 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
6294 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6295 "Installer\\UserData\\S-1-5-18\\Components\\");
6296 lstrcatA(substr, squashed);
6298 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
6299 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
6301 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6302 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
6303 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
6306 static void test_complocator(void)
6308 MSIHANDLE hdb, hpkg;
6309 UINT r;
6310 CHAR prop[MAX_PATH];
6311 CHAR expected[MAX_PATH];
6312 DWORD size = MAX_PATH;
6314 hdb = create_package_db();
6315 ok(hdb, "failed to create package database\n");
6317 r = create_appsearch_table(hdb);
6318 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6320 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
6321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6323 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
6324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6326 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
6327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6329 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
6330 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6332 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
6333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6335 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
6336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6338 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
6339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6341 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
6342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6344 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
6345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6347 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
6348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6350 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
6351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6353 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
6354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6356 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
6357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6359 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
6360 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6362 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
6363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6365 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
6366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6368 r = create_complocator_table(hdb);
6369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6371 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
6372 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6374 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
6375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6377 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
6378 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6380 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
6381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6383 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
6384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6386 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
6387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6389 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
6390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6392 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
6393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6395 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
6396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6398 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
6399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6401 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
6402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6404 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
6405 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6407 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
6408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6410 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
6411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6413 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
6414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6416 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
6417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6419 r = create_signature_table(hdb);
6420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6422 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
6423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6425 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
6426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6428 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
6429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6431 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
6432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6434 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
6435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6437 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
6438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6440 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
6441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6443 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
6444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6446 hpkg = package_from_db(hdb);
6447 ok(hpkg, "failed to create package\n");
6449 MsiCloseHandle(hdb);
6451 create_test_file("abelisaurus");
6452 create_test_file("bactrosaurus");
6453 create_test_file("camelotia");
6454 create_test_file("diclonius");
6455 create_test_file("echinodon");
6456 create_test_file("falcarius");
6457 create_test_file("gallimimus");
6458 create_test_file("hagryphus");
6459 CreateDirectoryA("iguanodon", NULL);
6460 CreateDirectoryA("jobaria", NULL);
6461 CreateDirectoryA("kakuru", NULL);
6462 CreateDirectoryA("labocania", NULL);
6463 CreateDirectoryA("megaraptor", NULL);
6464 CreateDirectoryA("neosodon", NULL);
6465 CreateDirectoryA("olorotitan", NULL);
6466 CreateDirectoryA("pantydraco", NULL);
6468 set_component_path("abelisaurus", "{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6469 set_component_path("bactrosaurus", "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6470 set_component_path("echinodon", "{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6471 set_component_path("falcarius", "{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6472 set_component_path("iguanodon", "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6473 set_component_path("jobaria", "{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6474 set_component_path("megaraptor", "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6475 set_component_path("neosodon", "{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6477 r = MsiDoAction(hpkg, "AppSearch");
6478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6480 size = MAX_PATH;
6481 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
6482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6484 lstrcpyA(expected, CURR_DIR);
6485 lstrcatA(expected, "\\abelisaurus");
6486 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6487 "Expected %s or empty string, got %s\n", expected, prop);
6489 size = MAX_PATH;
6490 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
6491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6492 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6494 size = MAX_PATH;
6495 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
6496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6497 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6499 size = MAX_PATH;
6500 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
6501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6502 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6504 size = MAX_PATH;
6505 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
6506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6508 lstrcpyA(expected, CURR_DIR);
6509 lstrcatA(expected, "\\");
6510 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6511 "Expected %s or empty string, got %s\n", expected, prop);
6513 size = MAX_PATH;
6514 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
6515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6516 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6518 size = MAX_PATH;
6519 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
6520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6521 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6523 size = MAX_PATH;
6524 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
6525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6526 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6528 size = MAX_PATH;
6529 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
6530 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6531 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6533 size = MAX_PATH;
6534 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
6535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6536 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6538 size = MAX_PATH;
6539 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
6540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6541 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6543 size = MAX_PATH;
6544 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
6545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6546 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6548 size = MAX_PATH;
6549 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
6550 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6552 lstrcpyA(expected, CURR_DIR);
6553 lstrcatA(expected, "\\");
6554 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6555 "Expected %s or empty string, got %s\n", expected, prop);
6557 size = MAX_PATH;
6558 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
6559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6561 lstrcpyA(expected, CURR_DIR);
6562 lstrcatA(expected, "\\neosodon\\");
6563 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6564 "Expected %s or empty string, got %s\n", expected, prop);
6566 size = MAX_PATH;
6567 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
6568 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6569 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6571 size = MAX_PATH;
6572 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
6573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6574 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6576 MsiCloseHandle(hpkg);
6577 DeleteFileA("abelisaurus");
6578 DeleteFileA("bactrosaurus");
6579 DeleteFileA("camelotia");
6580 DeleteFileA("diclonius");
6581 DeleteFileA("echinodon");
6582 DeleteFileA("falcarius");
6583 DeleteFileA("gallimimus");
6584 DeleteFileA("hagryphus");
6585 RemoveDirectoryA("iguanodon");
6586 RemoveDirectoryA("jobaria");
6587 RemoveDirectoryA("kakuru");
6588 RemoveDirectoryA("labocania");
6589 RemoveDirectoryA("megaraptor");
6590 RemoveDirectoryA("neosodon");
6591 RemoveDirectoryA("olorotitan");
6592 RemoveDirectoryA("pantydraco");
6593 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6594 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6595 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6596 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6597 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6598 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6599 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6600 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6601 DeleteFileA(msifile);
6604 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
6606 MSIHANDLE summary;
6607 UINT r;
6609 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
6610 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6612 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
6613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6615 r = MsiSummaryInfoPersist(summary);
6616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6618 MsiCloseHandle(summary);
6621 static void test_MsiGetSourcePath(void)
6623 MSIHANDLE hdb, hpkg;
6624 CHAR path[MAX_PATH];
6625 CHAR cwd[MAX_PATH];
6626 CHAR subsrc[MAX_PATH];
6627 CHAR sub2[MAX_PATH];
6628 DWORD size;
6629 UINT r;
6631 lstrcpyA(cwd, CURR_DIR);
6632 lstrcatA(cwd, "\\");
6634 lstrcpyA(subsrc, cwd);
6635 lstrcatA(subsrc, "subsource");
6636 lstrcatA(subsrc, "\\");
6638 lstrcpyA(sub2, subsrc);
6639 lstrcatA(sub2, "sub2");
6640 lstrcatA(sub2, "\\");
6642 /* uncompressed source */
6644 hdb = create_package_db();
6645 ok( hdb, "failed to create database\n");
6647 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
6649 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
6650 ok(r == S_OK, "failed\n");
6652 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
6653 ok(r == S_OK, "failed\n");
6655 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
6656 ok(r == S_OK, "failed\n");
6658 r = MsiDatabaseCommit(hdb);
6659 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
6661 hpkg = package_from_db(hdb);
6662 ok(hpkg, "failed to create package\n");
6664 MsiCloseHandle(hdb);
6666 /* invalid database handle */
6667 size = MAX_PATH;
6668 lstrcpyA(path, "kiwi");
6669 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
6670 ok(r == ERROR_INVALID_HANDLE,
6671 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
6672 ok(!lstrcmpA(path, "kiwi"),
6673 "Expected path to be unchanged, got \"%s\"\n", path);
6674 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6676 /* NULL szFolder */
6677 size = MAX_PATH;
6678 lstrcpyA(path, "kiwi");
6679 r = MsiGetSourcePath(hpkg, NULL, path, &size);
6680 ok(r == ERROR_INVALID_PARAMETER,
6681 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
6682 ok(!lstrcmpA(path, "kiwi"),
6683 "Expected path to be unchanged, got \"%s\"\n", path);
6684 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6686 /* empty szFolder */
6687 size = MAX_PATH;
6688 lstrcpyA(path, "kiwi");
6689 r = MsiGetSourcePath(hpkg, "", path, &size);
6690 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6691 ok(!lstrcmpA(path, "kiwi"),
6692 "Expected path to be unchanged, got \"%s\"\n", path);
6693 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6695 /* try TARGETDIR */
6696 size = MAX_PATH;
6697 lstrcpyA(path, "kiwi");
6698 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6699 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6700 ok(!lstrcmpA(path, "kiwi"),
6701 "Expected path to be unchanged, got \"%s\"\n", path);
6702 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6704 /* try SourceDir */
6705 size = MAX_PATH;
6706 lstrcpyA(path, "kiwi");
6707 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6708 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6709 ok(!lstrcmpA(path, "kiwi"),
6710 "Expected path to be unchanged, got \"%s\"\n", path);
6711 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6713 /* try SOURCEDIR */
6714 size = MAX_PATH;
6715 lstrcpyA(path, "kiwi");
6716 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6717 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6718 ok(!lstrcmpA(path, "kiwi"),
6719 "Expected path to be unchanged, got \"%s\"\n", path);
6720 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6722 /* source path does not exist, but the property exists */
6723 size = MAX_PATH;
6724 lstrcpyA(path, "kiwi");
6725 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
6726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6727 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
6728 ok(size == 0, "Expected 0, got %d\n", size);
6730 /* try SubDir */
6731 size = MAX_PATH;
6732 lstrcpyA(path, "kiwi");
6733 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6734 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6735 ok(!lstrcmpA(path, "kiwi"),
6736 "Expected path to be unchanged, got \"%s\"\n", path);
6737 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6739 /* try SubDir2 */
6740 size = MAX_PATH;
6741 lstrcpyA(path, "kiwi");
6742 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6743 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6744 ok(!lstrcmpA(path, "kiwi"),
6745 "Expected path to be unchanged, got \"%s\"\n", path);
6746 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6748 r = MsiDoAction(hpkg, "CostInitialize");
6749 ok(r == ERROR_SUCCESS, "cost init failed\n");
6751 /* try TARGETDIR after CostInitialize */
6752 size = MAX_PATH;
6753 lstrcpyA(path, "kiwi");
6754 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6756 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6757 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6759 /* try SourceDir after CostInitialize */
6760 size = MAX_PATH;
6761 lstrcpyA(path, "kiwi");
6762 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6764 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6765 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6767 /* try SOURCEDIR after CostInitialize */
6768 size = MAX_PATH;
6769 lstrcpyA(path, "kiwi");
6770 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6771 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6772 ok(!lstrcmpA(path, "kiwi"),
6773 "Expected path to be unchanged, got \"%s\"\n", path);
6774 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6776 /* source path does not exist, but the property exists */
6777 size = MAX_PATH;
6778 lstrcpyA(path, "kiwi");
6779 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
6780 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6781 todo_wine
6783 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6784 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6787 /* try SubDir after CostInitialize */
6788 size = MAX_PATH;
6789 lstrcpyA(path, "kiwi");
6790 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6791 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6792 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
6793 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
6795 /* try SubDir2 after CostInitialize */
6796 size = MAX_PATH;
6797 lstrcpyA(path, "kiwi");
6798 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6800 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
6801 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
6803 r = MsiDoAction(hpkg, "ResolveSource");
6804 ok(r == ERROR_SUCCESS, "file cost failed\n");
6806 /* try TARGETDIR after ResolveSource */
6807 size = MAX_PATH;
6808 lstrcpyA(path, "kiwi");
6809 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6811 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6812 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6814 /* try SourceDir after ResolveSource */
6815 size = MAX_PATH;
6816 lstrcpyA(path, "kiwi");
6817 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6819 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6820 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6822 /* try SOURCEDIR after ResolveSource */
6823 size = MAX_PATH;
6824 lstrcpyA(path, "kiwi");
6825 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6826 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6827 ok(!lstrcmpA(path, "kiwi"),
6828 "Expected path to be unchanged, got \"%s\"\n", path);
6829 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6831 /* source path does not exist, but the property exists */
6832 size = MAX_PATH;
6833 lstrcpyA(path, "kiwi");
6834 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
6835 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6836 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6837 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6839 /* try SubDir after ResolveSource */
6840 size = MAX_PATH;
6841 lstrcpyA(path, "kiwi");
6842 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6844 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
6845 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
6847 /* try SubDir2 after ResolveSource */
6848 size = MAX_PATH;
6849 lstrcpyA(path, "kiwi");
6850 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6852 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
6853 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
6855 r = MsiDoAction(hpkg, "FileCost");
6856 ok(r == ERROR_SUCCESS, "file cost failed\n");
6858 /* try TARGETDIR after FileCost */
6859 size = MAX_PATH;
6860 lstrcpyA(path, "kiwi");
6861 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6862 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6863 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6864 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6866 /* try SourceDir after FileCost */
6867 size = MAX_PATH;
6868 lstrcpyA(path, "kiwi");
6869 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6871 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6872 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6874 /* try SOURCEDIR after FileCost */
6875 size = MAX_PATH;
6876 lstrcpyA(path, "kiwi");
6877 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6878 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6879 ok(!lstrcmpA(path, "kiwi"),
6880 "Expected path to be unchanged, got \"%s\"\n", path);
6881 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6883 /* try SubDir after FileCost */
6884 size = MAX_PATH;
6885 lstrcpyA(path, "kiwi");
6886 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6888 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
6889 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
6891 /* try SubDir2 after FileCost */
6892 size = MAX_PATH;
6893 lstrcpyA(path, "kiwi");
6894 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6895 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6896 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
6897 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
6899 r = MsiDoAction(hpkg, "CostFinalize");
6900 ok(r == ERROR_SUCCESS, "file cost failed\n");
6902 /* try TARGETDIR after CostFinalize */
6903 size = MAX_PATH;
6904 lstrcpyA(path, "kiwi");
6905 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6906 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6907 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6908 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6910 /* try SourceDir after CostFinalize */
6911 size = MAX_PATH;
6912 lstrcpyA(path, "kiwi");
6913 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6915 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6916 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6918 /* try SOURCEDIR after CostFinalize */
6919 size = MAX_PATH;
6920 lstrcpyA(path, "kiwi");
6921 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6922 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6923 ok(!lstrcmpA(path, "kiwi"),
6924 "Expected path to be unchanged, got \"%s\"\n", path);
6925 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6927 /* try SubDir after CostFinalize */
6928 size = MAX_PATH;
6929 lstrcpyA(path, "kiwi");
6930 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6931 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6932 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
6933 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
6935 /* try SubDir2 after CostFinalize */
6936 size = MAX_PATH;
6937 lstrcpyA(path, "kiwi");
6938 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6940 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
6941 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
6943 /* nonexistent directory */
6944 size = MAX_PATH;
6945 lstrcpyA(path, "kiwi");
6946 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
6947 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6948 ok(!lstrcmpA(path, "kiwi"),
6949 "Expected path to be unchanged, got \"%s\"\n", path);
6950 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6952 /* NULL szPathBuf */
6953 size = MAX_PATH;
6954 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
6955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6956 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6958 /* NULL pcchPathBuf */
6959 lstrcpyA(path, "kiwi");
6960 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
6961 ok(r == ERROR_INVALID_PARAMETER,
6962 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
6963 ok(!lstrcmpA(path, "kiwi"),
6964 "Expected path to be unchanged, got \"%s\"\n", path);
6966 /* pcchPathBuf is 0 */
6967 size = 0;
6968 lstrcpyA(path, "kiwi");
6969 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6970 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
6971 ok(!lstrcmpA(path, "kiwi"),
6972 "Expected path to be unchanged, got \"%s\"\n", path);
6973 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6975 /* pcchPathBuf does not have room for NULL terminator */
6976 size = lstrlenA(cwd);
6977 lstrcpyA(path, "kiwi");
6978 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6979 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
6980 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
6981 "Expected path with no backslash, got \"%s\"\n", path);
6982 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6984 /* pcchPathBuf has room for NULL terminator */
6985 size = lstrlenA(cwd) + 1;
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 MsiCloseHandle(hpkg);
6994 /* compressed source */
6996 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
6997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6999 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
7001 hpkg = package_from_db(hdb);
7002 ok(hpkg, "failed to create package\n");
7004 r = MsiDoAction(hpkg, "CostInitialize");
7005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7006 r = MsiDoAction(hpkg, "FileCost");
7007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7008 r = MsiDoAction(hpkg, "CostFinalize");
7009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7011 /* try TARGETDIR after CostFinalize */
7012 size = MAX_PATH;
7013 lstrcpyA(path, "kiwi");
7014 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
7015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7016 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7017 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7019 /* try SourceDir after CostFinalize */
7020 size = MAX_PATH;
7021 lstrcpyA(path, "kiwi");
7022 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7024 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7025 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7027 /* try SOURCEDIR after CostFinalize */
7028 size = MAX_PATH;
7029 lstrcpyA(path, "kiwi");
7030 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7031 todo_wine
7033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7034 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7035 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7038 /* try SubDir after CostFinalize */
7039 size = MAX_PATH;
7040 lstrcpyA(path, "kiwi");
7041 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7043 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7044 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7046 /* try SubDir2 after CostFinalize */
7047 size = MAX_PATH;
7048 lstrcpyA(path, "kiwi");
7049 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7051 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7052 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7054 MsiCloseHandle(hpkg);
7055 DeleteFile(msifile);
7058 static void test_shortlongsource(void)
7060 MSIHANDLE hdb, hpkg;
7061 CHAR path[MAX_PATH];
7062 CHAR cwd[MAX_PATH];
7063 CHAR subsrc[MAX_PATH];
7064 DWORD size;
7065 UINT r;
7067 lstrcpyA(cwd, CURR_DIR);
7068 lstrcatA(cwd, "\\");
7070 lstrcpyA(subsrc, cwd);
7071 lstrcatA(subsrc, "long");
7072 lstrcatA(subsrc, "\\");
7074 /* long file names */
7076 hdb = create_package_db();
7077 ok( hdb, "failed to create database\n");
7079 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
7081 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
7082 ok(r == S_OK, "failed\n");
7084 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
7085 ok(r == S_OK, "failed\n");
7087 /* CostInitialize:short */
7088 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
7089 ok(r == S_OK, "failed\n");
7091 /* CostInitialize:long */
7092 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
7093 ok(r == S_OK, "failed\n");
7095 /* FileCost:short */
7096 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
7097 ok(r == S_OK, "failed\n");
7099 /* FileCost:long */
7100 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
7101 ok(r == S_OK, "failed\n");
7103 /* CostFinalize:short */
7104 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
7105 ok(r == S_OK, "failed\n");
7107 /* CostFinalize:long */
7108 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
7109 ok(r == S_OK, "failed\n");
7111 MsiDatabaseCommit(hdb);
7113 hpkg = package_from_db(hdb);
7114 ok(hpkg, "failed to create package\n");
7116 MsiCloseHandle(hdb);
7118 CreateDirectoryA("one", NULL);
7119 CreateDirectoryA("four", NULL);
7121 r = MsiDoAction(hpkg, "CostInitialize");
7122 ok(r == ERROR_SUCCESS, "file cost failed\n");
7124 CreateDirectory("five", NULL);
7125 CreateDirectory("eight", NULL);
7127 r = MsiDoAction(hpkg, "FileCost");
7128 ok(r == ERROR_SUCCESS, "file cost failed\n");
7130 CreateDirectory("nine", NULL);
7131 CreateDirectory("twelve", NULL);
7133 r = MsiDoAction(hpkg, "CostFinalize");
7134 ok(r == ERROR_SUCCESS, "file cost failed\n");
7136 /* neither short nor long source directories exist */
7137 size = MAX_PATH;
7138 lstrcpyA(path, "kiwi");
7139 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7140 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7141 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7142 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7144 CreateDirectoryA("short", NULL);
7146 /* short source directory exists */
7147 size = MAX_PATH;
7148 lstrcpyA(path, "kiwi");
7149 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7151 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7152 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7154 CreateDirectoryA("long", NULL);
7156 /* both short and long source directories exist */
7157 size = MAX_PATH;
7158 lstrcpyA(path, "kiwi");
7159 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7160 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7161 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7162 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7164 lstrcpyA(subsrc, cwd);
7165 lstrcatA(subsrc, "two");
7166 lstrcatA(subsrc, "\\");
7168 /* short dir exists before CostInitialize */
7169 size = MAX_PATH;
7170 lstrcpyA(path, "kiwi");
7171 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7172 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7173 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7174 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7176 lstrcpyA(subsrc, cwd);
7177 lstrcatA(subsrc, "four");
7178 lstrcatA(subsrc, "\\");
7180 /* long dir exists before CostInitialize */
7181 size = MAX_PATH;
7182 lstrcpyA(path, "kiwi");
7183 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
7184 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7185 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7186 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7188 lstrcpyA(subsrc, cwd);
7189 lstrcatA(subsrc, "six");
7190 lstrcatA(subsrc, "\\");
7192 /* short dir exists before FileCost */
7193 size = MAX_PATH;
7194 lstrcpyA(path, "kiwi");
7195 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
7196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7197 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7198 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7200 lstrcpyA(subsrc, cwd);
7201 lstrcatA(subsrc, "eight");
7202 lstrcatA(subsrc, "\\");
7204 /* long dir exists before FileCost */
7205 size = MAX_PATH;
7206 lstrcpyA(path, "kiwi");
7207 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
7208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7209 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7210 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7212 lstrcpyA(subsrc, cwd);
7213 lstrcatA(subsrc, "ten");
7214 lstrcatA(subsrc, "\\");
7216 /* short dir exists before CostFinalize */
7217 size = MAX_PATH;
7218 lstrcpyA(path, "kiwi");
7219 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
7220 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7221 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7222 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7224 lstrcpyA(subsrc, cwd);
7225 lstrcatA(subsrc, "twelve");
7226 lstrcatA(subsrc, "\\");
7228 /* long dir exists before CostFinalize */
7229 size = MAX_PATH;
7230 lstrcpyA(path, "kiwi");
7231 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
7232 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7233 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7234 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7236 MsiCloseHandle(hpkg);
7237 RemoveDirectoryA("short");
7238 RemoveDirectoryA("long");
7239 RemoveDirectoryA("one");
7240 RemoveDirectoryA("four");
7241 RemoveDirectoryA("five");
7242 RemoveDirectoryA("eight");
7243 RemoveDirectoryA("nine");
7244 RemoveDirectoryA("twelve");
7246 /* short file names */
7248 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
7249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7251 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
7253 hpkg = package_from_db(hdb);
7254 ok(hpkg, "failed to create package\n");
7256 MsiCloseHandle(hdb);
7258 CreateDirectoryA("one", NULL);
7259 CreateDirectoryA("four", NULL);
7261 r = MsiDoAction(hpkg, "CostInitialize");
7262 ok(r == ERROR_SUCCESS, "file cost failed\n");
7264 CreateDirectory("five", NULL);
7265 CreateDirectory("eight", NULL);
7267 r = MsiDoAction(hpkg, "FileCost");
7268 ok(r == ERROR_SUCCESS, "file cost failed\n");
7270 CreateDirectory("nine", NULL);
7271 CreateDirectory("twelve", NULL);
7273 r = MsiDoAction(hpkg, "CostFinalize");
7274 ok(r == ERROR_SUCCESS, "file cost failed\n");
7276 lstrcpyA(subsrc, cwd);
7277 lstrcatA(subsrc, "short");
7278 lstrcatA(subsrc, "\\");
7280 /* neither short nor long source directories exist */
7281 size = MAX_PATH;
7282 lstrcpyA(path, "kiwi");
7283 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7284 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7285 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7286 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7288 CreateDirectoryA("short", NULL);
7290 /* short source directory exists */
7291 size = MAX_PATH;
7292 lstrcpyA(path, "kiwi");
7293 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7295 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7296 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7298 CreateDirectoryA("long", NULL);
7300 /* both short and long source directories exist */
7301 size = MAX_PATH;
7302 lstrcpyA(path, "kiwi");
7303 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7304 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7305 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7306 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7308 lstrcpyA(subsrc, cwd);
7309 lstrcatA(subsrc, "one");
7310 lstrcatA(subsrc, "\\");
7312 /* short dir exists before CostInitialize */
7313 size = MAX_PATH;
7314 lstrcpyA(path, "kiwi");
7315 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7317 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7318 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7320 lstrcpyA(subsrc, cwd);
7321 lstrcatA(subsrc, "three");
7322 lstrcatA(subsrc, "\\");
7324 /* long dir exists before CostInitialize */
7325 size = MAX_PATH;
7326 lstrcpyA(path, "kiwi");
7327 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
7328 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7329 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7330 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7332 lstrcpyA(subsrc, cwd);
7333 lstrcatA(subsrc, "five");
7334 lstrcatA(subsrc, "\\");
7336 /* short dir exists before FileCost */
7337 size = MAX_PATH;
7338 lstrcpyA(path, "kiwi");
7339 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
7340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7341 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7342 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7344 lstrcpyA(subsrc, cwd);
7345 lstrcatA(subsrc, "seven");
7346 lstrcatA(subsrc, "\\");
7348 /* long dir exists before FileCost */
7349 size = MAX_PATH;
7350 lstrcpyA(path, "kiwi");
7351 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
7352 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7353 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7354 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7356 lstrcpyA(subsrc, cwd);
7357 lstrcatA(subsrc, "nine");
7358 lstrcatA(subsrc, "\\");
7360 /* short dir exists before CostFinalize */
7361 size = MAX_PATH;
7362 lstrcpyA(path, "kiwi");
7363 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
7364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7365 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7366 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7368 lstrcpyA(subsrc, cwd);
7369 lstrcatA(subsrc, "eleven");
7370 lstrcatA(subsrc, "\\");
7372 /* long dir exists before CostFinalize */
7373 size = MAX_PATH;
7374 lstrcpyA(path, "kiwi");
7375 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
7376 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7377 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7378 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7380 MsiCloseHandle(hpkg);
7381 RemoveDirectoryA("short");
7382 RemoveDirectoryA("long");
7383 RemoveDirectoryA("one");
7384 RemoveDirectoryA("four");
7385 RemoveDirectoryA("five");
7386 RemoveDirectoryA("eight");
7387 RemoveDirectoryA("nine");
7388 RemoveDirectoryA("twelve");
7389 DeleteFileA(msifile);
7392 static void test_sourcedir(void)
7394 MSIHANDLE hdb, hpkg;
7395 CHAR package[10];
7396 CHAR path[MAX_PATH];
7397 CHAR cwd[MAX_PATH];
7398 CHAR subsrc[MAX_PATH];
7399 DWORD size;
7400 UINT r;
7402 lstrcpyA(cwd, CURR_DIR);
7403 lstrcatA(cwd, "\\");
7405 lstrcpyA(subsrc, cwd);
7406 lstrcatA(subsrc, "long");
7407 lstrcatA(subsrc, "\\");
7409 hdb = create_package_db();
7410 ok( hdb, "failed to create database\n");
7412 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
7413 ok(r == S_OK, "failed\n");
7415 sprintf(package, "#%li", hdb);
7416 r = MsiOpenPackage(package, &hpkg);
7417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7419 /* properties only */
7421 /* SourceDir prop */
7422 size = MAX_PATH;
7423 lstrcpyA(path, "kiwi");
7424 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7426 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7427 ok(size == 0, "Expected 0, got %d\n", size);
7429 /* SOURCEDIR prop */
7430 size = MAX_PATH;
7431 lstrcpyA(path, "kiwi");
7432 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7434 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7435 ok(size == 0, "Expected 0, got %d\n", size);
7437 r = MsiDoAction(hpkg, "CostInitialize");
7438 ok(r == ERROR_SUCCESS, "file cost failed\n");
7440 /* SourceDir after CostInitialize */
7441 size = MAX_PATH;
7442 lstrcpyA(path, "kiwi");
7443 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7445 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7446 ok(size == 0, "Expected 0, got %d\n", size);
7448 /* SOURCEDIR after CostInitialize */
7449 size = MAX_PATH;
7450 lstrcpyA(path, "kiwi");
7451 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7452 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7453 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7454 ok(size == 0, "Expected 0, got %d\n", size);
7456 r = MsiDoAction(hpkg, "FileCost");
7457 ok(r == ERROR_SUCCESS, "file cost failed\n");
7459 /* SourceDir after FileCost */
7460 size = MAX_PATH;
7461 lstrcpyA(path, "kiwi");
7462 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7464 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7465 ok(size == 0, "Expected 0, got %d\n", size);
7467 /* SOURCEDIR after FileCost */
7468 size = MAX_PATH;
7469 lstrcpyA(path, "kiwi");
7470 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7472 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7473 ok(size == 0, "Expected 0, got %d\n", size);
7475 r = MsiDoAction(hpkg, "CostFinalize");
7476 ok(r == ERROR_SUCCESS, "file cost failed\n");
7478 /* SourceDir after CostFinalize */
7479 size = MAX_PATH;
7480 lstrcpyA(path, "kiwi");
7481 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7483 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7484 ok(size == 0, "Expected 0, got %d\n", size);
7486 /* SOURCEDIR after CostFinalize */
7487 size = MAX_PATH;
7488 lstrcpyA(path, "kiwi");
7489 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7491 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7492 ok(size == 0, "Expected 0, got %d\n", size);
7494 r = MsiDoAction(hpkg, "ResolveSource");
7495 ok(r == ERROR_SUCCESS, "file cost failed\n");
7497 /* SourceDir after ResolveSource */
7498 size = MAX_PATH;
7499 lstrcpyA(path, "kiwi");
7500 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7502 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7503 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7505 /* SOURCEDIR after ResolveSource */
7506 size = MAX_PATH;
7507 lstrcpyA(path, "kiwi");
7508 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7510 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7511 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7513 /* random casing */
7514 size = MAX_PATH;
7515 lstrcpyA(path, "kiwi");
7516 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
7517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7518 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7519 ok(size == 0, "Expected 0, got %d\n", size);
7521 MsiCloseHandle(hpkg);
7523 /* reset the package state */
7524 sprintf(package, "#%li", hdb);
7525 r = MsiOpenPackage(package, &hpkg);
7526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7528 /* test how MsiGetSourcePath affects the properties */
7530 /* SourceDir prop */
7531 size = MAX_PATH;
7532 lstrcpyA(path, "kiwi");
7533 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7535 todo_wine
7537 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7538 ok(size == 0, "Expected 0, got %d\n", size);
7541 size = MAX_PATH;
7542 lstrcpyA(path, "kiwi");
7543 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7544 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7545 ok(!lstrcmpA(path, "kiwi"),
7546 "Expected path to be unchanged, got \"%s\"\n", path);
7547 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7549 /* SourceDir after MsiGetSourcePath */
7550 size = MAX_PATH;
7551 lstrcpyA(path, "kiwi");
7552 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7554 todo_wine
7556 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7557 ok(size == 0, "Expected 0, got %d\n", size);
7560 /* SOURCEDIR prop */
7561 size = MAX_PATH;
7562 lstrcpyA(path, "kiwi");
7563 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7565 todo_wine
7567 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7568 ok(size == 0, "Expected 0, got %d\n", size);
7571 size = MAX_PATH;
7572 lstrcpyA(path, "kiwi");
7573 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7574 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7575 ok(!lstrcmpA(path, "kiwi"),
7576 "Expected path to be unchanged, got \"%s\"\n", path);
7577 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7579 /* SOURCEDIR prop after MsiGetSourcePath */
7580 size = MAX_PATH;
7581 lstrcpyA(path, "kiwi");
7582 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7583 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7584 todo_wine
7586 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7587 ok(size == 0, "Expected 0, got %d\n", size);
7590 r = MsiDoAction(hpkg, "CostInitialize");
7591 ok(r == ERROR_SUCCESS, "file cost failed\n");
7593 /* SourceDir after CostInitialize */
7594 size = MAX_PATH;
7595 lstrcpyA(path, "kiwi");
7596 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7598 todo_wine
7600 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7601 ok(size == 0, "Expected 0, got %d\n", size);
7604 size = MAX_PATH;
7605 lstrcpyA(path, "kiwi");
7606 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7608 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7609 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7611 /* SourceDir after MsiGetSourcePath */
7612 size = MAX_PATH;
7613 lstrcpyA(path, "kiwi");
7614 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7616 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7617 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7619 /* SOURCEDIR after CostInitialize */
7620 size = MAX_PATH;
7621 lstrcpyA(path, "kiwi");
7622 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7623 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7624 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7625 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7627 /* SOURCEDIR source path still does not exist */
7628 size = MAX_PATH;
7629 lstrcpyA(path, "kiwi");
7630 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7631 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7632 ok(!lstrcmpA(path, "kiwi"),
7633 "Expected path to be unchanged, got \"%s\"\n", path);
7634 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7636 r = MsiDoAction(hpkg, "FileCost");
7637 ok(r == ERROR_SUCCESS, "file cost failed\n");
7639 /* SourceDir after FileCost */
7640 size = MAX_PATH;
7641 lstrcpyA(path, "kiwi");
7642 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7643 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7644 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7645 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7647 /* SOURCEDIR after FileCost */
7648 size = MAX_PATH;
7649 lstrcpyA(path, "kiwi");
7650 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7652 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7653 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7655 /* SOURCEDIR source path still does not exist */
7656 size = MAX_PATH;
7657 lstrcpyA(path, "kiwi");
7658 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7659 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7660 ok(!lstrcmpA(path, "kiwi"),
7661 "Expected path to be unchanged, got \"%s\"\n", path);
7662 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7664 r = MsiDoAction(hpkg, "CostFinalize");
7665 ok(r == ERROR_SUCCESS, "file cost failed\n");
7667 /* SourceDir after CostFinalize */
7668 size = MAX_PATH;
7669 lstrcpyA(path, "kiwi");
7670 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7671 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7672 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7673 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7675 /* SOURCEDIR after CostFinalize */
7676 size = MAX_PATH;
7677 lstrcpyA(path, "kiwi");
7678 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7680 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7681 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7683 /* SOURCEDIR source path still does not exist */
7684 size = MAX_PATH;
7685 lstrcpyA(path, "kiwi");
7686 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7687 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7688 ok(!lstrcmpA(path, "kiwi"),
7689 "Expected path to be unchanged, got \"%s\"\n", path);
7690 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7692 r = MsiDoAction(hpkg, "ResolveSource");
7693 ok(r == ERROR_SUCCESS, "file cost failed\n");
7695 /* SourceDir after ResolveSource */
7696 size = MAX_PATH;
7697 lstrcpyA(path, "kiwi");
7698 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7700 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7701 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7703 /* SOURCEDIR after ResolveSource */
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, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7709 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7711 /* SOURCEDIR source path still does not exist */
7712 size = MAX_PATH;
7713 lstrcpyA(path, "kiwi");
7714 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7715 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7716 ok(!lstrcmpA(path, "kiwi"),
7717 "Expected path to be unchanged, got \"%s\"\n", path);
7718 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7720 MsiCloseHandle(hdb);
7721 MsiCloseHandle(hpkg);
7722 DeleteFileA(msifile);
7725 struct access_res
7727 BOOL gothandle;
7728 DWORD lasterr;
7731 static const struct access_res create[16] =
7733 { TRUE, ERROR_SUCCESS },
7734 { TRUE, ERROR_SUCCESS },
7735 { TRUE, ERROR_SUCCESS },
7736 { TRUE, ERROR_SUCCESS },
7737 { FALSE, ERROR_SHARING_VIOLATION },
7738 { FALSE, ERROR_SHARING_VIOLATION },
7739 { FALSE, ERROR_SHARING_VIOLATION },
7740 { TRUE, ERROR_SUCCESS },
7741 { FALSE, ERROR_SHARING_VIOLATION },
7742 { FALSE, ERROR_SHARING_VIOLATION },
7743 { FALSE, ERROR_SHARING_VIOLATION },
7744 { TRUE, ERROR_SUCCESS },
7745 { FALSE, ERROR_SHARING_VIOLATION },
7746 { FALSE, ERROR_SHARING_VIOLATION },
7747 { FALSE, ERROR_SHARING_VIOLATION },
7748 { TRUE, ERROR_SUCCESS }
7751 static const struct access_res create_commit[16] =
7753 { TRUE, ERROR_SUCCESS },
7754 { TRUE, ERROR_SUCCESS },
7755 { TRUE, ERROR_SUCCESS },
7756 { TRUE, ERROR_SUCCESS },
7757 { FALSE, ERROR_SHARING_VIOLATION },
7758 { FALSE, ERROR_SHARING_VIOLATION },
7759 { FALSE, ERROR_SHARING_VIOLATION },
7760 { TRUE, ERROR_SUCCESS },
7761 { FALSE, ERROR_SHARING_VIOLATION },
7762 { FALSE, ERROR_SHARING_VIOLATION },
7763 { FALSE, ERROR_SHARING_VIOLATION },
7764 { TRUE, ERROR_SUCCESS },
7765 { FALSE, ERROR_SHARING_VIOLATION },
7766 { FALSE, ERROR_SHARING_VIOLATION },
7767 { FALSE, ERROR_SHARING_VIOLATION },
7768 { TRUE, ERROR_SUCCESS }
7771 static const struct access_res create_close[16] =
7773 { TRUE, ERROR_SUCCESS },
7774 { TRUE, ERROR_SUCCESS },
7775 { TRUE, ERROR_SUCCESS },
7776 { TRUE, ERROR_SUCCESS },
7777 { TRUE, ERROR_SUCCESS },
7778 { TRUE, ERROR_SUCCESS },
7779 { TRUE, ERROR_SUCCESS },
7780 { TRUE, ERROR_SUCCESS },
7781 { TRUE, ERROR_SUCCESS },
7782 { TRUE, ERROR_SUCCESS },
7783 { TRUE, ERROR_SUCCESS },
7784 { TRUE, ERROR_SUCCESS },
7785 { TRUE, ERROR_SUCCESS },
7786 { TRUE, ERROR_SUCCESS },
7787 { TRUE, ERROR_SUCCESS },
7788 { TRUE, ERROR_SUCCESS }
7791 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
7793 DWORD access = 0, share = 0;
7794 DWORD lasterr;
7795 HANDLE hfile;
7796 int i, j, idx = 0;
7798 for (i = 0; i < 4; i++)
7800 if (i == 0) access = 0;
7801 if (i == 1) access = GENERIC_READ;
7802 if (i == 2) access = GENERIC_WRITE;
7803 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
7805 for (j = 0; j < 4; j++)
7807 if (j == 0) share = 0;
7808 if (j == 1) share = FILE_SHARE_READ;
7809 if (j == 2) share = FILE_SHARE_WRITE;
7810 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
7812 SetLastError(0xdeadbeef);
7813 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
7814 FILE_ATTRIBUTE_NORMAL, 0);
7815 lasterr = GetLastError();
7817 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
7818 "(%d, handle, %d): Expected %d, got %d\n",
7819 line, idx, ares[idx].gothandle,
7820 (hfile != INVALID_HANDLE_VALUE));
7822 ok(lasterr == ares[idx].lasterr,
7823 "(%d, lasterr, %d): Expected %d, got %d\n",
7824 line, idx, ares[idx].lasterr, lasterr);
7826 CloseHandle(hfile);
7827 idx++;
7832 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
7834 static void test_access(void)
7836 MSIHANDLE hdb;
7837 UINT r;
7839 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
7840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7842 test_file_access(msifile, create);
7844 r = MsiDatabaseCommit(hdb);
7845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7847 test_file_access(msifile, create_commit);
7849 MsiCloseHandle(hdb);
7851 test_file_access(msifile, create_close);
7853 DeleteFileA(msifile);
7855 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
7856 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7858 test_file_access(msifile, create);
7860 r = MsiDatabaseCommit(hdb);
7861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7863 test_file_access(msifile, create_commit);
7865 MsiCloseHandle(hdb);
7867 test_file_access(msifile, create_close);
7869 DeleteFileA(msifile);
7872 START_TEST(package)
7874 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
7876 test_createpackage();
7877 test_doaction();
7878 test_gettargetpath_bad();
7879 test_settargetpath();
7880 test_props();
7881 test_property_table();
7882 test_condition();
7883 test_msipackage();
7884 test_formatrecord2();
7885 test_states();
7886 test_getproperty();
7887 test_removefiles();
7888 test_appsearch();
7889 test_featureparents();
7890 test_installprops();
7891 test_launchconditions();
7892 test_ccpsearch();
7893 test_complocator();
7894 test_MsiGetSourcePath();
7895 test_shortlongsource();
7896 test_sourcedir();
7897 test_access();