push 514b285b0c98f6a7a84c63e51c3091a87ae6d177
[wine/hacks.git] / dlls / msi / tests / package.c
blobc68d429bf270a3b3c979dd76a6e04c6ca8d2b981
1 /*
2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define COBJMACROS
24 #include <stdio.h>
25 #include <windows.h>
26 #include <msidefs.h>
27 #include <msi.h>
28 #include <msiquery.h>
30 #include "wine/test.h"
32 static const char msifile[] = "winetest.msi";
33 char CURR_DIR[MAX_PATH];
35 /* RegDeleteTreeW from dlls/advapi32/registry.c */
36 LSTATUS WINAPI package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
38 LONG ret;
39 DWORD dwMaxSubkeyLen, dwMaxValueLen;
40 DWORD dwMaxLen, dwSize;
41 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
42 HKEY hSubKey = hKey;
44 if(lpszSubKey)
46 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
47 if (ret) return ret;
50 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
51 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
52 if (ret) goto cleanup;
54 dwMaxSubkeyLen++;
55 dwMaxValueLen++;
56 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
57 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
59 /* Name too big: alloc a buffer for it */
60 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
62 ret = ERROR_NOT_ENOUGH_MEMORY;
63 goto cleanup;
67 /* Recursively delete all the subkeys */
68 while (TRUE)
70 dwSize = dwMaxLen;
71 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
72 NULL, NULL, NULL)) break;
74 ret = package_RegDeleteTreeW(hSubKey, lpszName);
75 if (ret) goto cleanup;
78 if (lpszSubKey)
79 ret = RegDeleteKeyW(hKey, lpszSubKey);
80 else
81 while (TRUE)
83 dwSize = dwMaxLen;
84 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
85 NULL, NULL, NULL, NULL)) break;
87 ret = RegDeleteValueW(hKey, lpszName);
88 if (ret) goto cleanup;
91 cleanup:
92 if (lpszName != szNameBuf)
93 HeapFree(GetProcessHeap(), 0, lpszName);
94 if(lpszSubKey)
95 RegCloseKey(hSubKey);
96 return ret;
99 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
101 MSIHANDLE hview = 0;
102 UINT r, ret;
104 /* open a select query */
105 r = MsiDatabaseOpenView(hdb, query, &hview);
106 if (r != ERROR_SUCCESS)
107 return r;
108 r = MsiViewExecute(hview, 0);
109 if (r != ERROR_SUCCESS)
110 return r;
111 ret = MsiViewFetch(hview, phrec);
112 r = MsiViewClose(hview);
113 if (r != ERROR_SUCCESS)
114 return r;
115 r = MsiCloseHandle(hview);
116 if (r != ERROR_SUCCESS)
117 return r;
118 return ret;
121 static UINT run_query( MSIHANDLE hdb, const char *query )
123 MSIHANDLE hview = 0;
124 UINT r;
126 r = MsiDatabaseOpenView(hdb, query, &hview);
127 if( r != ERROR_SUCCESS )
128 return r;
130 r = MsiViewExecute(hview, 0);
131 if( r == ERROR_SUCCESS )
132 r = MsiViewClose(hview);
133 MsiCloseHandle(hview);
134 return r;
137 static UINT create_component_table( MSIHANDLE hdb )
139 return run_query( hdb,
140 "CREATE TABLE `Component` ( "
141 "`Component` CHAR(72) NOT NULL, "
142 "`ComponentId` CHAR(38), "
143 "`Directory_` CHAR(72) NOT NULL, "
144 "`Attributes` SHORT NOT NULL, "
145 "`Condition` CHAR(255), "
146 "`KeyPath` CHAR(72) "
147 "PRIMARY KEY `Component`)" );
150 static UINT create_feature_table( MSIHANDLE hdb )
152 return run_query( hdb,
153 "CREATE TABLE `Feature` ( "
154 "`Feature` CHAR(38) NOT NULL, "
155 "`Feature_Parent` CHAR(38), "
156 "`Title` CHAR(64), "
157 "`Description` CHAR(255), "
158 "`Display` SHORT NOT NULL, "
159 "`Level` SHORT NOT NULL, "
160 "`Directory_` CHAR(72), "
161 "`Attributes` SHORT NOT NULL "
162 "PRIMARY KEY `Feature`)" );
165 static UINT create_feature_components_table( MSIHANDLE hdb )
167 return run_query( hdb,
168 "CREATE TABLE `FeatureComponents` ( "
169 "`Feature_` CHAR(38) NOT NULL, "
170 "`Component_` CHAR(72) NOT NULL "
171 "PRIMARY KEY `Feature_`, `Component_` )" );
174 static UINT create_file_table( MSIHANDLE hdb )
176 return run_query( hdb,
177 "CREATE TABLE `File` ("
178 "`File` CHAR(72) NOT NULL, "
179 "`Component_` CHAR(72) NOT NULL, "
180 "`FileName` CHAR(255) NOT NULL, "
181 "`FileSize` LONG NOT NULL, "
182 "`Version` CHAR(72), "
183 "`Language` CHAR(20), "
184 "`Attributes` SHORT, "
185 "`Sequence` SHORT NOT NULL "
186 "PRIMARY KEY `File`)" );
189 static UINT create_remove_file_table( MSIHANDLE hdb )
191 return run_query( hdb,
192 "CREATE TABLE `RemoveFile` ("
193 "`FileKey` CHAR(72) NOT NULL, "
194 "`Component_` CHAR(72) NOT NULL, "
195 "`FileName` CHAR(255) LOCALIZABLE, "
196 "`DirProperty` CHAR(72) NOT NULL, "
197 "`InstallMode` SHORT NOT NULL "
198 "PRIMARY KEY `FileKey`)" );
201 static UINT create_appsearch_table( MSIHANDLE hdb )
203 return run_query( hdb,
204 "CREATE TABLE `AppSearch` ("
205 "`Property` CHAR(72) NOT NULL, "
206 "`Signature_` CHAR(72) NOT NULL "
207 "PRIMARY KEY `Property`, `Signature_`)" );
210 static UINT create_reglocator_table( MSIHANDLE hdb )
212 return run_query( hdb,
213 "CREATE TABLE `RegLocator` ("
214 "`Signature_` CHAR(72) NOT NULL, "
215 "`Root` SHORT NOT NULL, "
216 "`Key` CHAR(255) NOT NULL, "
217 "`Name` CHAR(255), "
218 "`Type` SHORT "
219 "PRIMARY KEY `Signature_`)" );
222 static UINT create_signature_table( MSIHANDLE hdb )
224 return run_query( hdb,
225 "CREATE TABLE `Signature` ("
226 "`Signature` CHAR(72) NOT NULL, "
227 "`FileName` CHAR(255) NOT NULL, "
228 "`MinVersion` CHAR(20), "
229 "`MaxVersion` CHAR(20), "
230 "`MinSize` LONG, "
231 "`MaxSize` LONG, "
232 "`MinDate` LONG, "
233 "`MaxDate` LONG, "
234 "`Languages` CHAR(255) "
235 "PRIMARY KEY `Signature`)" );
238 static UINT create_launchcondition_table( MSIHANDLE hdb )
240 return run_query( hdb,
241 "CREATE TABLE `LaunchCondition` ("
242 "`Condition` CHAR(255) NOT NULL, "
243 "`Description` CHAR(255) NOT NULL "
244 "PRIMARY KEY `Condition`)" );
247 static UINT create_property_table( MSIHANDLE hdb )
249 return run_query( hdb,
250 "CREATE TABLE `Property` ("
251 "`Property` CHAR(72) NOT NULL, "
252 "`Value` CHAR(0) "
253 "PRIMARY KEY `Property`)" );
256 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
258 return run_query( hdb,
259 "CREATE TABLE `InstallExecuteSequence` ("
260 "`Action` CHAR(72) NOT NULL, "
261 "`Condition` CHAR(255), "
262 "`Sequence` SHORT "
263 "PRIMARY KEY `Action`)" );
266 static UINT create_media_table( MSIHANDLE hdb )
268 return run_query( hdb,
269 "CREATE TABLE `Media` ("
270 "`DiskId` SHORT NOT NULL, "
271 "`LastSequence` SHORT NOT NULL, "
272 "`DiskPrompt` CHAR(64), "
273 "`Cabinet` CHAR(255), "
274 "`VolumeLabel` CHAR(32), "
275 "`Source` CHAR(72) "
276 "PRIMARY KEY `DiskId`)" );
279 static UINT create_ccpsearch_table( MSIHANDLE hdb )
281 return run_query( hdb,
282 "CREATE TABLE `CCPSearch` ("
283 "`Signature_` CHAR(72) NOT NULL "
284 "PRIMARY KEY `Signature_`)" );
287 static UINT create_drlocator_table( MSIHANDLE hdb )
289 return run_query( hdb,
290 "CREATE TABLE `DrLocator` ("
291 "`Signature_` CHAR(72) NOT NULL, "
292 "`Parent` CHAR(72), "
293 "`Path` CHAR(255), "
294 "`Depth` SHORT "
295 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
298 static UINT create_complocator_table( MSIHANDLE hdb )
300 return run_query( hdb,
301 "CREATE TABLE `CompLocator` ("
302 "`Signature_` CHAR(72) NOT NULL, "
303 "`ComponentId` CHAR(38) NOT NULL, "
304 "`Type` SHORT "
305 "PRIMARY KEY `Signature_`)" );
308 static UINT add_component_entry( MSIHANDLE hdb, const char *values )
310 char insert[] = "INSERT INTO `Component` "
311 "(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
312 "VALUES( %s )";
313 char *query;
314 UINT sz, r;
316 sz = strlen(values) + sizeof insert;
317 query = HeapAlloc(GetProcessHeap(),0,sz);
318 sprintf(query,insert,values);
319 r = run_query( hdb, query );
320 HeapFree(GetProcessHeap(), 0, query);
321 return r;
324 static UINT add_directory_entry( MSIHANDLE hdb, const char *values )
326 char insert[] = "INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )";
327 char *query;
328 UINT sz, r;
330 sz = strlen(values) + sizeof insert;
331 query = HeapAlloc(GetProcessHeap(),0,sz);
332 sprintf(query,insert,values);
333 r = run_query( hdb, query );
334 HeapFree(GetProcessHeap(), 0, query);
335 return r;
338 static UINT add_feature_entry( MSIHANDLE hdb, const char *values )
340 char insert[] = "INSERT INTO `Feature` (`Feature`, `Feature_Parent`, "
341 "`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )";
342 char *query;
343 UINT sz, r;
345 sz = strlen(values) + sizeof insert;
346 query = HeapAlloc(GetProcessHeap(),0,sz);
347 sprintf(query,insert,values);
348 r = run_query( hdb, query );
349 HeapFree(GetProcessHeap(), 0, query);
350 return r;
353 static UINT add_feature_components_entry( MSIHANDLE hdb, const char *values )
355 char insert[] = "INSERT INTO `FeatureComponents` "
356 "(`Feature_`, `Component_`) "
357 "VALUES( %s )";
358 char *query;
359 UINT sz, r;
361 sz = strlen(values) + sizeof insert;
362 query = HeapAlloc(GetProcessHeap(),0,sz);
363 sprintf(query,insert,values);
364 r = run_query( hdb, query );
365 HeapFree(GetProcessHeap(), 0, query);
366 return r;
369 static UINT add_file_entry( MSIHANDLE hdb, const char *values )
371 char insert[] = "INSERT INTO `File` "
372 "(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) "
373 "VALUES( %s )";
374 char *query;
375 UINT sz, r;
377 sz = strlen(values) + sizeof insert;
378 query = HeapAlloc(GetProcessHeap(),0,sz);
379 sprintf(query,insert,values);
380 r = run_query( hdb, query );
381 HeapFree(GetProcessHeap(), 0, query);
382 return r;
385 static UINT add_appsearch_entry( MSIHANDLE hdb, const char *values )
387 char insert[] = "INSERT INTO `AppSearch` "
388 "(`Property`, `Signature_`) "
389 "VALUES( %s )";
390 char *query;
391 UINT sz, r;
393 sz = strlen(values) + sizeof insert;
394 query = HeapAlloc(GetProcessHeap(),0,sz);
395 sprintf(query,insert,values);
396 r = run_query( hdb, query );
397 HeapFree(GetProcessHeap(), 0, query);
398 return r;
401 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *values )
403 char insert[] = "INSERT INTO `RegLocator` "
404 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) "
405 "VALUES( %s )";
406 char *query;
407 UINT sz, r;
409 sz = strlen(values) + sizeof insert;
410 query = HeapAlloc(GetProcessHeap(),0,sz);
411 sprintf(query,insert,values);
412 r = run_query( hdb, query );
413 HeapFree(GetProcessHeap(), 0, query);
414 return r;
417 static UINT add_signature_entry( MSIHANDLE hdb, const char *values )
419 char insert[] = "INSERT INTO `Signature` "
420 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
421 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
422 "VALUES( %s )";
423 char *query;
424 UINT sz, r;
426 sz = strlen(values) + sizeof insert;
427 query = HeapAlloc(GetProcessHeap(),0,sz);
428 sprintf(query,insert,values);
429 r = run_query( hdb, query );
430 HeapFree(GetProcessHeap(), 0, query);
431 return r;
434 static UINT add_launchcondition_entry( MSIHANDLE hdb, const char *values )
436 char insert[] = "INSERT INTO `LaunchCondition` "
437 "(`Condition`, `Description`) "
438 "VALUES( %s )";
439 char *query;
440 UINT sz, r;
442 sz = strlen(values) + sizeof insert;
443 query = HeapAlloc(GetProcessHeap(),0,sz);
444 sprintf(query,insert,values);
445 r = run_query( hdb, query );
446 HeapFree(GetProcessHeap(), 0, query);
447 return r;
450 static UINT add_property_entry( MSIHANDLE hdb, const char *values )
452 char insert[] = "INSERT INTO `Property` "
453 "(`Property`, `Value`) "
454 "VALUES( %s )";
455 char *query;
456 UINT sz, r;
458 sz = strlen(values) + sizeof insert;
459 query = HeapAlloc(GetProcessHeap(),0,sz);
460 sprintf(query,insert,values);
461 r = run_query( hdb, query );
462 HeapFree(GetProcessHeap(), 0, query);
463 return r;
466 static UINT add_install_execute_sequence_entry( MSIHANDLE hdb, const char *values )
468 char insert[] = "INSERT INTO `InstallExecuteSequence` "
469 "(`Action`, `Condition`, `Sequence`) "
470 "VALUES( %s )";
471 char *query;
472 UINT sz, r;
474 sz = strlen(values) + sizeof insert;
475 query = HeapAlloc(GetProcessHeap(),0,sz);
476 sprintf(query,insert,values);
477 r = run_query( hdb, query );
478 HeapFree(GetProcessHeap(), 0, query);
479 return r;
482 static UINT add_media_entry( MSIHANDLE hdb, const char *values )
484 char insert[] = "INSERT INTO `Media` "
485 "(`DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source`) "
486 "VALUES( %s )";
487 char *query;
488 UINT sz, r;
490 sz = strlen(values) + sizeof insert;
491 query = HeapAlloc(GetProcessHeap(),0,sz);
492 sprintf(query,insert,values);
493 r = run_query( hdb, query );
494 HeapFree(GetProcessHeap(), 0, query);
495 return r;
498 static UINT add_ccpsearch_entry( MSIHANDLE hdb, const char *values )
500 char insert[] = "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )";
501 char *query;
502 UINT sz, r;
504 sz = strlen(values) + sizeof insert;
505 query = HeapAlloc(GetProcessHeap(),0,sz);
506 sprintf(query,insert,values);
507 r = run_query( hdb, query );
508 HeapFree(GetProcessHeap(), 0, query);
509 return r;
512 static UINT add_drlocator_entry( MSIHANDLE hdb, const char *values )
514 char insert[] = "INSERT INTO `DrLocator` "
515 "(`Signature_`, `Parent`, `Path`, `Depth`) "
516 "VALUES( %s )";
517 char *query;
518 UINT sz, r;
520 sz = strlen(values) + sizeof insert;
521 query = HeapAlloc(GetProcessHeap(),0,sz);
522 sprintf(query,insert,values);
523 r = run_query( hdb, query );
524 HeapFree(GetProcessHeap(), 0, query);
525 return r;
528 static UINT add_complocator_entry( MSIHANDLE hdb, const char *values )
530 char insert[] = "INSERT INTO `CompLocator` "
531 "(`Signature_`, `ComponentId`, `Type`) "
532 "VALUES( %s )";
533 char *query;
534 UINT sz, r;
536 sz = strlen(values) + sizeof insert;
537 query = HeapAlloc(GetProcessHeap(),0,sz);
538 sprintf(query,insert,values);
539 r = run_query( hdb, query );
540 HeapFree(GetProcessHeap(), 0, query);
541 return r;
544 static UINT set_summary_info(MSIHANDLE hdb)
546 UINT res;
547 MSIHANDLE suminfo;
549 /* build summary info */
550 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
551 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
553 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
554 "Installation Database");
555 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
557 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
558 "Installation Database");
559 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
561 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
562 "Wine Hackers");
563 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
565 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
566 ";1033");
567 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
569 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
570 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
571 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
573 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
574 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
576 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
577 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
579 res = MsiSummaryInfoPersist(suminfo);
580 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
582 res = MsiCloseHandle( suminfo);
583 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
585 return res;
589 static MSIHANDLE create_package_db(void)
591 MSIHANDLE hdb = 0;
592 UINT res;
594 DeleteFile(msifile);
596 /* create an empty database */
597 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
598 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
599 if( res != ERROR_SUCCESS )
600 return hdb;
602 res = MsiDatabaseCommit( hdb );
603 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
605 res = set_summary_info(hdb);
607 res = run_query( hdb,
608 "CREATE TABLE `Directory` ( "
609 "`Directory` CHAR(255) NOT NULL, "
610 "`Directory_Parent` CHAR(255), "
611 "`DefaultDir` CHAR(255) NOT NULL "
612 "PRIMARY KEY `Directory`)" );
613 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
615 return hdb;
618 static MSIHANDLE package_from_db(MSIHANDLE hdb)
620 UINT res;
621 CHAR szPackage[10];
622 MSIHANDLE hPackage;
624 sprintf(szPackage,"#%li",hdb);
625 res = MsiOpenPackage(szPackage,&hPackage);
626 if (res != ERROR_SUCCESS)
627 return 0;
629 res = MsiCloseHandle(hdb);
630 if (res != ERROR_SUCCESS)
631 return 0;
633 return hPackage;
636 static void create_test_file(const CHAR *name)
638 HANDLE file;
639 DWORD written;
641 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
642 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
643 WriteFile(file, name, strlen(name), &written, NULL);
644 WriteFile(file, "\n", strlen("\n"), &written, NULL);
645 CloseHandle(file);
648 static void test_createpackage(void)
650 MSIHANDLE hPackage = 0;
651 UINT res;
653 hPackage = package_from_db(create_package_db());
654 ok( hPackage != 0, " Failed to create package\n");
656 res = MsiCloseHandle( hPackage);
657 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
658 DeleteFile(msifile);
661 static void test_doaction( void )
663 MSIHANDLE hpkg;
664 UINT r;
666 r = MsiDoAction( -1, NULL );
667 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
669 hpkg = package_from_db(create_package_db());
670 ok( hpkg, "failed to create package\n");
672 r = MsiDoAction(hpkg, NULL);
673 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
675 r = MsiDoAction(0, "boo");
676 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
678 r = MsiDoAction(hpkg, "boo");
679 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
681 MsiCloseHandle( hpkg );
682 DeleteFile(msifile);
685 static void test_gettargetpath_bad(void)
687 char buffer[0x80];
688 MSIHANDLE hpkg;
689 DWORD sz;
690 UINT r;
692 hpkg = package_from_db(create_package_db());
693 ok( hpkg, "failed to create package\n");
695 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
696 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
698 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
699 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
701 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
702 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
704 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
705 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
707 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
708 ok( r == ERROR_DIRECTORY, "wrong return val\n");
710 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
711 ok( r == ERROR_DIRECTORY, "wrong return val\n");
713 MsiCloseHandle( hpkg );
714 DeleteFile(msifile);
717 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
719 UINT r;
720 DWORD size;
721 MSIHANDLE rec;
723 rec = MsiCreateRecord( 1 );
724 ok(rec, "MsiCreate record failed\n");
726 r = MsiRecordSetString( rec, 0, file );
727 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
729 size = MAX_PATH;
730 r = MsiFormatRecord( hpkg, rec, buff, &size );
731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
733 MsiCloseHandle( rec );
736 static void test_settargetpath(void)
738 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
739 DWORD sz;
740 MSIHANDLE hpkg;
741 UINT r;
742 MSIHANDLE hdb;
744 hdb = create_package_db();
745 ok ( hdb, "failed to create package database\n" );
747 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
748 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
750 r = create_component_table( hdb );
751 ok( r == S_OK, "cannot create Component table: %d\n", r );
753 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
754 ok( r == S_OK, "cannot add dummy component: %d\n", r );
756 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
757 ok( r == S_OK, "cannot add test component: %d\n", r );
759 r = create_feature_table( hdb );
760 ok( r == S_OK, "cannot create Feature table: %d\n", r );
762 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
763 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
765 r = create_feature_components_table( hdb );
766 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
768 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
769 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
771 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
772 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
774 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
775 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
777 r = create_file_table( hdb );
778 ok( r == S_OK, "cannot create File table: %d\n", r );
780 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
781 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
783 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
784 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
786 hpkg = package_from_db( hdb );
787 ok( hpkg, "failed to create package\n");
789 r = MsiDoAction( hpkg, "CostInitialize");
790 ok( r == ERROR_SUCCESS, "cost init failed\n");
792 r = MsiDoAction( hpkg, "FileCost");
793 ok( r == ERROR_SUCCESS, "file cost failed\n");
795 r = MsiDoAction( hpkg, "CostFinalize");
796 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
798 r = MsiSetTargetPath( 0, NULL, NULL );
799 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
801 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
802 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
804 r = MsiSetTargetPath( hpkg, "boo", NULL );
805 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
807 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
808 ok( r == ERROR_DIRECTORY, "wrong return val\n");
810 sz = sizeof tempdir - 1;
811 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
812 sprintf( file, "%srootfile.txt", tempdir );
813 query_file_path( hpkg, "[#RootFile]", buffer );
814 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
815 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
817 GetTempFileName( tempdir, "_wt", 0, buffer );
818 sprintf( tempdir, "%s\\subdir", buffer );
820 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
821 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
822 "MsiSetTargetPath on file returned %d\n", r );
824 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
825 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
826 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
828 DeleteFile( buffer );
830 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
831 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
833 r = GetFileAttributes( buffer );
834 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
836 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
837 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
839 sz = sizeof buffer - 1;
840 lstrcat( tempdir, "\\" );
841 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
842 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
843 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
845 sprintf( file, "%srootfile.txt", tempdir );
846 query_file_path( hpkg, "[#RootFile]", buffer );
847 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
849 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
850 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
852 query_file_path( hpkg, "[#TestFile]", buffer );
853 ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
854 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
856 sz = sizeof buffer - 1;
857 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
858 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
859 ok( !lstrcmp(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
861 MsiCloseHandle( hpkg );
864 static void test_condition(void)
866 MSICONDITION r;
867 MSIHANDLE hpkg;
869 hpkg = package_from_db(create_package_db());
870 ok( hpkg, "failed to create package\n");
872 r = MsiEvaluateCondition(0, NULL);
873 ok( r == MSICONDITION_ERROR, "wrong return val\n");
875 r = MsiEvaluateCondition(hpkg, NULL);
876 ok( r == MSICONDITION_NONE, "wrong return val\n");
878 r = MsiEvaluateCondition(hpkg, "");
879 ok( r == MSICONDITION_NONE, "wrong return val\n");
881 r = MsiEvaluateCondition(hpkg, "1");
882 ok( r == MSICONDITION_TRUE, "wrong return val\n");
884 r = MsiEvaluateCondition(hpkg, "0");
885 ok( r == MSICONDITION_FALSE, "wrong return val\n");
887 r = MsiEvaluateCondition(hpkg, "-1");
888 ok( r == MSICONDITION_TRUE, "wrong return val\n");
890 r = MsiEvaluateCondition(hpkg, "0 = 0");
891 ok( r == MSICONDITION_TRUE, "wrong return val\n");
893 r = MsiEvaluateCondition(hpkg, "0 <> 0");
894 ok( r == MSICONDITION_FALSE, "wrong return val\n");
896 r = MsiEvaluateCondition(hpkg, "0 = 1");
897 ok( r == MSICONDITION_FALSE, "wrong return val\n");
899 r = MsiEvaluateCondition(hpkg, "0 > 1");
900 ok( r == MSICONDITION_FALSE, "wrong return val\n");
902 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
903 ok( r == MSICONDITION_FALSE, "wrong return val\n");
905 r = MsiEvaluateCondition(hpkg, "1 > 1");
906 ok( r == MSICONDITION_FALSE, "wrong return val\n");
908 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
909 ok( r == MSICONDITION_FALSE, "wrong return val\n");
911 r = MsiEvaluateCondition(hpkg, "0 >= 1");
912 ok( r == MSICONDITION_FALSE, "wrong return val\n");
914 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
915 ok( r == MSICONDITION_FALSE, "wrong return val\n");
917 r = MsiEvaluateCondition(hpkg, "1 >= 1");
918 ok( r == MSICONDITION_TRUE, "wrong return val\n");
920 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
921 ok( r == MSICONDITION_TRUE, "wrong return val\n");
923 r = MsiEvaluateCondition(hpkg, "0 < 1");
924 ok( r == MSICONDITION_TRUE, "wrong return val\n");
926 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
927 ok( r == MSICONDITION_TRUE, "wrong return val\n");
929 r = MsiEvaluateCondition(hpkg, "1 < 1");
930 ok( r == MSICONDITION_FALSE, "wrong return val\n");
932 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
933 ok( r == MSICONDITION_FALSE, "wrong return val\n");
935 r = MsiEvaluateCondition(hpkg, "0 <= 1");
936 ok( r == MSICONDITION_TRUE, "wrong return val\n");
938 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
939 ok( r == MSICONDITION_TRUE, "wrong return val\n");
941 r = MsiEvaluateCondition(hpkg, "1 <= 1");
942 ok( r == MSICONDITION_TRUE, "wrong return val\n");
944 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
945 ok( r == MSICONDITION_TRUE, "wrong return val\n");
947 r = MsiEvaluateCondition(hpkg, "0 >=");
948 ok( r == MSICONDITION_ERROR, "wrong return val\n");
950 r = MsiEvaluateCondition(hpkg, " ");
951 ok( r == MSICONDITION_NONE, "wrong return val\n");
953 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
954 ok( r == MSICONDITION_TRUE, "wrong return val\n");
956 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
957 ok( r == MSICONDITION_TRUE, "wrong return val\n");
959 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
960 ok( r == MSICONDITION_FALSE, "wrong return val\n");
962 r = MsiEvaluateCondition(hpkg, "not 0");
963 ok( r == MSICONDITION_TRUE, "wrong return val\n");
965 r = MsiEvaluateCondition(hpkg, "not LicView");
966 ok( r == MSICONDITION_TRUE, "wrong return val\n");
968 r = MsiEvaluateCondition(hpkg, "not \"A\"");
969 ok( r == MSICONDITION_FALSE, "wrong return val\n");
971 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
972 ok( r == MSICONDITION_ERROR, "wrong return val\n");
974 r = MsiEvaluateCondition(hpkg, "\"0\"");
975 ok( r == MSICONDITION_TRUE, "wrong return val\n");
977 r = MsiEvaluateCondition(hpkg, "1 and 2");
978 ok( r == MSICONDITION_TRUE, "wrong return val\n");
980 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
981 ok( r == MSICONDITION_TRUE, "wrong return val\n");
983 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
984 ok( r == MSICONDITION_FALSE, "wrong return val\n");
986 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
987 ok( r == MSICONDITION_TRUE, "wrong return val\n");
989 r = MsiEvaluateCondition(hpkg, "(0)");
990 ok( r == MSICONDITION_FALSE, "wrong return val\n");
992 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
993 ok( r == MSICONDITION_ERROR, "wrong return val\n");
995 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
996 ok( r == MSICONDITION_TRUE, "wrong return val\n");
998 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
999 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1001 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1002 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1004 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1005 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1007 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1008 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1010 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1011 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1013 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1014 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1016 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1017 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1019 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1020 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1022 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1023 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1025 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1026 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1028 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1029 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1031 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1032 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1034 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1035 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1037 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1038 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1040 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1041 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1043 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1044 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1046 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1047 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1049 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1050 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1052 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1053 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1055 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1056 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1058 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1059 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1061 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1062 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1064 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1065 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1067 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1068 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1070 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1071 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1073 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1074 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1076 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1077 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1079 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1080 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1082 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1083 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1085 MsiSetProperty(hpkg, "mm", "5" );
1087 r = MsiEvaluateCondition(hpkg, "mm = 5");
1088 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1090 r = MsiEvaluateCondition(hpkg, "mm < 6");
1091 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1093 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1094 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1096 r = MsiEvaluateCondition(hpkg, "mm > 4");
1097 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1099 r = MsiEvaluateCondition(hpkg, "mm < 12");
1100 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1102 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1103 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1105 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1106 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1108 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1109 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1111 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1112 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1114 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1115 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1117 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1118 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1120 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1121 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1123 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1124 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1126 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1127 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1129 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1130 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1132 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1133 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1135 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1136 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1138 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1139 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1141 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1142 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1144 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1145 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1147 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1148 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1150 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1151 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1153 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1154 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1156 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1157 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1159 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1160 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1162 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1163 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1165 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1166 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1168 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1169 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1171 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1172 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1174 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1175 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1178 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1180 MsiSetProperty(hpkg, "bandalmael", "0" );
1181 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1182 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1184 MsiSetProperty(hpkg, "bandalmael", "" );
1185 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1186 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1188 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1189 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1190 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1192 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1193 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1194 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1196 MsiSetProperty(hpkg, "bandalmael", "0 " );
1197 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1198 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1200 MsiSetProperty(hpkg, "bandalmael", "-0" );
1201 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1202 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1204 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1205 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1206 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1208 MsiSetProperty(hpkg, "bandalmael", "--0" );
1209 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1210 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1212 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1213 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1214 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1216 MsiSetProperty(hpkg, "bandalmael", "-" );
1217 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1218 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1220 MsiSetProperty(hpkg, "bandalmael", "+0" );
1221 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1222 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1224 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1225 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1226 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1228 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1230 MsiSetProperty(hpkg, "one", "hi");
1231 MsiSetProperty(hpkg, "two", "hithere");
1232 r = MsiEvaluateCondition(hpkg, "one >< two");
1233 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1235 MsiSetProperty(hpkg, "one", "hithere");
1236 MsiSetProperty(hpkg, "two", "hi");
1237 r = MsiEvaluateCondition(hpkg, "one >< two");
1238 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1240 MsiSetProperty(hpkg, "one", "hello");
1241 MsiSetProperty(hpkg, "two", "hi");
1242 r = MsiEvaluateCondition(hpkg, "one >< two");
1243 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1245 MsiSetProperty(hpkg, "one", "hellohithere");
1246 MsiSetProperty(hpkg, "two", "hi");
1247 r = MsiEvaluateCondition(hpkg, "one >< two");
1248 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1250 MsiSetProperty(hpkg, "one", "");
1251 MsiSetProperty(hpkg, "two", "hi");
1252 r = MsiEvaluateCondition(hpkg, "one >< two");
1253 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1255 MsiSetProperty(hpkg, "one", "hi");
1256 MsiSetProperty(hpkg, "two", "");
1257 r = MsiEvaluateCondition(hpkg, "one >< two");
1258 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1260 MsiSetProperty(hpkg, "one", "");
1261 MsiSetProperty(hpkg, "two", "");
1262 r = MsiEvaluateCondition(hpkg, "one >< two");
1263 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1265 MsiSetProperty(hpkg, "one", "1234");
1266 MsiSetProperty(hpkg, "two", "1");
1267 r = MsiEvaluateCondition(hpkg, "one >< two");
1268 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1270 MsiSetProperty(hpkg, "one", "one 1234");
1271 MsiSetProperty(hpkg, "two", "1");
1272 r = MsiEvaluateCondition(hpkg, "one >< two");
1273 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1275 MsiSetProperty(hpkg, "one", "hithere");
1276 MsiSetProperty(hpkg, "two", "hi");
1277 r = MsiEvaluateCondition(hpkg, "one << two");
1278 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1280 MsiSetProperty(hpkg, "one", "hi");
1281 MsiSetProperty(hpkg, "two", "hithere");
1282 r = MsiEvaluateCondition(hpkg, "one << two");
1283 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1285 MsiSetProperty(hpkg, "one", "hi");
1286 MsiSetProperty(hpkg, "two", "hi");
1287 r = MsiEvaluateCondition(hpkg, "one << two");
1288 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1290 MsiSetProperty(hpkg, "one", "abcdhithere");
1291 MsiSetProperty(hpkg, "two", "hi");
1292 r = MsiEvaluateCondition(hpkg, "one << two");
1293 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1295 MsiSetProperty(hpkg, "one", "");
1296 MsiSetProperty(hpkg, "two", "hi");
1297 r = MsiEvaluateCondition(hpkg, "one << two");
1298 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1300 MsiSetProperty(hpkg, "one", "hithere");
1301 MsiSetProperty(hpkg, "two", "");
1302 r = MsiEvaluateCondition(hpkg, "one << two");
1303 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1305 MsiSetProperty(hpkg, "one", "");
1306 MsiSetProperty(hpkg, "two", "");
1307 r = MsiEvaluateCondition(hpkg, "one << two");
1308 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1310 MsiSetProperty(hpkg, "one", "1234");
1311 MsiSetProperty(hpkg, "two", "1");
1312 r = MsiEvaluateCondition(hpkg, "one << two");
1313 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1315 MsiSetProperty(hpkg, "one", "1234 one");
1316 MsiSetProperty(hpkg, "two", "1");
1317 r = MsiEvaluateCondition(hpkg, "one << two");
1318 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1320 MsiSetProperty(hpkg, "one", "hithere");
1321 MsiSetProperty(hpkg, "two", "there");
1322 r = MsiEvaluateCondition(hpkg, "one >> two");
1323 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1325 MsiSetProperty(hpkg, "one", "hithere");
1326 MsiSetProperty(hpkg, "two", "hi");
1327 r = MsiEvaluateCondition(hpkg, "one >> two");
1328 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1330 MsiSetProperty(hpkg, "one", "there");
1331 MsiSetProperty(hpkg, "two", "hithere");
1332 r = MsiEvaluateCondition(hpkg, "one >> two");
1333 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1335 MsiSetProperty(hpkg, "one", "there");
1336 MsiSetProperty(hpkg, "two", "there");
1337 r = MsiEvaluateCondition(hpkg, "one >> two");
1338 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1340 MsiSetProperty(hpkg, "one", "abcdhithere");
1341 MsiSetProperty(hpkg, "two", "hi");
1342 r = MsiEvaluateCondition(hpkg, "one >> two");
1343 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1345 MsiSetProperty(hpkg, "one", "");
1346 MsiSetProperty(hpkg, "two", "there");
1347 r = MsiEvaluateCondition(hpkg, "one >> two");
1348 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1350 MsiSetProperty(hpkg, "one", "there");
1351 MsiSetProperty(hpkg, "two", "");
1352 r = MsiEvaluateCondition(hpkg, "one >> two");
1353 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1355 MsiSetProperty(hpkg, "one", "");
1356 MsiSetProperty(hpkg, "two", "");
1357 r = MsiEvaluateCondition(hpkg, "one >> two");
1358 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1360 MsiSetProperty(hpkg, "one", "1234");
1361 MsiSetProperty(hpkg, "two", "4");
1362 r = MsiEvaluateCondition(hpkg, "one >> two");
1363 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 MsiSetProperty(hpkg, "one", "one 1234");
1366 MsiSetProperty(hpkg, "two", "4");
1367 r = MsiEvaluateCondition(hpkg, "one >> two");
1368 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1370 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1372 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1373 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1375 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1376 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1378 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1379 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1381 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1382 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1384 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1385 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1387 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1388 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1390 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1391 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1393 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1394 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1396 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1397 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1399 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1400 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1402 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1403 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1405 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1406 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1408 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1409 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1411 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1412 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1414 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1415 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1417 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1418 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1420 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1421 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1423 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1424 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1426 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1427 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1429 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1430 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1432 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1433 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1435 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1436 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1438 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1439 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1441 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1442 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1444 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1445 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1447 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1448 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1450 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1451 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1453 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1454 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1456 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1457 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1459 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1460 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1462 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1463 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1465 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1466 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1468 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1469 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1471 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1472 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1474 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1475 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1477 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1478 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1480 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1481 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1483 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1484 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1485 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1487 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1488 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1490 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1491 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1493 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1494 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1496 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1497 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1499 MsiSetProperty(hpkg, "one", "1");
1500 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1501 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1503 MsiSetProperty(hpkg, "X", "5.0");
1505 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1506 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1508 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1509 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1511 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1512 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1514 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1515 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1517 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1518 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1520 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1521 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1523 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1524 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1526 /* feature doesn't exist */
1527 r = MsiEvaluateCondition(hpkg, "&nofeature");
1528 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1530 MsiSetProperty(hpkg, "A", "2");
1531 MsiSetProperty(hpkg, "X", "50");
1533 r = MsiEvaluateCondition(hpkg, "2 <= X");
1534 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1536 r = MsiEvaluateCondition(hpkg, "A <= X");
1537 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1539 r = MsiEvaluateCondition(hpkg, "A <= 50");
1540 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1542 MsiSetProperty(hpkg, "X", "50val");
1544 r = MsiEvaluateCondition(hpkg, "2 <= X");
1545 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1547 r = MsiEvaluateCondition(hpkg, "A <= X");
1548 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1550 MsiSetProperty(hpkg, "A", "7");
1551 MsiSetProperty(hpkg, "X", "50");
1553 r = MsiEvaluateCondition(hpkg, "7 <= X");
1554 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1556 r = MsiEvaluateCondition(hpkg, "A <= X");
1557 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1559 r = MsiEvaluateCondition(hpkg, "A <= 50");
1560 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1562 MsiSetProperty(hpkg, "X", "50val");
1564 r = MsiEvaluateCondition(hpkg, "2 <= X");
1565 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1567 r = MsiEvaluateCondition(hpkg, "A <= X");
1568 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1570 MsiCloseHandle( hpkg );
1571 DeleteFile(msifile);
1574 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1576 UINT r;
1577 DWORD sz;
1578 char buffer[2];
1580 sz = sizeof buffer;
1581 strcpy(buffer,"x");
1582 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1583 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1586 static void test_props(void)
1588 MSIHANDLE hpkg, hdb;
1589 UINT r;
1590 DWORD sz;
1591 char buffer[0x100];
1593 hdb = create_package_db();
1594 r = run_query( hdb,
1595 "CREATE TABLE `Property` ( "
1596 "`Property` CHAR(255) NOT NULL, "
1597 "`Value` CHAR(255) "
1598 "PRIMARY KEY `Property`)" );
1599 ok( r == ERROR_SUCCESS , "Failed\n" );
1601 r = run_query(hdb,
1602 "INSERT INTO `Property` "
1603 "(`Property`, `Value`) "
1604 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1605 ok( r == ERROR_SUCCESS , "Failed\n" );
1607 hpkg = package_from_db( hdb );
1608 ok( hpkg, "failed to create package\n");
1610 /* test invalid values */
1611 r = MsiGetProperty( 0, NULL, NULL, NULL );
1612 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1614 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1615 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1617 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1618 ok( r == ERROR_SUCCESS, "wrong return val\n");
1620 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1621 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1623 /* test retrieving an empty/nonexistent property */
1624 sz = sizeof buffer;
1625 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1626 ok( r == ERROR_SUCCESS, "wrong return val\n");
1627 ok( sz == 0, "wrong size returned\n");
1629 check_prop_empty( hpkg, "boo");
1630 sz = 0;
1631 strcpy(buffer,"x");
1632 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1633 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1634 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1635 ok( sz == 0, "wrong size returned\n");
1637 sz = 1;
1638 strcpy(buffer,"x");
1639 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1640 ok( r == ERROR_SUCCESS, "wrong return val\n");
1641 ok( buffer[0] == 0, "buffer was not changed\n");
1642 ok( sz == 0, "wrong size returned\n");
1644 /* set the property to something */
1645 r = MsiSetProperty( 0, NULL, NULL );
1646 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1648 r = MsiSetProperty( hpkg, NULL, NULL );
1649 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1651 r = MsiSetProperty( hpkg, "", NULL );
1652 ok( r == ERROR_SUCCESS, "wrong return val\n");
1654 /* try set and get some illegal property identifiers */
1655 r = MsiSetProperty( hpkg, "", "asdf" );
1656 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1658 r = MsiSetProperty( hpkg, "=", "asdf" );
1659 ok( r == ERROR_SUCCESS, "wrong return val\n");
1661 r = MsiSetProperty( hpkg, " ", "asdf" );
1662 ok( r == ERROR_SUCCESS, "wrong return val\n");
1664 r = MsiSetProperty( hpkg, "'", "asdf" );
1665 ok( r == ERROR_SUCCESS, "wrong return val\n");
1667 sz = sizeof buffer;
1668 buffer[0]=0;
1669 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1670 ok( r == ERROR_SUCCESS, "wrong return val\n");
1671 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1673 /* set empty values */
1674 r = MsiSetProperty( hpkg, "boo", NULL );
1675 ok( r == ERROR_SUCCESS, "wrong return val\n");
1676 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1678 r = MsiSetProperty( hpkg, "boo", "" );
1679 ok( r == ERROR_SUCCESS, "wrong return val\n");
1680 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1682 /* set a non-empty value */
1683 r = MsiSetProperty( hpkg, "boo", "xyz" );
1684 ok( r == ERROR_SUCCESS, "wrong return val\n");
1686 sz = 1;
1687 strcpy(buffer,"x");
1688 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1689 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1690 ok( buffer[0] == 0, "buffer was not changed\n");
1691 ok( sz == 3, "wrong size returned\n");
1693 sz = 4;
1694 strcpy(buffer,"x");
1695 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1696 ok( r == ERROR_SUCCESS, "wrong return val\n");
1697 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1698 ok( sz == 3, "wrong size returned\n");
1700 sz = 3;
1701 strcpy(buffer,"x");
1702 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1703 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1704 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1705 ok( sz == 3, "wrong size returned\n");
1707 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1708 ok( r == ERROR_SUCCESS, "wrong return val\n");
1710 sz = 4;
1711 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1712 ok( r == ERROR_SUCCESS, "wrong return val\n");
1713 ok( !strcmp(buffer,""), "buffer wrong\n");
1714 ok( sz == 0, "wrong size returned\n");
1716 sz = 4;
1717 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1718 ok( r == ERROR_SUCCESS, "wrong return val\n");
1719 ok( !strcmp(buffer,""), "buffer wrong\n");
1720 ok( sz == 0, "wrong size returned\n");
1722 sz = 4;
1723 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1724 ok( r == ERROR_SUCCESS, "wrong return val\n");
1725 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1726 ok( sz == 3, "wrong size returned\n");
1728 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1729 ok( r == ERROR_SUCCESS, "wrong return val\n");
1731 sz = 0;
1732 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1733 ok( r == ERROR_SUCCESS, "return wrong\n");
1734 ok( sz == 13, "size wrong (%d)\n", sz);
1736 sz = 13;
1737 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1738 ok( r == ERROR_MORE_DATA, "return wrong\n");
1739 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1741 r = MsiSetProperty(hpkg, "property", "value");
1742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1744 sz = 6;
1745 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1746 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1747 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1749 r = MsiSetProperty(hpkg, "property", NULL);
1750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1752 sz = 6;
1753 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1755 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1757 MsiCloseHandle( hpkg );
1758 DeleteFile(msifile);
1761 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1763 MSIHANDLE hview, hrec;
1764 BOOL found;
1765 CHAR buffer[MAX_PATH];
1766 DWORD sz;
1767 UINT r;
1769 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1770 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1771 r = MsiViewExecute(hview, 0);
1772 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1774 found = FALSE;
1775 while (r == ERROR_SUCCESS && !found)
1777 r = MsiViewFetch(hview, &hrec);
1778 if (r != ERROR_SUCCESS) break;
1780 sz = MAX_PATH;
1781 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1782 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1784 sz = MAX_PATH;
1785 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1786 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1787 found = TRUE;
1790 MsiCloseHandle(hrec);
1793 MsiViewClose(hview);
1794 MsiCloseHandle(hview);
1796 return found;
1799 static void test_property_table(void)
1801 const char *query;
1802 UINT r;
1803 MSIHANDLE hpkg, hdb, hrec;
1804 char buffer[MAX_PATH];
1805 DWORD sz;
1806 BOOL found;
1808 hdb = create_package_db();
1809 ok( hdb, "failed to create package\n");
1811 hpkg = package_from_db(hdb);
1812 ok( hpkg, "failed to create package\n");
1814 MsiCloseHandle(hdb);
1816 hdb = MsiGetActiveDatabase(hpkg);
1818 query = "CREATE TABLE `_Property` ( "
1819 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1820 r = run_query(hdb, query);
1821 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1823 MsiCloseHandle(hdb);
1824 MsiCloseHandle(hpkg);
1825 DeleteFile(msifile);
1827 hdb = create_package_db();
1828 ok( hdb, "failed to create package\n");
1830 query = "CREATE TABLE `_Property` ( "
1831 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1832 r = run_query(hdb, query);
1833 ok(r == ERROR_SUCCESS, "failed to create table\n");
1835 query = "ALTER `_Property` ADD `foo` INTEGER";
1836 r = run_query(hdb, query);
1837 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1839 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1840 r = run_query(hdb, query);
1841 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1843 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1844 r = run_query(hdb, query);
1845 ok(r == ERROR_SUCCESS, "failed to add column\n");
1847 hpkg = package_from_db(hdb);
1848 todo_wine
1850 ok(!hpkg, "package should not be created\n");
1853 MsiCloseHandle(hdb);
1854 MsiCloseHandle(hpkg);
1855 DeleteFile(msifile);
1857 hdb = create_package_db();
1858 ok (hdb, "failed to create package database\n");
1860 r = create_property_table(hdb);
1861 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
1863 r = add_property_entry(hdb, "'prop', 'val'");
1864 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1866 hpkg = package_from_db(hdb);
1867 ok(hpkg, "failed to create package\n");
1869 MsiCloseHandle(hdb);
1871 sz = MAX_PATH;
1872 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
1873 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1874 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
1876 hdb = MsiGetActiveDatabase(hpkg);
1878 found = find_prop_in_property(hdb, "prop", "val");
1879 ok(found, "prop should be in the _Property table\n");
1881 r = add_property_entry(hdb, "'dantes', 'mercedes'");
1882 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1884 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1885 r = do_query(hdb, query, &hrec);
1886 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1888 found = find_prop_in_property(hdb, "dantes", "mercedes");
1889 ok(found == FALSE, "dantes should not be in the _Property table\n");
1891 sz = MAX_PATH;
1892 lstrcpy(buffer, "aaa");
1893 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
1894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1895 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
1897 r = MsiSetProperty(hpkg, "dantes", "mercedes");
1898 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1900 found = find_prop_in_property(hdb, "dantes", "mercedes");
1901 ok(found == TRUE, "dantes should be in the _Property table\n");
1903 MsiCloseHandle(hdb);
1904 MsiCloseHandle(hpkg);
1905 DeleteFile(msifile);
1908 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
1910 MSIHANDLE htab = 0;
1911 UINT res;
1913 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
1914 if( res == ERROR_SUCCESS )
1916 UINT r;
1918 r = MsiViewExecute( htab, hrec );
1919 if( r != ERROR_SUCCESS )
1921 res = r;
1922 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
1925 r = MsiViewClose( htab );
1926 if( r != ERROR_SUCCESS )
1927 res = r;
1929 r = MsiCloseHandle( htab );
1930 if( r != ERROR_SUCCESS )
1931 res = r;
1933 return res;
1936 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
1938 return try_query_param( hdb, szQuery, 0 );
1941 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
1943 MSIHANDLE summary;
1944 UINT r;
1946 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
1947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1949 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
1950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1952 r = MsiSummaryInfoPersist(summary);
1953 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1955 MsiCloseHandle(summary);
1958 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
1960 MSIHANDLE summary;
1961 UINT r;
1963 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
1964 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1966 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
1967 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1969 r = MsiSummaryInfoPersist(summary);
1970 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1972 MsiCloseHandle(summary);
1975 static void test_msipackage(void)
1977 MSIHANDLE hdb = 0, hpack = 100;
1978 UINT r;
1979 const char *query;
1980 char name[10];
1982 /* NULL szPackagePath */
1983 r = MsiOpenPackage(NULL, &hpack);
1984 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
1986 /* empty szPackagePath */
1987 r = MsiOpenPackage("", &hpack);
1988 todo_wine
1990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1993 if (r == ERROR_SUCCESS)
1994 MsiCloseHandle(hpack);
1996 /* nonexistent szPackagePath */
1997 r = MsiOpenPackage("nonexistent", &hpack);
1998 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2000 /* NULL hProduct */
2001 r = MsiOpenPackage(msifile, NULL);
2002 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2004 name[0]='#';
2005 name[1]=0;
2006 r = MsiOpenPackage(name, &hpack);
2007 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2009 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2012 /* database exists, but is emtpy */
2013 sprintf(name, "#%ld", hdb);
2014 r = MsiOpenPackage(name, &hpack);
2015 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2016 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2018 query = "CREATE TABLE `Property` ( "
2019 "`Property` CHAR(72), `Value` CHAR(0) "
2020 "PRIMARY KEY `Property`)";
2021 r = try_query(hdb, query);
2022 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2024 query = "CREATE TABLE `InstallExecuteSequence` ("
2025 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2026 "PRIMARY KEY `Action`)";
2027 r = try_query(hdb, query);
2028 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2030 /* a few key tables exist */
2031 sprintf(name, "#%ld", hdb);
2032 r = MsiOpenPackage(name, &hpack);
2033 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2034 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2036 MsiCloseHandle(hdb);
2037 DeleteFile(msifile);
2039 /* start with a clean database to show what constitutes a valid package */
2040 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2043 sprintf(name, "#%ld", hdb);
2045 /* The following summary information props must exist:
2046 * - PID_REVNUMBER
2047 * - PID_PAGECOUNT
2050 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2051 r = MsiOpenPackage(name, &hpack);
2052 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2053 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2055 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2056 r = MsiOpenPackage(name, &hpack);
2057 ok(r == ERROR_SUCCESS,
2058 "Expected ERROR_SUCCESS, got %d\n", r);
2060 MsiCloseHandle(hpack);
2061 MsiCloseHandle(hdb);
2062 DeleteFile(msifile);
2065 static void test_formatrecord2(void)
2067 MSIHANDLE hpkg, hrec ;
2068 char buffer[0x100];
2069 DWORD sz;
2070 UINT r;
2072 hpkg = package_from_db(create_package_db());
2073 ok( hpkg, "failed to create package\n");
2075 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2076 ok( r == ERROR_SUCCESS, "set property failed\n");
2078 hrec = MsiCreateRecord(2);
2079 ok(hrec, "create record failed\n");
2081 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2082 ok( r == ERROR_SUCCESS, "format record failed\n");
2084 buffer[0] = 0;
2085 sz = sizeof buffer;
2086 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2088 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2089 r = MsiRecordSetString(hrec, 1, "hoo");
2090 sz = sizeof buffer;
2091 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2092 ok( sz == 3, "size wrong\n");
2093 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2094 ok( r == ERROR_SUCCESS, "format failed\n");
2096 r = MsiRecordSetString(hrec, 0, "x[~]x");
2097 sz = sizeof buffer;
2098 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2099 ok( sz == 3, "size wrong\n");
2100 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2101 ok( r == ERROR_SUCCESS, "format failed\n");
2103 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2104 r = MsiRecordSetString(hrec, 1, "hoo");
2105 sz = sizeof buffer;
2106 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2107 ok( sz == 3, "size wrong\n");
2108 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2109 ok( r == ERROR_SUCCESS, "format failed\n");
2111 r = MsiRecordSetString(hrec, 0, "[\\[]");
2112 sz = sizeof buffer;
2113 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2114 ok( sz == 1, "size wrong\n");
2115 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2116 ok( r == ERROR_SUCCESS, "format failed\n");
2118 SetEnvironmentVariable("FOO", "BAR");
2119 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2120 sz = sizeof buffer;
2121 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2122 ok( sz == 3, "size wrong\n");
2123 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2124 ok( r == ERROR_SUCCESS, "format failed\n");
2126 r = MsiRecordSetString(hrec, 0, "[[1]]");
2127 r = MsiRecordSetString(hrec, 1, "%FOO");
2128 sz = sizeof buffer;
2129 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2130 ok( sz == 3, "size wrong\n");
2131 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2132 ok( r == ERROR_SUCCESS, "format failed\n");
2134 MsiCloseHandle( hrec );
2135 MsiCloseHandle( hpkg );
2136 DeleteFile(msifile);
2139 static void test_states(void)
2141 MSIHANDLE hpkg;
2142 UINT r;
2143 MSIHANDLE hdb;
2144 INSTALLSTATE state, action;
2146 static const CHAR msifile2[] = "winetest2.msi";
2147 static const CHAR msifile3[] = "winetest3.msi";
2149 hdb = create_package_db();
2150 ok ( hdb, "failed to create package database\n" );
2152 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2153 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2155 r = create_property_table( hdb );
2156 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2158 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2159 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2161 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2162 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2164 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2165 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2167 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2168 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2170 r = create_install_execute_sequence_table( hdb );
2171 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2173 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2174 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2176 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2177 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2179 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2180 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2182 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2183 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2185 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2186 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2188 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2189 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2191 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2192 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2194 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2195 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2197 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2198 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2200 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2201 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2203 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2204 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2206 r = create_media_table( hdb );
2207 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2209 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2210 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2212 r = create_feature_table( hdb );
2213 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2215 r = create_component_table( hdb );
2216 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2218 /* msidbFeatureAttributesFavorLocal */
2219 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2220 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2222 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2223 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2224 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2226 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2227 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2228 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2230 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2231 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2232 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2234 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2235 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2236 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2238 /* msidbFeatureAttributesFavorSource */
2239 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2240 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2242 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2243 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2244 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2246 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2247 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2248 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2250 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2251 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2252 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2254 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2255 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2256 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2258 /* msidbFeatureAttributesFavorSource */
2259 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2260 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2262 /* msidbFeatureAttributesFavorLocal */
2263 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2264 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2266 /* disabled */
2267 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2268 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2270 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2271 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2272 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2274 /* no feature parent:msidbComponentAttributesLocalOnly */
2275 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2276 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2278 /* msidbFeatureAttributesFavorLocal:removed */
2279 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2280 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2282 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2283 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2284 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2286 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2287 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2288 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2290 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2291 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2292 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2294 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2295 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2296 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2298 /* msidbFeatureAttributesFavorSource:removed */
2299 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2300 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2302 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2303 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2304 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2306 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2307 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2308 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2310 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2311 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2312 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2314 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2315 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2316 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2318 r = create_feature_components_table( hdb );
2319 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2321 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2322 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2324 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2325 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2327 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2328 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2330 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2331 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2333 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2334 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2336 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2337 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2339 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2340 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2342 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2343 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2345 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2346 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2348 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2349 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2351 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2352 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2354 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2355 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2357 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2358 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2360 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2361 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2363 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2364 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2366 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2367 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2369 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2370 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2372 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2373 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2375 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2376 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2378 r = create_file_table( hdb );
2379 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2381 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2382 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2384 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2385 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2387 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2388 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2390 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2391 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2393 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2394 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2396 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2397 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2399 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2400 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2402 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2403 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2405 /* compressed file */
2406 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2407 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2409 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2410 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2412 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2413 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2415 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2416 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2418 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2419 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2421 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2422 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2424 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2425 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2427 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2428 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2430 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2431 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2433 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2434 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2436 MsiDatabaseCommit(hdb);
2438 /* these properties must not be in the saved msi file */
2439 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2440 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2442 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2443 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2445 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2446 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2448 hpkg = package_from_db( hdb );
2449 ok( hpkg, "failed to create package\n");
2451 MsiCloseHandle(hdb);
2453 CopyFileA(msifile, msifile2, FALSE);
2454 CopyFileA(msifile, msifile3, FALSE);
2456 state = 0xdeadbee;
2457 action = 0xdeadbee;
2458 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2459 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2460 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2461 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2463 state = 0xdeadbee;
2464 action = 0xdeadbee;
2465 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2466 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2467 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2468 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2470 state = 0xdeadbee;
2471 action = 0xdeadbee;
2472 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2473 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2474 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2475 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2477 state = 0xdeadbee;
2478 action = 0xdeadbee;
2479 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2480 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2481 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2482 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2484 state = 0xdeadbee;
2485 action = 0xdeadbee;
2486 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2487 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2488 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2489 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2491 state = 0xdeadbee;
2492 action = 0xdeadbee;
2493 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2494 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2495 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2496 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2498 state = 0xdeadbee;
2499 action = 0xdeadbee;
2500 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2501 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2502 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2503 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2505 state = 0xdeadbee;
2506 action = 0xdeadbee;
2507 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2508 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2509 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2510 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2512 state = 0xdeadbee;
2513 action = 0xdeadbee;
2514 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2515 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2516 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2517 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2519 state = 0xdeadbee;
2520 action = 0xdeadbee;
2521 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2522 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2523 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2524 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2526 state = 0xdeadbee;
2527 action = 0xdeadbee;
2528 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2529 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2530 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2531 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2533 state = 0xdeadbee;
2534 action = 0xdeadbee;
2535 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2536 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2537 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2538 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2540 state = 0xdeadbee;
2541 action = 0xdeadbee;
2542 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2543 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2544 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2545 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2547 state = 0xdeadbee;
2548 action = 0xdeadbee;
2549 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2550 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2551 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2552 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2554 state = 0xdeadbee;
2555 action = 0xdeadbee;
2556 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2557 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2558 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2559 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2561 state = 0xdeadbee;
2562 action = 0xdeadbee;
2563 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2564 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2565 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2566 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2568 state = 0xdeadbee;
2569 action = 0xdeadbee;
2570 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2571 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2572 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2573 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2575 state = 0xdeadbee;
2576 action = 0xdeadbee;
2577 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2578 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2579 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2580 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2582 state = 0xdeadbee;
2583 action = 0xdeadbee;
2584 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2585 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2586 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2587 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2589 state = 0xdeadbee;
2590 action = 0xdeadbee;
2591 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2592 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2593 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2594 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2596 state = 0xdeadbee;
2597 action = 0xdeadbee;
2598 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2599 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2600 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2601 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2603 state = 0xdeadbee;
2604 action = 0xdeadbee;
2605 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2606 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2607 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2608 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2610 state = 0xdeadbee;
2611 action = 0xdeadbee;
2612 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2613 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2614 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2615 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2617 state = 0xdeadbee;
2618 action = 0xdeadbee;
2619 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2620 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2621 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2622 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2624 state = 0xdeadbee;
2625 action = 0xdeadbee;
2626 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2627 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2628 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2629 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2631 r = MsiDoAction( hpkg, "CostInitialize");
2632 ok( r == ERROR_SUCCESS, "cost init failed\n");
2634 state = 0xdeadbee;
2635 action = 0xdeadbee;
2636 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2638 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2639 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2641 state = 0xdeadbee;
2642 action = 0xdeadbee;
2643 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2645 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2646 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2648 state = 0xdeadbee;
2649 action = 0xdeadbee;
2650 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2652 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2653 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2655 state = 0xdeadbee;
2656 action = 0xdeadbee;
2657 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2659 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2660 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2662 state = 0xdeadbee;
2663 action = 0xdeadbee;
2664 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2666 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2667 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2669 state = 0xdeadbee;
2670 action = 0xdeadbee;
2671 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2673 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2674 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2676 state = 0xdeadbee;
2677 action = 0xdeadbee;
2678 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2680 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2681 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2683 state = 0xdeadbee;
2684 action = 0xdeadbee;
2685 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2687 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2688 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2690 state = 0xdeadbee;
2691 action = 0xdeadbee;
2692 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2694 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2695 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2697 state = 0xdeadbee;
2698 action = 0xdeadbee;
2699 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2701 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2702 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2704 state = 0xdeadbee;
2705 action = 0xdeadbee;
2706 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2708 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2709 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2711 state = 0xdeadbee;
2712 action = 0xdeadbee;
2713 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2715 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2716 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2718 state = 0xdeadbee;
2719 action = 0xdeadbee;
2720 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2722 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2723 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2725 state = 0xdeadbee;
2726 action = 0xdeadbee;
2727 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2729 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2730 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2732 state = 0xdeadbee;
2733 action = 0xdeadbee;
2734 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2736 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2737 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2739 state = 0xdeadbee;
2740 action = 0xdeadbee;
2741 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2743 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2744 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2746 state = 0xdeadbee;
2747 action = 0xdeadbee;
2748 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2750 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2751 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2753 state = 0xdeadbee;
2754 action = 0xdeadbee;
2755 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2757 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2758 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2760 state = 0xdeadbee;
2761 action = 0xdeadbee;
2762 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2764 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2765 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2767 state = 0xdeadbee;
2768 action = 0xdeadbee;
2769 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2770 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2771 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2772 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2774 state = 0xdeadbee;
2775 action = 0xdeadbee;
2776 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2777 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2778 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2779 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2781 state = 0xdeadbee;
2782 action = 0xdeadbee;
2783 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2784 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2785 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2786 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2788 state = 0xdeadbee;
2789 action = 0xdeadbee;
2790 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2791 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2792 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2793 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2795 state = 0xdeadbee;
2796 action = 0xdeadbee;
2797 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2798 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2799 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2800 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2802 state = 0xdeadbee;
2803 action = 0xdeadbee;
2804 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2805 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2806 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2807 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2809 r = MsiDoAction( hpkg, "FileCost");
2810 ok( r == ERROR_SUCCESS, "file cost failed\n");
2812 state = 0xdeadbee;
2813 action = 0xdeadbee;
2814 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2816 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2817 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2819 state = 0xdeadbee;
2820 action = 0xdeadbee;
2821 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2822 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2823 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2824 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2826 state = 0xdeadbee;
2827 action = 0xdeadbee;
2828 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2830 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2831 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2833 state = 0xdeadbee;
2834 action = 0xdeadbee;
2835 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2836 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2837 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2838 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2840 state = 0xdeadbee;
2841 action = 0xdeadbee;
2842 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2843 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2844 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2845 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2847 state = 0xdeadbee;
2848 action = 0xdeadbee;
2849 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2850 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2851 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2852 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2854 state = 0xdeadbee;
2855 action = 0xdeadbee;
2856 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2857 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2858 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2859 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2861 state = 0xdeadbee;
2862 action = 0xdeadbee;
2863 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2864 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2865 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2866 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2868 state = 0xdeadbee;
2869 action = 0xdeadbee;
2870 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2871 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2872 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2875 state = 0xdeadbee;
2876 action = 0xdeadbee;
2877 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2878 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2879 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2880 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2882 state = 0xdeadbee;
2883 action = 0xdeadbee;
2884 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2885 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2886 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2887 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2889 state = 0xdeadbee;
2890 action = 0xdeadbee;
2891 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2892 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2893 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2894 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2896 state = 0xdeadbee;
2897 action = 0xdeadbee;
2898 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2900 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2903 state = 0xdeadbee;
2904 action = 0xdeadbee;
2905 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2907 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2908 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2910 state = 0xdeadbee;
2911 action = 0xdeadbee;
2912 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2913 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2914 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2915 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2917 state = 0xdeadbee;
2918 action = 0xdeadbee;
2919 r = MsiGetComponentState(hpkg, "eta", &state, &action);
2920 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2921 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2922 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2924 state = 0xdeadbee;
2925 action = 0xdeadbee;
2926 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
2927 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2928 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2929 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2931 state = 0xdeadbee;
2932 action = 0xdeadbee;
2933 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
2934 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2935 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2936 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2938 state = 0xdeadbee;
2939 action = 0xdeadbee;
2940 r = MsiGetComponentState(hpkg, "mu", &state, &action);
2941 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2942 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2943 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2945 state = 0xdeadbee;
2946 action = 0xdeadbee;
2947 r = MsiGetComponentState(hpkg, "nu", &state, &action);
2948 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2949 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2952 state = 0xdeadbee;
2953 action = 0xdeadbee;
2954 r = MsiGetComponentState(hpkg, "xi", &state, &action);
2955 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2956 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2957 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2959 state = 0xdeadbee;
2960 action = 0xdeadbee;
2961 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
2962 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2963 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2964 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2966 state = 0xdeadbee;
2967 action = 0xdeadbee;
2968 r = MsiGetComponentState(hpkg, "pi", &state, &action);
2969 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2970 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2971 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2973 state = 0xdeadbee;
2974 action = 0xdeadbee;
2975 r = MsiGetComponentState(hpkg, "rho", &state, &action);
2976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2977 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2978 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2980 state = 0xdeadbee;
2981 action = 0xdeadbee;
2982 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
2983 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2984 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2985 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2987 r = MsiDoAction( hpkg, "CostFinalize");
2988 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
2990 state = 0xdeadbee;
2991 action = 0xdeadbee;
2992 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2994 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
2995 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
2997 state = 0xdeadbee;
2998 action = 0xdeadbee;
2999 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3001 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3002 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3004 state = 0xdeadbee;
3005 action = 0xdeadbee;
3006 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3008 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3009 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3011 state = 0xdeadbee;
3012 action = 0xdeadbee;
3013 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3015 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3016 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3018 state = 0xdeadbee;
3019 action = 0xdeadbee;
3020 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3022 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3025 state = 0xdeadbee;
3026 action = 0xdeadbee;
3027 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3029 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3030 todo_wine
3032 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3035 state = 0xdeadbee;
3036 action = 0xdeadbee;
3037 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3039 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3040 todo_wine
3042 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3045 state = 0xdeadbee;
3046 action = 0xdeadbee;
3047 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3048 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3049 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3050 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3052 state = 0xdeadbee;
3053 action = 0xdeadbee;
3054 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3055 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3056 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3057 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3059 state = 0xdeadbee;
3060 action = 0xdeadbee;
3061 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3062 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3063 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3064 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3066 state = 0xdeadbee;
3067 action = 0xdeadbee;
3068 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3069 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3070 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3071 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3073 state = 0xdeadbee;
3074 action = 0xdeadbee;
3075 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3077 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3078 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3080 state = 0xdeadbee;
3081 action = 0xdeadbee;
3082 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3084 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3085 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3087 state = 0xdeadbee;
3088 action = 0xdeadbee;
3089 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3091 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3092 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3094 state = 0xdeadbee;
3095 action = 0xdeadbee;
3096 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3098 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3099 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3101 state = 0xdeadbee;
3102 action = 0xdeadbee;
3103 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3105 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3106 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3108 state = 0xdeadbee;
3109 action = 0xdeadbee;
3110 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3112 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3115 state = 0xdeadbee;
3116 action = 0xdeadbee;
3117 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3119 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3122 state = 0xdeadbee;
3123 action = 0xdeadbee;
3124 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3126 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3129 state = 0xdeadbee;
3130 action = 0xdeadbee;
3131 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3133 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3136 state = 0xdeadbee;
3137 action = 0xdeadbee;
3138 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3140 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3143 state = 0xdeadbee;
3144 action = 0xdeadbee;
3145 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3147 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3150 state = 0xdeadbee;
3151 action = 0xdeadbee;
3152 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3154 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3157 state = 0xdeadbee;
3158 action = 0xdeadbee;
3159 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3161 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3164 state = 0xdeadbee;
3165 action = 0xdeadbee;
3166 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3168 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3171 MsiCloseHandle( hpkg );
3173 /* publish the features and components */
3174 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3177 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3178 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3180 /* these properties must not be in the saved msi file */
3181 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3182 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3184 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3185 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3187 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3188 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3190 hpkg = package_from_db( hdb );
3191 ok( hpkg, "failed to create package\n");
3193 MsiCloseHandle(hdb);
3195 state = 0xdeadbee;
3196 action = 0xdeadbee;
3197 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3198 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3199 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3200 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3202 state = 0xdeadbee;
3203 action = 0xdeadbee;
3204 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3205 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3206 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3207 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3209 state = 0xdeadbee;
3210 action = 0xdeadbee;
3211 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3212 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3213 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3214 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3216 state = 0xdeadbee;
3217 action = 0xdeadbee;
3218 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3219 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3220 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3221 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3223 state = 0xdeadbee;
3224 action = 0xdeadbee;
3225 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3226 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3227 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3228 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3230 state = 0xdeadbee;
3231 action = 0xdeadbee;
3232 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3233 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3234 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3235 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3237 state = 0xdeadbee;
3238 action = 0xdeadbee;
3239 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3240 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3241 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3242 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3244 state = 0xdeadbee;
3245 action = 0xdeadbee;
3246 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3247 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3248 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3249 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3251 state = 0xdeadbee;
3252 action = 0xdeadbee;
3253 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3254 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3255 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3256 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3258 state = 0xdeadbee;
3259 action = 0xdeadbee;
3260 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3261 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3262 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3263 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3265 state = 0xdeadbee;
3266 action = 0xdeadbee;
3267 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3268 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3269 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3270 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3272 state = 0xdeadbee;
3273 action = 0xdeadbee;
3274 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3275 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3276 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3277 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3279 state = 0xdeadbee;
3280 action = 0xdeadbee;
3281 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3282 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3283 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3284 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3286 state = 0xdeadbee;
3287 action = 0xdeadbee;
3288 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3289 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3290 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3291 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3293 state = 0xdeadbee;
3294 action = 0xdeadbee;
3295 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3296 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3297 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3298 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3300 state = 0xdeadbee;
3301 action = 0xdeadbee;
3302 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3303 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3304 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3305 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3307 state = 0xdeadbee;
3308 action = 0xdeadbee;
3309 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3310 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3311 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3312 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3314 state = 0xdeadbee;
3315 action = 0xdeadbee;
3316 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3317 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3318 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3319 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3321 state = 0xdeadbee;
3322 action = 0xdeadbee;
3323 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3324 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3325 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3326 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3328 state = 0xdeadbee;
3329 action = 0xdeadbee;
3330 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3331 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3332 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3333 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3335 state = 0xdeadbee;
3336 action = 0xdeadbee;
3337 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3338 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3339 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3340 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3342 state = 0xdeadbee;
3343 action = 0xdeadbee;
3344 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3345 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3346 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3347 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3349 state = 0xdeadbee;
3350 action = 0xdeadbee;
3351 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3352 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3353 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3354 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3356 state = 0xdeadbee;
3357 action = 0xdeadbee;
3358 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3359 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3360 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3361 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3363 state = 0xdeadbee;
3364 action = 0xdeadbee;
3365 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3366 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3367 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3368 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3370 r = MsiDoAction( hpkg, "CostInitialize");
3371 ok( r == ERROR_SUCCESS, "cost init failed\n");
3373 state = 0xdeadbee;
3374 action = 0xdeadbee;
3375 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3377 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3380 state = 0xdeadbee;
3381 action = 0xdeadbee;
3382 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3384 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3387 state = 0xdeadbee;
3388 action = 0xdeadbee;
3389 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3394 state = 0xdeadbee;
3395 action = 0xdeadbee;
3396 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3401 state = 0xdeadbee;
3402 action = 0xdeadbee;
3403 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3408 state = 0xdeadbee;
3409 action = 0xdeadbee;
3410 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3412 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3415 state = 0xdeadbee;
3416 action = 0xdeadbee;
3417 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3419 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3420 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3422 state = 0xdeadbee;
3423 action = 0xdeadbee;
3424 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3426 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3429 state = 0xdeadbee;
3430 action = 0xdeadbee;
3431 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3432 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3433 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3434 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3436 state = 0xdeadbee;
3437 action = 0xdeadbee;
3438 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3439 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3440 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3441 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3443 state = 0xdeadbee;
3444 action = 0xdeadbee;
3445 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3446 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3447 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3448 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3450 state = 0xdeadbee;
3451 action = 0xdeadbee;
3452 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3453 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3454 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3455 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3457 state = 0xdeadbee;
3458 action = 0xdeadbee;
3459 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3460 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3461 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3462 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3464 state = 0xdeadbee;
3465 action = 0xdeadbee;
3466 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3468 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3469 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3471 state = 0xdeadbee;
3472 action = 0xdeadbee;
3473 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3474 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3475 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3476 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3478 state = 0xdeadbee;
3479 action = 0xdeadbee;
3480 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3482 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3483 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3485 state = 0xdeadbee;
3486 action = 0xdeadbee;
3487 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3488 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3489 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3490 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3492 state = 0xdeadbee;
3493 action = 0xdeadbee;
3494 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3496 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3499 state = 0xdeadbee;
3500 action = 0xdeadbee;
3501 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3503 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3504 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3506 state = 0xdeadbee;
3507 action = 0xdeadbee;
3508 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3510 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3511 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3513 state = 0xdeadbee;
3514 action = 0xdeadbee;
3515 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3517 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3520 state = 0xdeadbee;
3521 action = 0xdeadbee;
3522 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3524 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3525 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3527 state = 0xdeadbee;
3528 action = 0xdeadbee;
3529 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3531 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3532 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3534 state = 0xdeadbee;
3535 action = 0xdeadbee;
3536 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3538 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3539 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3541 state = 0xdeadbee;
3542 action = 0xdeadbee;
3543 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3545 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3546 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3548 r = MsiDoAction( hpkg, "FileCost");
3549 ok( r == ERROR_SUCCESS, "file cost failed\n");
3551 state = 0xdeadbee;
3552 action = 0xdeadbee;
3553 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3554 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3555 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3556 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3558 state = 0xdeadbee;
3559 action = 0xdeadbee;
3560 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3561 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3562 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3563 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3565 state = 0xdeadbee;
3566 action = 0xdeadbee;
3567 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3568 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3569 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3570 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3572 state = 0xdeadbee;
3573 action = 0xdeadbee;
3574 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3575 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3576 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3577 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3579 state = 0xdeadbee;
3580 action = 0xdeadbee;
3581 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3582 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3583 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3584 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3586 state = 0xdeadbee;
3587 action = 0xdeadbee;
3588 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3590 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3591 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3593 state = 0xdeadbee;
3594 action = 0xdeadbee;
3595 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3597 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3598 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3600 state = 0xdeadbee;
3601 action = 0xdeadbee;
3602 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3604 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3605 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3607 state = 0xdeadbee;
3608 action = 0xdeadbee;
3609 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3611 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3612 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3614 state = 0xdeadbee;
3615 action = 0xdeadbee;
3616 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3618 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3619 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3621 state = 0xdeadbee;
3622 action = 0xdeadbee;
3623 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3625 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3626 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3628 state = 0xdeadbee;
3629 action = 0xdeadbee;
3630 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3632 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3633 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3635 state = 0xdeadbee;
3636 action = 0xdeadbee;
3637 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3639 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3640 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3642 state = 0xdeadbee;
3643 action = 0xdeadbee;
3644 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3646 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3647 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3649 state = 0xdeadbee;
3650 action = 0xdeadbee;
3651 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3653 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3654 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3656 state = 0xdeadbee;
3657 action = 0xdeadbee;
3658 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3660 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3661 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3663 state = 0xdeadbee;
3664 action = 0xdeadbee;
3665 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3666 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3667 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3668 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3670 state = 0xdeadbee;
3671 action = 0xdeadbee;
3672 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3674 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3675 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3677 state = 0xdeadbee;
3678 action = 0xdeadbee;
3679 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3681 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3682 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3684 state = 0xdeadbee;
3685 action = 0xdeadbee;
3686 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3688 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3689 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3691 state = 0xdeadbee;
3692 action = 0xdeadbee;
3693 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3695 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3696 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3698 state = 0xdeadbee;
3699 action = 0xdeadbee;
3700 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3702 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3703 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3705 state = 0xdeadbee;
3706 action = 0xdeadbee;
3707 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3709 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3710 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3712 state = 0xdeadbee;
3713 action = 0xdeadbee;
3714 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3716 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3717 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3719 state = 0xdeadbee;
3720 action = 0xdeadbee;
3721 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3723 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3724 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3726 r = MsiDoAction( hpkg, "CostFinalize");
3727 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3729 state = 0xdeadbee;
3730 action = 0xdeadbee;
3731 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3732 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3733 todo_wine
3735 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3737 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3739 state = 0xdeadbee;
3740 action = 0xdeadbee;
3741 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3743 todo_wine
3745 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3747 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3749 state = 0xdeadbee;
3750 action = 0xdeadbee;
3751 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3752 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3753 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3754 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3756 state = 0xdeadbee;
3757 action = 0xdeadbee;
3758 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3759 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3760 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3761 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3763 state = 0xdeadbee;
3764 action = 0xdeadbee;
3765 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3766 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3767 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3768 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3770 state = 0xdeadbee;
3771 action = 0xdeadbee;
3772 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3773 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3774 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3775 todo_wine
3777 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3780 state = 0xdeadbee;
3781 action = 0xdeadbee;
3782 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3784 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3785 todo_wine
3787 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3790 state = 0xdeadbee;
3791 action = 0xdeadbee;
3792 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3793 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3794 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3795 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3797 state = 0xdeadbee;
3798 action = 0xdeadbee;
3799 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3801 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3802 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3804 state = 0xdeadbee;
3805 action = 0xdeadbee;
3806 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3807 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3808 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3809 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3811 state = 0xdeadbee;
3812 action = 0xdeadbee;
3813 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3814 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3815 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3816 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3818 state = 0xdeadbee;
3819 action = 0xdeadbee;
3820 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3821 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3822 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3823 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3825 state = 0xdeadbee;
3826 action = 0xdeadbee;
3827 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3828 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3829 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3830 todo_wine
3832 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3835 state = 0xdeadbee;
3836 action = 0xdeadbee;
3837 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3838 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3839 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3840 todo_wine
3842 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3845 state = 0xdeadbee;
3846 action = 0xdeadbee;
3847 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3849 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3850 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3852 state = 0xdeadbee;
3853 action = 0xdeadbee;
3854 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3856 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3857 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3859 state = 0xdeadbee;
3860 action = 0xdeadbee;
3861 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3863 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3864 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3866 state = 0xdeadbee;
3867 action = 0xdeadbee;
3868 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3870 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3871 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3873 state = 0xdeadbee;
3874 action = 0xdeadbee;
3875 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3877 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3878 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3880 state = 0xdeadbee;
3881 action = 0xdeadbee;
3882 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3883 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3884 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3885 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3887 state = 0xdeadbee;
3888 action = 0xdeadbee;
3889 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3890 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3891 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3892 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3894 state = 0xdeadbee;
3895 action = 0xdeadbee;
3896 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3897 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3898 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3899 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3901 state = 0xdeadbee;
3902 action = 0xdeadbee;
3903 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3904 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3905 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3906 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3908 state = 0xdeadbee;
3909 action = 0xdeadbee;
3910 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3911 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3912 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3913 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3915 state = 0xdeadbee;
3916 action = 0xdeadbee;
3917 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3918 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3919 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3920 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3922 MsiCloseHandle(hpkg);
3924 /* uninstall the product */
3925 r = MsiInstallProduct(msifile, "REMOVE=ALL");
3926 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3928 /* all features installed locally */
3929 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
3930 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3932 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
3933 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3935 /* these properties must not be in the saved msi file */
3936 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven'");
3937 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3939 hpkg = package_from_db( hdb );
3940 ok( hpkg, "failed to create package\n");
3942 state = 0xdeadbee;
3943 action = 0xdeadbee;
3944 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3945 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3946 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3947 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3949 state = 0xdeadbee;
3950 action = 0xdeadbee;
3951 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3952 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3953 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3954 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3956 state = 0xdeadbee;
3957 action = 0xdeadbee;
3958 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3959 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3960 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3961 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3963 state = 0xdeadbee;
3964 action = 0xdeadbee;
3965 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3966 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3967 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3968 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3970 state = 0xdeadbee;
3971 action = 0xdeadbee;
3972 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3973 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3974 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3975 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3977 state = 0xdeadbee;
3978 action = 0xdeadbee;
3979 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3980 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3981 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3982 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3984 state = 0xdeadbee;
3985 action = 0xdeadbee;
3986 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3987 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3988 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3989 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3991 state = 0xdeadbee;
3992 action = 0xdeadbee;
3993 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3994 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3995 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3996 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3998 state = 0xdeadbee;
3999 action = 0xdeadbee;
4000 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4001 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4002 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4003 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4005 state = 0xdeadbee;
4006 action = 0xdeadbee;
4007 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4008 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4009 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4010 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4012 state = 0xdeadbee;
4013 action = 0xdeadbee;
4014 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4015 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4016 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4017 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4019 state = 0xdeadbee;
4020 action = 0xdeadbee;
4021 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4022 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4023 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4024 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4026 state = 0xdeadbee;
4027 action = 0xdeadbee;
4028 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4029 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4030 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4031 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4033 state = 0xdeadbee;
4034 action = 0xdeadbee;
4035 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4036 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4037 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4038 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4040 state = 0xdeadbee;
4041 action = 0xdeadbee;
4042 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4043 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4044 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4045 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4047 state = 0xdeadbee;
4048 action = 0xdeadbee;
4049 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4050 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4051 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4052 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4054 state = 0xdeadbee;
4055 action = 0xdeadbee;
4056 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4057 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4058 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4059 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4061 state = 0xdeadbee;
4062 action = 0xdeadbee;
4063 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4064 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4065 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4066 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4068 state = 0xdeadbee;
4069 action = 0xdeadbee;
4070 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4071 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4072 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4073 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4075 state = 0xdeadbee;
4076 action = 0xdeadbee;
4077 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4078 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4079 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4080 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4082 state = 0xdeadbee;
4083 action = 0xdeadbee;
4084 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4085 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4086 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4087 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4089 state = 0xdeadbee;
4090 action = 0xdeadbee;
4091 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4092 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4093 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4094 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4096 state = 0xdeadbee;
4097 action = 0xdeadbee;
4098 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4099 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4100 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4101 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4103 state = 0xdeadbee;
4104 action = 0xdeadbee;
4105 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4106 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4107 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4108 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4110 state = 0xdeadbee;
4111 action = 0xdeadbee;
4112 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4113 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4114 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4115 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4117 r = MsiDoAction( hpkg, "CostInitialize");
4118 ok( r == ERROR_SUCCESS, "cost init failed\n");
4120 state = 0xdeadbee;
4121 action = 0xdeadbee;
4122 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4123 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4124 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4125 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4127 state = 0xdeadbee;
4128 action = 0xdeadbee;
4129 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4130 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4131 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4132 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4134 state = 0xdeadbee;
4135 action = 0xdeadbee;
4136 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4137 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4138 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4139 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4141 state = 0xdeadbee;
4142 action = 0xdeadbee;
4143 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4145 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4146 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4148 state = 0xdeadbee;
4149 action = 0xdeadbee;
4150 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4151 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4152 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4153 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4155 state = 0xdeadbee;
4156 action = 0xdeadbee;
4157 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4162 state = 0xdeadbee;
4163 action = 0xdeadbee;
4164 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4169 state = 0xdeadbee;
4170 action = 0xdeadbee;
4171 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4176 state = 0xdeadbee;
4177 action = 0xdeadbee;
4178 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4183 state = 0xdeadbee;
4184 action = 0xdeadbee;
4185 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4190 state = 0xdeadbee;
4191 action = 0xdeadbee;
4192 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4197 state = 0xdeadbee;
4198 action = 0xdeadbee;
4199 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4204 state = 0xdeadbee;
4205 action = 0xdeadbee;
4206 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4211 state = 0xdeadbee;
4212 action = 0xdeadbee;
4213 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4218 state = 0xdeadbee;
4219 action = 0xdeadbee;
4220 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4225 state = 0xdeadbee;
4226 action = 0xdeadbee;
4227 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4232 state = 0xdeadbee;
4233 action = 0xdeadbee;
4234 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4239 state = 0xdeadbee;
4240 action = 0xdeadbee;
4241 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4246 state = 0xdeadbee;
4247 action = 0xdeadbee;
4248 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4253 state = 0xdeadbee;
4254 action = 0xdeadbee;
4255 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4260 state = 0xdeadbee;
4261 action = 0xdeadbee;
4262 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4267 state = 0xdeadbee;
4268 action = 0xdeadbee;
4269 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4274 state = 0xdeadbee;
4275 action = 0xdeadbee;
4276 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4281 state = 0xdeadbee;
4282 action = 0xdeadbee;
4283 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4288 state = 0xdeadbee;
4289 action = 0xdeadbee;
4290 r = MsiGetComponentState(hpkg, "sigma", &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 r = MsiDoAction( hpkg, "FileCost");
4296 ok( r == ERROR_SUCCESS, "file cost failed\n");
4298 state = 0xdeadbee;
4299 action = 0xdeadbee;
4300 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4301 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4302 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4303 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4305 state = 0xdeadbee;
4306 action = 0xdeadbee;
4307 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4308 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4309 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4310 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4312 state = 0xdeadbee;
4313 action = 0xdeadbee;
4314 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4315 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4316 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4317 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4319 state = 0xdeadbee;
4320 action = 0xdeadbee;
4321 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4322 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4323 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4324 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4326 state = 0xdeadbee;
4327 action = 0xdeadbee;
4328 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4329 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4330 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4331 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4333 state = 0xdeadbee;
4334 action = 0xdeadbee;
4335 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4336 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4337 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4338 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4340 state = 0xdeadbee;
4341 action = 0xdeadbee;
4342 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4343 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4344 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4345 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4347 state = 0xdeadbee;
4348 action = 0xdeadbee;
4349 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4350 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4351 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4352 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4354 state = 0xdeadbee;
4355 action = 0xdeadbee;
4356 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4358 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4359 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4361 state = 0xdeadbee;
4362 action = 0xdeadbee;
4363 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4368 state = 0xdeadbee;
4369 action = 0xdeadbee;
4370 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4375 state = 0xdeadbee;
4376 action = 0xdeadbee;
4377 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4382 state = 0xdeadbee;
4383 action = 0xdeadbee;
4384 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4389 state = 0xdeadbee;
4390 action = 0xdeadbee;
4391 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4396 state = 0xdeadbee;
4397 action = 0xdeadbee;
4398 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4403 state = 0xdeadbee;
4404 action = 0xdeadbee;
4405 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4410 state = 0xdeadbee;
4411 action = 0xdeadbee;
4412 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4414 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4417 state = 0xdeadbee;
4418 action = 0xdeadbee;
4419 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4421 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4424 state = 0xdeadbee;
4425 action = 0xdeadbee;
4426 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4428 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4431 state = 0xdeadbee;
4432 action = 0xdeadbee;
4433 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4435 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4438 state = 0xdeadbee;
4439 action = 0xdeadbee;
4440 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4442 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4445 state = 0xdeadbee;
4446 action = 0xdeadbee;
4447 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4449 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4452 state = 0xdeadbee;
4453 action = 0xdeadbee;
4454 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4456 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4459 state = 0xdeadbee;
4460 action = 0xdeadbee;
4461 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4463 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4466 state = 0xdeadbee;
4467 action = 0xdeadbee;
4468 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4470 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4473 r = MsiDoAction( hpkg, "CostFinalize");
4474 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4476 state = 0xdeadbee;
4477 action = 0xdeadbee;
4478 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4479 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4480 todo_wine
4482 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4484 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4486 state = 0xdeadbee;
4487 action = 0xdeadbee;
4488 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4489 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4490 todo_wine
4492 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4494 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4496 state = 0xdeadbee;
4497 action = 0xdeadbee;
4498 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4500 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4501 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4503 state = 0xdeadbee;
4504 action = 0xdeadbee;
4505 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4507 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4508 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4510 state = 0xdeadbee;
4511 action = 0xdeadbee;
4512 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4514 todo_wine
4516 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4517 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4520 state = 0xdeadbee;
4521 action = 0xdeadbee;
4522 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4524 todo_wine
4526 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4528 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4530 state = 0xdeadbee;
4531 action = 0xdeadbee;
4532 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4534 todo_wine
4536 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4538 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4540 state = 0xdeadbee;
4541 action = 0xdeadbee;
4542 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4543 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4544 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4545 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4547 state = 0xdeadbee;
4548 action = 0xdeadbee;
4549 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4550 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4551 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4552 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4554 state = 0xdeadbee;
4555 action = 0xdeadbee;
4556 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4557 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4558 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4559 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4561 state = 0xdeadbee;
4562 action = 0xdeadbee;
4563 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4564 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4565 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4566 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4568 state = 0xdeadbee;
4569 action = 0xdeadbee;
4570 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4571 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4572 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4573 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4575 state = 0xdeadbee;
4576 action = 0xdeadbee;
4577 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4578 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4579 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4580 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4582 state = 0xdeadbee;
4583 action = 0xdeadbee;
4584 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4585 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4586 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4587 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4589 state = 0xdeadbee;
4590 action = 0xdeadbee;
4591 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4593 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4594 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4596 state = 0xdeadbee;
4597 action = 0xdeadbee;
4598 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4599 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4600 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4601 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4603 state = 0xdeadbee;
4604 action = 0xdeadbee;
4605 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4606 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4607 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4608 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4610 state = 0xdeadbee;
4611 action = 0xdeadbee;
4612 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4614 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4615 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4617 state = 0xdeadbee;
4618 action = 0xdeadbee;
4619 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4621 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4622 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4624 state = 0xdeadbee;
4625 action = 0xdeadbee;
4626 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4627 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4628 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4629 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4631 state = 0xdeadbee;
4632 action = 0xdeadbee;
4633 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4634 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4635 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4636 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4638 state = 0xdeadbee;
4639 action = 0xdeadbee;
4640 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4642 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4643 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4645 state = 0xdeadbee;
4646 action = 0xdeadbee;
4647 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4649 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4650 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4652 state = 0xdeadbee;
4653 action = 0xdeadbee;
4654 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4655 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4656 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4657 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4659 state = 0xdeadbee;
4660 action = 0xdeadbee;
4661 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4663 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4664 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4666 MsiCloseHandle(hpkg);
4668 /* uninstall the product */
4669 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
4670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4672 /* all features installed from source */
4673 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
4674 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4676 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
4677 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4679 /* this property must not be in the saved msi file */
4680 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven'");
4681 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4683 hpkg = package_from_db( hdb );
4684 ok( hpkg, "failed to create package\n");
4686 state = 0xdeadbee;
4687 action = 0xdeadbee;
4688 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4689 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4690 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4691 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4693 state = 0xdeadbee;
4694 action = 0xdeadbee;
4695 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4696 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4697 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4698 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4700 state = 0xdeadbee;
4701 action = 0xdeadbee;
4702 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4703 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4704 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4705 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4707 state = 0xdeadbee;
4708 action = 0xdeadbee;
4709 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4710 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4711 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4712 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4714 state = 0xdeadbee;
4715 action = 0xdeadbee;
4716 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4717 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4718 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4719 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4721 state = 0xdeadbee;
4722 action = 0xdeadbee;
4723 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4724 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4725 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4726 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4728 state = 0xdeadbee;
4729 action = 0xdeadbee;
4730 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4731 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4732 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4733 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4735 state = 0xdeadbee;
4736 action = 0xdeadbee;
4737 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4738 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4739 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4740 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4742 state = 0xdeadbee;
4743 action = 0xdeadbee;
4744 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4745 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4746 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4747 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4749 state = 0xdeadbee;
4750 action = 0xdeadbee;
4751 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4752 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4753 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4754 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4756 state = 0xdeadbee;
4757 action = 0xdeadbee;
4758 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4759 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4760 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4761 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4763 state = 0xdeadbee;
4764 action = 0xdeadbee;
4765 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4766 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4767 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4768 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4770 state = 0xdeadbee;
4771 action = 0xdeadbee;
4772 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4773 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4774 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4775 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4777 state = 0xdeadbee;
4778 action = 0xdeadbee;
4779 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4780 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4781 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4782 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4784 state = 0xdeadbee;
4785 action = 0xdeadbee;
4786 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4787 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4788 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4789 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4791 state = 0xdeadbee;
4792 action = 0xdeadbee;
4793 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4794 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4795 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4796 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4798 state = 0xdeadbee;
4799 action = 0xdeadbee;
4800 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4801 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4802 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4803 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4805 state = 0xdeadbee;
4806 action = 0xdeadbee;
4807 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4808 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4809 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4810 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4812 state = 0xdeadbee;
4813 action = 0xdeadbee;
4814 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4815 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4816 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4817 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4819 state = 0xdeadbee;
4820 action = 0xdeadbee;
4821 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4822 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4823 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4824 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4826 state = 0xdeadbee;
4827 action = 0xdeadbee;
4828 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4829 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4830 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4831 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4833 state = 0xdeadbee;
4834 action = 0xdeadbee;
4835 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4836 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4837 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4838 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4840 state = 0xdeadbee;
4841 action = 0xdeadbee;
4842 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4843 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4844 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4845 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4847 state = 0xdeadbee;
4848 action = 0xdeadbee;
4849 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4850 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4851 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4852 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4854 state = 0xdeadbee;
4855 action = 0xdeadbee;
4856 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4857 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4858 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4859 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4861 r = MsiDoAction( hpkg, "CostInitialize");
4862 ok( r == ERROR_SUCCESS, "cost init failed\n");
4864 state = 0xdeadbee;
4865 action = 0xdeadbee;
4866 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4868 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4869 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4871 state = 0xdeadbee;
4872 action = 0xdeadbee;
4873 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4874 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4875 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4876 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4878 state = 0xdeadbee;
4879 action = 0xdeadbee;
4880 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4881 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4882 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4883 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4885 state = 0xdeadbee;
4886 action = 0xdeadbee;
4887 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4888 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4889 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4890 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4892 state = 0xdeadbee;
4893 action = 0xdeadbee;
4894 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4895 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4896 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4897 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4899 state = 0xdeadbee;
4900 action = 0xdeadbee;
4901 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4903 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4904 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4906 state = 0xdeadbee;
4907 action = 0xdeadbee;
4908 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4910 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4911 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4913 state = 0xdeadbee;
4914 action = 0xdeadbee;
4915 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4917 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4918 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4920 state = 0xdeadbee;
4921 action = 0xdeadbee;
4922 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4923 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4924 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4925 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4927 state = 0xdeadbee;
4928 action = 0xdeadbee;
4929 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4930 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4931 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4932 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4934 state = 0xdeadbee;
4935 action = 0xdeadbee;
4936 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4937 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4938 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4939 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4941 state = 0xdeadbee;
4942 action = 0xdeadbee;
4943 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4944 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4945 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4946 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4948 state = 0xdeadbee;
4949 action = 0xdeadbee;
4950 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4951 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4952 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4953 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4955 state = 0xdeadbee;
4956 action = 0xdeadbee;
4957 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4958 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4959 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4960 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4962 state = 0xdeadbee;
4963 action = 0xdeadbee;
4964 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4965 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4966 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4967 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4969 state = 0xdeadbee;
4970 action = 0xdeadbee;
4971 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4972 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4973 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4974 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4976 state = 0xdeadbee;
4977 action = 0xdeadbee;
4978 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4979 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4980 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4981 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4983 state = 0xdeadbee;
4984 action = 0xdeadbee;
4985 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4986 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4987 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4988 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4990 state = 0xdeadbee;
4991 action = 0xdeadbee;
4992 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4993 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4994 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4995 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4997 state = 0xdeadbee;
4998 action = 0xdeadbee;
4999 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5000 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5001 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5002 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5004 state = 0xdeadbee;
5005 action = 0xdeadbee;
5006 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5007 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5008 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5009 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5011 state = 0xdeadbee;
5012 action = 0xdeadbee;
5013 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5014 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5015 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5016 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5018 state = 0xdeadbee;
5019 action = 0xdeadbee;
5020 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5021 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5022 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5023 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5025 state = 0xdeadbee;
5026 action = 0xdeadbee;
5027 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5029 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5030 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5032 state = 0xdeadbee;
5033 action = 0xdeadbee;
5034 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5035 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5036 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5037 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5039 r = MsiDoAction( hpkg, "FileCost");
5040 ok( r == ERROR_SUCCESS, "file cost failed\n");
5042 state = 0xdeadbee;
5043 action = 0xdeadbee;
5044 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5049 state = 0xdeadbee;
5050 action = 0xdeadbee;
5051 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5056 state = 0xdeadbee;
5057 action = 0xdeadbee;
5058 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5060 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5061 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5063 state = 0xdeadbee;
5064 action = 0xdeadbee;
5065 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5067 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5068 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5070 state = 0xdeadbee;
5071 action = 0xdeadbee;
5072 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5074 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5075 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5077 state = 0xdeadbee;
5078 action = 0xdeadbee;
5079 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5081 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5082 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5084 state = 0xdeadbee;
5085 action = 0xdeadbee;
5086 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5088 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5089 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5091 state = 0xdeadbee;
5092 action = 0xdeadbee;
5093 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5095 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5096 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5098 state = 0xdeadbee;
5099 action = 0xdeadbee;
5100 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5102 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5103 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5105 state = 0xdeadbee;
5106 action = 0xdeadbee;
5107 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5109 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5112 state = 0xdeadbee;
5113 action = 0xdeadbee;
5114 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5116 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5119 state = 0xdeadbee;
5120 action = 0xdeadbee;
5121 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5123 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5126 state = 0xdeadbee;
5127 action = 0xdeadbee;
5128 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5130 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5131 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5133 state = 0xdeadbee;
5134 action = 0xdeadbee;
5135 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5137 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5140 state = 0xdeadbee;
5141 action = 0xdeadbee;
5142 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5144 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5145 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5147 state = 0xdeadbee;
5148 action = 0xdeadbee;
5149 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5151 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5154 state = 0xdeadbee;
5155 action = 0xdeadbee;
5156 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5158 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5159 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5161 state = 0xdeadbee;
5162 action = 0xdeadbee;
5163 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5165 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5166 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5168 state = 0xdeadbee;
5169 action = 0xdeadbee;
5170 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5172 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5173 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5175 state = 0xdeadbee;
5176 action = 0xdeadbee;
5177 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5179 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5180 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5182 state = 0xdeadbee;
5183 action = 0xdeadbee;
5184 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5186 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5187 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5189 state = 0xdeadbee;
5190 action = 0xdeadbee;
5191 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5193 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5196 state = 0xdeadbee;
5197 action = 0xdeadbee;
5198 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5200 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5203 state = 0xdeadbee;
5204 action = 0xdeadbee;
5205 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5207 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5210 state = 0xdeadbee;
5211 action = 0xdeadbee;
5212 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5214 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5217 r = MsiDoAction( hpkg, "CostFinalize");
5218 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5220 state = 0xdeadbee;
5221 action = 0xdeadbee;
5222 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5224 todo_wine
5226 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5227 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5230 state = 0xdeadbee;
5231 action = 0xdeadbee;
5232 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5233 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5234 todo_wine
5236 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5237 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5240 state = 0xdeadbee;
5241 action = 0xdeadbee;
5242 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5243 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5244 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5245 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5247 state = 0xdeadbee;
5248 action = 0xdeadbee;
5249 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5250 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5251 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5252 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5254 state = 0xdeadbee;
5255 action = 0xdeadbee;
5256 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5257 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5258 todo_wine
5260 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5261 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5264 state = 0xdeadbee;
5265 action = 0xdeadbee;
5266 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5268 todo_wine
5270 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5271 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5274 state = 0xdeadbee;
5275 action = 0xdeadbee;
5276 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5278 todo_wine
5280 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5281 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5284 state = 0xdeadbee;
5285 action = 0xdeadbee;
5286 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5287 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5288 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5289 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5291 state = 0xdeadbee;
5292 action = 0xdeadbee;
5293 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5294 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5295 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5296 todo_wine
5298 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5301 state = 0xdeadbee;
5302 action = 0xdeadbee;
5303 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5305 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5306 todo_wine
5308 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5311 state = 0xdeadbee;
5312 action = 0xdeadbee;
5313 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5314 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5315 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5316 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5318 state = 0xdeadbee;
5319 action = 0xdeadbee;
5320 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5321 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5322 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5323 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5325 state = 0xdeadbee;
5326 action = 0xdeadbee;
5327 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5328 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5329 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5330 todo_wine
5332 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5335 state = 0xdeadbee;
5336 action = 0xdeadbee;
5337 r = MsiGetComponentState(hpkg, "zeta", &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 todo_wine
5342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5345 state = 0xdeadbee;
5346 action = 0xdeadbee;
5347 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5348 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5349 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5350 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5352 state = 0xdeadbee;
5353 action = 0xdeadbee;
5354 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5356 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5357 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5359 state = 0xdeadbee;
5360 action = 0xdeadbee;
5361 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5363 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5366 state = 0xdeadbee;
5367 action = 0xdeadbee;
5368 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5370 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5371 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5373 state = 0xdeadbee;
5374 action = 0xdeadbee;
5375 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5377 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5378 todo_wine
5380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5383 state = 0xdeadbee;
5384 action = 0xdeadbee;
5385 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5386 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5387 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5388 todo_wine
5390 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5393 state = 0xdeadbee;
5394 action = 0xdeadbee;
5395 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5397 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5398 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5400 state = 0xdeadbee;
5401 action = 0xdeadbee;
5402 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5404 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5405 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5407 state = 0xdeadbee;
5408 action = 0xdeadbee;
5409 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5411 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5412 todo_wine
5414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5417 state = 0xdeadbee;
5418 action = 0xdeadbee;
5419 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5421 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5422 todo_wine
5424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5427 state = 0xdeadbee;
5428 action = 0xdeadbee;
5429 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5430 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5431 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5432 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5434 MsiCloseHandle(hpkg);
5436 /* uninstall the product */
5437 r = MsiInstallProduct(msifile3, "REMOVE=ALL");
5438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5440 DeleteFileA(msifile);
5441 DeleteFileA(msifile2);
5442 DeleteFileA(msifile3);
5445 static void test_getproperty(void)
5447 MSIHANDLE hPackage = 0;
5448 char prop[100];
5449 static CHAR empty[] = "";
5450 DWORD size;
5451 UINT r;
5453 hPackage = package_from_db(create_package_db());
5454 ok( hPackage != 0, " Failed to create package\n");
5456 /* set the property */
5457 r = MsiSetProperty(hPackage, "Name", "Value");
5458 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5460 /* retrieve the size, NULL pointer */
5461 size = 0;
5462 r = MsiGetProperty(hPackage, "Name", NULL, &size);
5463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5464 ok( size == 5, "Expected 5, got %d\n", size);
5466 /* retrieve the size, empty string */
5467 size = 0;
5468 r = MsiGetProperty(hPackage, "Name", empty, &size);
5469 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5470 ok( size == 5, "Expected 5, got %d\n", size);
5472 /* don't change size */
5473 r = MsiGetProperty(hPackage, "Name", prop, &size);
5474 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
5475 ok( size == 5, "Expected 5, got %d\n", size);
5476 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
5478 /* increase the size by 1 */
5479 size++;
5480 r = MsiGetProperty(hPackage, "Name", prop, &size);
5481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5482 ok( size == 5, "Expected 5, got %d\n", size);
5483 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
5485 r = MsiCloseHandle( hPackage);
5486 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
5487 DeleteFile(msifile);
5490 static void test_removefiles(void)
5492 MSIHANDLE hpkg;
5493 UINT r;
5494 MSIHANDLE hdb;
5496 hdb = create_package_db();
5497 ok ( hdb, "failed to create package database\n" );
5499 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
5500 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
5502 r = create_feature_table( hdb );
5503 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
5505 r = create_component_table( hdb );
5506 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
5508 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
5509 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5511 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
5512 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5514 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
5515 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5517 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
5518 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5520 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
5521 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5523 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
5524 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5526 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
5527 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5529 r = create_feature_components_table( hdb );
5530 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
5532 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
5533 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5535 r = add_feature_components_entry( hdb, "'one', 'helium'" );
5536 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5538 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
5539 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5541 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
5542 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5544 r = add_feature_components_entry( hdb, "'one', 'boron'" );
5545 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5547 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
5548 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5550 r = create_file_table( hdb );
5551 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
5553 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
5554 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5556 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
5557 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5559 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
5560 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5562 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
5563 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5565 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
5566 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5568 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
5569 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5571 r = create_remove_file_table( hdb );
5572 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
5574 hpkg = package_from_db( hdb );
5575 ok( hpkg, "failed to create package\n");
5577 MsiCloseHandle( hdb );
5579 create_test_file( "hydrogen.txt" );
5580 create_test_file( "helium.txt" );
5581 create_test_file( "lithium.txt" );
5582 create_test_file( "beryllium.txt" );
5583 create_test_file( "boron.txt" );
5584 create_test_file( "carbon.txt" );
5586 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
5587 ok( r == ERROR_SUCCESS, "set property failed\n");
5589 r = MsiDoAction( hpkg, "CostInitialize");
5590 ok( r == ERROR_SUCCESS, "cost init failed\n");
5592 r = MsiDoAction( hpkg, "FileCost");
5593 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5595 r = MsiDoAction( hpkg, "CostFinalize");
5596 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5598 r = MsiDoAction( hpkg, "InstallValidate");
5599 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5601 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
5602 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5604 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
5605 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5607 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
5608 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5610 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
5611 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5613 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
5614 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5616 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
5617 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
5619 r = MsiDoAction( hpkg, "RemoveFiles");
5620 ok( r == ERROR_SUCCESS, "remove files failed\n");
5622 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
5623 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
5624 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
5625 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
5626 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
5627 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
5629 MsiCloseHandle( hpkg );
5630 DeleteFileA(msifile);
5633 static void test_appsearch(void)
5635 MSIHANDLE hpkg;
5636 UINT r;
5637 MSIHANDLE hdb;
5638 CHAR prop[MAX_PATH];
5639 DWORD size = MAX_PATH;
5641 hdb = create_package_db();
5642 ok ( hdb, "failed to create package database\n" );
5644 r = create_appsearch_table( hdb );
5645 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
5647 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
5648 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
5650 r = create_reglocator_table( hdb );
5651 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5653 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
5654 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
5656 r = create_signature_table( hdb );
5657 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5659 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
5660 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
5662 hpkg = package_from_db( hdb );
5663 ok( hpkg, "failed to create package\n");
5665 MsiCloseHandle( hdb );
5667 r = MsiDoAction( hpkg, "AppSearch" );
5668 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
5670 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
5671 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
5672 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
5674 MsiCloseHandle( hpkg );
5675 DeleteFileA(msifile);
5678 static void test_featureparents(void)
5680 MSIHANDLE hpkg;
5681 UINT r;
5682 MSIHANDLE hdb;
5683 INSTALLSTATE state, action;
5685 hdb = create_package_db();
5686 ok ( hdb, "failed to create package database\n" );
5688 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
5689 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
5691 r = create_feature_table( hdb );
5692 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
5694 r = create_component_table( hdb );
5695 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
5697 r = create_feature_components_table( hdb );
5698 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
5700 r = create_file_table( hdb );
5701 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
5703 /* msidbFeatureAttributesFavorLocal */
5704 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
5705 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5707 /* msidbFeatureAttributesFavorSource */
5708 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
5709 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5711 /* msidbFeatureAttributesFavorLocal */
5712 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
5713 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5715 /* disabled because of install level */
5716 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
5717 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5719 /* child feature of disabled feature */
5720 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
5721 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
5723 /* component of disabled feature (install level) */
5724 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
5725 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5727 /* component of disabled child feature (install level) */
5728 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
5729 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5731 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5732 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
5733 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5735 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5736 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
5737 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5739 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5740 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
5741 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5743 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
5744 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
5745 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5747 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
5748 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
5749 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5751 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
5752 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
5753 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5755 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5756 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
5757 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5759 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5760 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
5761 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
5763 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5764 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
5766 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
5767 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5769 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
5770 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5772 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
5773 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5775 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
5776 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5778 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
5779 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5781 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
5782 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5784 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
5785 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5787 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
5788 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5790 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
5791 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5793 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
5794 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5796 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
5797 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5799 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
5800 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5802 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
5803 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5805 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
5806 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5808 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
5809 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5811 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
5812 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5814 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
5815 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
5817 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
5818 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5820 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
5821 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5823 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
5824 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5826 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
5827 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5829 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
5830 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5832 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
5833 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5835 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
5836 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5838 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
5839 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5841 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
5842 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5844 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
5845 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5847 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
5848 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
5850 hpkg = package_from_db( hdb );
5851 ok( hpkg, "failed to create package\n");
5853 MsiCloseHandle( hdb );
5855 r = MsiDoAction( hpkg, "CostInitialize");
5856 ok( r == ERROR_SUCCESS, "cost init failed\n");
5858 r = MsiDoAction( hpkg, "FileCost");
5859 ok( r == ERROR_SUCCESS, "file cost failed\n");
5861 r = MsiDoAction( hpkg, "CostFinalize");
5862 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
5864 state = 0xdeadbee;
5865 action = 0xdeadbee;
5866 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
5867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5868 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5869 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5871 state = 0xdeadbee;
5872 action = 0xdeadbee;
5873 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
5874 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5875 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5876 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5878 state = 0xdeadbee;
5879 action = 0xdeadbee;
5880 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
5881 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5882 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5883 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5885 state = 0xdeadbee;
5886 action = 0xdeadbee;
5887 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
5888 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5889 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5890 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5892 state = 0xdeadbee;
5893 action = 0xdeadbee;
5894 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
5895 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5896 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5897 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5899 state = 0xdeadbee;
5900 action = 0xdeadbee;
5901 r = MsiGetComponentState(hpkg, "leo", &state, &action);
5902 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5903 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5904 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5906 state = 0xdeadbee;
5907 action = 0xdeadbee;
5908 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
5909 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5910 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
5911 todo_wine
5913 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
5916 state = 0xdeadbee;
5917 action = 0xdeadbee;
5918 r = MsiGetComponentState(hpkg, "libra", &state, &action);
5919 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5920 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
5921 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
5923 state = 0xdeadbee;
5924 action = 0xdeadbee;
5925 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
5926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5927 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
5928 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
5930 state = 0xdeadbee;
5931 action = 0xdeadbee;
5932 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
5933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5934 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
5935 todo_wine
5937 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
5940 state = 0xdeadbee;
5941 action = 0xdeadbee;
5942 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
5943 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5944 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
5945 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
5947 state = 0xdeadbee;
5948 action = 0xdeadbee;
5949 r = MsiGetComponentState(hpkg, "canis", &state, &action);
5950 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5951 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
5952 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
5954 state = 0xdeadbee;
5955 action = 0xdeadbee;
5956 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
5957 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5958 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
5959 todo_wine
5961 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
5964 state = 0xdeadbee;
5965 action = 0xdeadbee;
5966 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
5967 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5968 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
5969 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
5971 state = 0xdeadbee;
5972 action = 0xdeadbee;
5973 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
5974 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5975 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
5976 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
5978 state = 0xdeadbee;
5979 action = 0xdeadbee;
5980 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
5981 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5982 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
5983 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
5985 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
5986 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
5988 state = 0xdeadbee;
5989 action = 0xdeadbee;
5990 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
5991 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5992 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
5993 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
5995 state = 0xdeadbee;
5996 action = 0xdeadbee;
5997 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
5998 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5999 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
6000 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
6002 state = 0xdeadbee;
6003 action = 0xdeadbee;
6004 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
6005 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6006 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
6007 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
6009 state = 0xdeadbee;
6010 action = 0xdeadbee;
6011 r = MsiGetComponentState(hpkg, "leo", &state, &action);
6012 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6013 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
6014 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
6016 state = 0xdeadbee;
6017 action = 0xdeadbee;
6018 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
6019 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6020 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
6021 todo_wine
6023 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
6026 state = 0xdeadbee;
6027 action = 0xdeadbee;
6028 r = MsiGetComponentState(hpkg, "libra", &state, &action);
6029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6030 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
6031 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
6033 state = 0xdeadbee;
6034 action = 0xdeadbee;
6035 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
6036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6037 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
6038 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
6040 state = 0xdeadbee;
6041 action = 0xdeadbee;
6042 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
6043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6044 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
6045 todo_wine
6047 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
6050 state = 0xdeadbee;
6051 action = 0xdeadbee;
6052 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
6053 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6054 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
6055 todo_wine
6057 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
6060 state = 0xdeadbee;
6061 action = 0xdeadbee;
6062 r = MsiGetComponentState(hpkg, "canis", &state, &action);
6063 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6064 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
6065 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
6067 state = 0xdeadbee;
6068 action = 0xdeadbee;
6069 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
6070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6071 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
6072 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
6074 state = 0xdeadbee;
6075 action = 0xdeadbee;
6076 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
6077 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6078 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
6079 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
6081 state = 0xdeadbee;
6082 action = 0xdeadbee;
6083 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
6084 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6085 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
6086 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
6088 state = 0xdeadbee;
6089 action = 0xdeadbee;
6090 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
6091 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6092 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
6093 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
6095 MsiCloseHandle(hpkg);
6096 DeleteFileA(msifile);
6099 static void test_installprops(void)
6101 MSIHANDLE hpkg, hdb;
6102 CHAR path[MAX_PATH];
6103 CHAR buf[MAX_PATH];
6104 DWORD size, type;
6105 LANGID langid;
6106 HKEY hkey1, hkey2;
6107 int res;
6108 UINT r;
6110 GetCurrentDirectory(MAX_PATH, path);
6111 lstrcat(path, "\\");
6112 lstrcat(path, msifile);
6114 hdb = create_package_db();
6115 ok( hdb, "failed to create database\n");
6117 hpkg = package_from_db(hdb);
6118 ok( hpkg, "failed to create package\n");
6120 MsiCloseHandle(hdb);
6122 size = MAX_PATH;
6123 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
6124 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6125 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6127 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
6129 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2);
6131 size = MAX_PATH;
6132 type = REG_SZ;
6133 *path = '\0';
6134 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
6136 size = MAX_PATH;
6137 type = REG_SZ;
6138 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
6141 /* win9x doesn't set this */
6142 if (*path)
6144 size = MAX_PATH;
6145 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
6146 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6147 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6150 size = MAX_PATH;
6151 type = REG_SZ;
6152 *path = '\0';
6153 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
6155 size = MAX_PATH;
6156 type = REG_SZ;
6157 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
6160 if (*path)
6162 size = MAX_PATH;
6163 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
6164 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6165 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
6168 size = MAX_PATH;
6169 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
6170 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6171 trace("VersionDatabase = %s\n", buf);
6173 size = MAX_PATH;
6174 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
6175 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6176 trace("VersionMsi = %s\n", buf);
6178 size = MAX_PATH;
6179 r = MsiGetProperty(hpkg, "Date", buf, &size);
6180 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6181 trace("Date = %s\n", buf);
6183 size = MAX_PATH;
6184 r = MsiGetProperty(hpkg, "Time", buf, &size);
6185 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6186 trace("Time = %s\n", buf);
6188 size = MAX_PATH;
6189 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
6190 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
6191 trace("PackageCode = %s\n", buf);
6193 langid = GetUserDefaultLangID();
6194 sprintf(path, "%d", langid);
6196 size = MAX_PATH;
6197 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
6198 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
6199 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
6201 res = GetSystemMetrics(SM_CXSCREEN);
6202 size = MAX_PATH;
6203 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
6204 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
6206 res = GetSystemMetrics(SM_CYSCREEN);
6207 size = MAX_PATH;
6208 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
6209 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
6211 CloseHandle(hkey1);
6212 CloseHandle(hkey2);
6213 MsiCloseHandle(hpkg);
6214 DeleteFile(msifile);
6217 static void test_launchconditions(void)
6219 MSIHANDLE hpkg;
6220 MSIHANDLE hdb;
6221 UINT r;
6223 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6225 hdb = create_package_db();
6226 ok( hdb, "failed to create package database\n" );
6228 r = create_launchcondition_table( hdb );
6229 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
6231 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
6232 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
6234 /* invalid condition */
6235 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
6236 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
6238 hpkg = package_from_db( hdb );
6239 ok( hpkg, "failed to create package\n");
6241 MsiCloseHandle( hdb );
6243 r = MsiSetProperty( hpkg, "X", "1" );
6244 ok( r == ERROR_SUCCESS, "failed to set property\n" );
6246 /* invalid conditions are ignored */
6247 r = MsiDoAction( hpkg, "LaunchConditions" );
6248 ok( r == ERROR_SUCCESS, "cost init failed\n" );
6250 /* verify LaunchConditions still does some verification */
6251 r = MsiSetProperty( hpkg, "X", "2" );
6252 ok( r == ERROR_SUCCESS, "failed to set property\n" );
6254 r = MsiDoAction( hpkg, "LaunchConditions" );
6255 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
6257 MsiCloseHandle( hpkg );
6258 DeleteFile( msifile );
6261 static void test_ccpsearch(void)
6263 MSIHANDLE hdb, hpkg;
6264 CHAR prop[MAX_PATH];
6265 DWORD size = MAX_PATH;
6266 UINT r;
6268 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6270 hdb = create_package_db();
6271 ok(hdb, "failed to create package database\n");
6273 r = create_ccpsearch_table(hdb);
6274 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6276 r = add_ccpsearch_entry(hdb, "'CCP_random'");
6277 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6279 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
6280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6282 r = create_reglocator_table(hdb);
6283 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6285 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
6286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6288 r = create_drlocator_table(hdb);
6289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6291 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
6292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6294 r = create_signature_table(hdb);
6295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6297 hpkg = package_from_db(hdb);
6298 ok(hpkg, "failed to create package\n");
6300 MsiCloseHandle(hdb);
6302 r = MsiDoAction(hpkg, "CCPSearch");
6303 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6305 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
6306 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6307 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
6309 MsiCloseHandle(hpkg);
6310 DeleteFileA(msifile);
6313 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
6315 DWORD i,n=1;
6316 GUID guid;
6318 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
6319 return FALSE;
6321 for(i=0; i<8; i++)
6322 out[7-i] = in[n++];
6323 n++;
6324 for(i=0; i<4; i++)
6325 out[11-i] = in[n++];
6326 n++;
6327 for(i=0; i<4; i++)
6328 out[15-i] = in[n++];
6329 n++;
6330 for(i=0; i<2; i++)
6332 out[17+i*2] = in[n++];
6333 out[16+i*2] = in[n++];
6335 n++;
6336 for( ; i<8; i++)
6338 out[17+i*2] = in[n++];
6339 out[16+i*2] = in[n++];
6341 out[32]=0;
6342 return TRUE;
6345 static void set_component_path(LPCSTR filename, LPCSTR guid)
6347 WCHAR guidW[MAX_PATH];
6348 WCHAR squashedW[MAX_PATH];
6349 CHAR squashed[MAX_PATH];
6350 CHAR substr[MAX_PATH];
6351 CHAR path[MAX_PATH];
6352 HKEY hkey;
6354 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
6355 squash_guid(guidW, squashedW);
6356 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
6358 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6359 "Installer\\UserData\\S-1-5-18\\Components\\");
6360 lstrcatA(substr, squashed);
6362 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
6364 lstrcpyA(path, CURR_DIR);
6365 lstrcatA(path, "\\");
6366 lstrcatA(path, filename);
6368 /* just using a random squashed product code */
6369 RegSetValueExA(hkey, "7D2F387510109040002000060BECB6AB", 0,
6370 REG_SZ, (LPBYTE)path, lstrlenA(path));
6372 RegCloseKey(hkey);
6374 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6375 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
6378 static void delete_component_path(LPCSTR guid)
6380 WCHAR guidW[MAX_PATH];
6381 WCHAR squashedW[MAX_PATH];
6382 WCHAR substrW[MAX_PATH];
6383 CHAR squashed[MAX_PATH];
6384 CHAR substr[MAX_PATH];
6386 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
6387 squash_guid(guidW, squashedW);
6388 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
6390 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6391 "Installer\\UserData\\S-1-5-18\\Components\\");
6392 lstrcatA(substr, squashed);
6394 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
6395 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
6397 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6398 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
6399 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
6402 static void test_complocator(void)
6404 MSIHANDLE hdb, hpkg;
6405 UINT r;
6406 CHAR prop[MAX_PATH];
6407 CHAR expected[MAX_PATH];
6408 DWORD size = MAX_PATH;
6410 hdb = create_package_db();
6411 ok(hdb, "failed to create package database\n");
6413 r = create_appsearch_table(hdb);
6414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6416 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
6417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6419 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
6420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6422 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
6423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6425 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
6426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6428 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
6429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6431 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
6432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6434 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
6435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6437 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
6438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6440 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
6441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6443 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
6444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6446 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
6447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6449 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
6450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6452 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
6453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6455 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
6456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6458 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
6459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6461 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
6462 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6464 r = create_complocator_table(hdb);
6465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6467 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
6468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6470 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
6471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6473 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
6474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6476 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
6477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6479 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
6480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6482 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
6483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6485 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
6486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6488 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
6489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6491 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
6492 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6494 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
6495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6497 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
6498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6500 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
6501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6503 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
6504 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6506 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
6507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6509 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
6510 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6512 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
6513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6515 r = create_signature_table(hdb);
6516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6518 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
6519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6521 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
6522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6524 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
6525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6527 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
6528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6530 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
6531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6533 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
6534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6536 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
6537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6539 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
6540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6542 hpkg = package_from_db(hdb);
6543 ok(hpkg, "failed to create package\n");
6545 MsiCloseHandle(hdb);
6547 create_test_file("abelisaurus");
6548 create_test_file("bactrosaurus");
6549 create_test_file("camelotia");
6550 create_test_file("diclonius");
6551 create_test_file("echinodon");
6552 create_test_file("falcarius");
6553 create_test_file("gallimimus");
6554 create_test_file("hagryphus");
6555 CreateDirectoryA("iguanodon", NULL);
6556 CreateDirectoryA("jobaria", NULL);
6557 CreateDirectoryA("kakuru", NULL);
6558 CreateDirectoryA("labocania", NULL);
6559 CreateDirectoryA("megaraptor", NULL);
6560 CreateDirectoryA("neosodon", NULL);
6561 CreateDirectoryA("olorotitan", NULL);
6562 CreateDirectoryA("pantydraco", NULL);
6564 set_component_path("abelisaurus", "{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6565 set_component_path("bactrosaurus", "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6566 set_component_path("echinodon", "{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6567 set_component_path("falcarius", "{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6568 set_component_path("iguanodon", "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6569 set_component_path("jobaria", "{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6570 set_component_path("megaraptor", "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6571 set_component_path("neosodon", "{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6573 r = MsiDoAction(hpkg, "AppSearch");
6574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6576 size = MAX_PATH;
6577 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
6578 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6580 lstrcpyA(expected, CURR_DIR);
6581 lstrcatA(expected, "\\abelisaurus");
6582 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6583 "Expected %s or empty string, got %s\n", expected, prop);
6585 size = MAX_PATH;
6586 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
6587 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6588 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6590 size = MAX_PATH;
6591 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
6592 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6593 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6595 size = MAX_PATH;
6596 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
6597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6598 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6600 size = MAX_PATH;
6601 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
6602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6604 lstrcpyA(expected, CURR_DIR);
6605 lstrcatA(expected, "\\");
6606 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6607 "Expected %s or empty string, got %s\n", expected, prop);
6609 size = MAX_PATH;
6610 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
6611 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6612 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6614 size = MAX_PATH;
6615 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
6616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6617 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6619 size = MAX_PATH;
6620 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
6621 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6622 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6624 size = MAX_PATH;
6625 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
6626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6627 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6629 size = MAX_PATH;
6630 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
6631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6632 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6634 size = MAX_PATH;
6635 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
6636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6637 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6639 size = MAX_PATH;
6640 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
6641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6642 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6644 size = MAX_PATH;
6645 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
6646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6648 lstrcpyA(expected, CURR_DIR);
6649 lstrcatA(expected, "\\");
6650 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6651 "Expected %s or empty string, got %s\n", expected, prop);
6653 size = MAX_PATH;
6654 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
6655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6657 lstrcpyA(expected, CURR_DIR);
6658 lstrcatA(expected, "\\neosodon\\");
6659 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
6660 "Expected %s or empty string, got %s\n", expected, prop);
6662 size = MAX_PATH;
6663 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
6664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6665 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6667 size = MAX_PATH;
6668 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
6669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6670 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
6672 MsiCloseHandle(hpkg);
6673 DeleteFileA("abelisaurus");
6674 DeleteFileA("bactrosaurus");
6675 DeleteFileA("camelotia");
6676 DeleteFileA("diclonius");
6677 DeleteFileA("echinodon");
6678 DeleteFileA("falcarius");
6679 DeleteFileA("gallimimus");
6680 DeleteFileA("hagryphus");
6681 RemoveDirectoryA("iguanodon");
6682 RemoveDirectoryA("jobaria");
6683 RemoveDirectoryA("kakuru");
6684 RemoveDirectoryA("labocania");
6685 RemoveDirectoryA("megaraptor");
6686 RemoveDirectoryA("neosodon");
6687 RemoveDirectoryA("olorotitan");
6688 RemoveDirectoryA("pantydraco");
6689 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6690 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6691 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6692 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6693 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6694 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6695 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6696 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6697 DeleteFileA(msifile);
6700 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
6702 MSIHANDLE summary;
6703 UINT r;
6705 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
6706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6708 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
6709 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6711 r = MsiSummaryInfoPersist(summary);
6712 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6714 MsiCloseHandle(summary);
6717 static void test_MsiGetSourcePath(void)
6719 MSIHANDLE hdb, hpkg;
6720 CHAR path[MAX_PATH];
6721 CHAR cwd[MAX_PATH];
6722 CHAR subsrc[MAX_PATH];
6723 CHAR sub2[MAX_PATH];
6724 DWORD size;
6725 UINT r;
6727 lstrcpyA(cwd, CURR_DIR);
6728 lstrcatA(cwd, "\\");
6730 lstrcpyA(subsrc, cwd);
6731 lstrcatA(subsrc, "subsource");
6732 lstrcatA(subsrc, "\\");
6734 lstrcpyA(sub2, subsrc);
6735 lstrcatA(sub2, "sub2");
6736 lstrcatA(sub2, "\\");
6738 /* uncompressed source */
6740 hdb = create_package_db();
6741 ok( hdb, "failed to create database\n");
6743 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
6745 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
6746 ok(r == S_OK, "failed\n");
6748 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
6749 ok(r == S_OK, "failed\n");
6751 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
6752 ok(r == S_OK, "failed\n");
6754 r = MsiDatabaseCommit(hdb);
6755 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
6757 hpkg = package_from_db(hdb);
6758 ok(hpkg, "failed to create package\n");
6760 MsiCloseHandle(hdb);
6762 /* invalid database handle */
6763 size = MAX_PATH;
6764 lstrcpyA(path, "kiwi");
6765 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
6766 ok(r == ERROR_INVALID_HANDLE,
6767 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
6768 ok(!lstrcmpA(path, "kiwi"),
6769 "Expected path to be unchanged, got \"%s\"\n", path);
6770 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6772 /* NULL szFolder */
6773 size = MAX_PATH;
6774 lstrcpyA(path, "kiwi");
6775 r = MsiGetSourcePath(hpkg, NULL, path, &size);
6776 ok(r == ERROR_INVALID_PARAMETER,
6777 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
6778 ok(!lstrcmpA(path, "kiwi"),
6779 "Expected path to be unchanged, got \"%s\"\n", path);
6780 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6782 /* empty szFolder */
6783 size = MAX_PATH;
6784 lstrcpyA(path, "kiwi");
6785 r = MsiGetSourcePath(hpkg, "", path, &size);
6786 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6787 ok(!lstrcmpA(path, "kiwi"),
6788 "Expected path to be unchanged, got \"%s\"\n", path);
6789 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6791 /* try TARGETDIR */
6792 size = MAX_PATH;
6793 lstrcpyA(path, "kiwi");
6794 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6795 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6796 ok(!lstrcmpA(path, "kiwi"),
6797 "Expected path to be unchanged, got \"%s\"\n", path);
6798 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6800 /* try SourceDir */
6801 size = MAX_PATH;
6802 lstrcpyA(path, "kiwi");
6803 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6804 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6805 ok(!lstrcmpA(path, "kiwi"),
6806 "Expected path to be unchanged, got \"%s\"\n", path);
6807 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6809 /* try SOURCEDIR */
6810 size = MAX_PATH;
6811 lstrcpyA(path, "kiwi");
6812 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6813 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6814 ok(!lstrcmpA(path, "kiwi"),
6815 "Expected path to be unchanged, got \"%s\"\n", path);
6816 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6818 /* source path does not exist, but the property exists */
6819 size = MAX_PATH;
6820 lstrcpyA(path, "kiwi");
6821 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
6822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6823 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
6824 ok(size == 0, "Expected 0, got %d\n", size);
6826 /* try SubDir */
6827 size = MAX_PATH;
6828 lstrcpyA(path, "kiwi");
6829 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6830 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6831 ok(!lstrcmpA(path, "kiwi"),
6832 "Expected path to be unchanged, got \"%s\"\n", path);
6833 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6835 /* try SubDir2 */
6836 size = MAX_PATH;
6837 lstrcpyA(path, "kiwi");
6838 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6839 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6840 ok(!lstrcmpA(path, "kiwi"),
6841 "Expected path to be unchanged, got \"%s\"\n", path);
6842 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6844 r = MsiDoAction(hpkg, "CostInitialize");
6845 ok(r == ERROR_SUCCESS, "cost init failed\n");
6847 /* try TARGETDIR after CostInitialize */
6848 size = MAX_PATH;
6849 lstrcpyA(path, "kiwi");
6850 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6851 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6852 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6853 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6855 /* try SourceDir after CostInitialize */
6856 size = MAX_PATH;
6857 lstrcpyA(path, "kiwi");
6858 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6859 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6860 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6861 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6863 /* try SOURCEDIR after CostInitialize */
6864 size = MAX_PATH;
6865 lstrcpyA(path, "kiwi");
6866 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6867 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6868 ok(!lstrcmpA(path, "kiwi"),
6869 "Expected path to be unchanged, got \"%s\"\n", path);
6870 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6872 /* source path does not exist, but the property exists */
6873 size = MAX_PATH;
6874 lstrcpyA(path, "kiwi");
6875 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
6876 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6877 todo_wine
6879 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6880 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6883 /* try SubDir after CostInitialize */
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 CostInitialize */
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, "ResolveSource");
6900 ok(r == ERROR_SUCCESS, "file cost failed\n");
6902 /* try TARGETDIR after ResolveSource */
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 ResolveSource */
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 ResolveSource */
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 /* source path does not exist, but the property exists */
6928 size = MAX_PATH;
6929 lstrcpyA(path, "kiwi");
6930 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
6931 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6932 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6933 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6935 /* try SubDir after ResolveSource */
6936 size = MAX_PATH;
6937 lstrcpyA(path, "kiwi");
6938 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6940 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
6941 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
6943 /* try SubDir2 after ResolveSource */
6944 size = MAX_PATH;
6945 lstrcpyA(path, "kiwi");
6946 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6948 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
6949 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
6951 r = MsiDoAction(hpkg, "FileCost");
6952 ok(r == ERROR_SUCCESS, "file cost failed\n");
6954 /* try TARGETDIR after FileCost */
6955 size = MAX_PATH;
6956 lstrcpyA(path, "kiwi");
6957 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
6958 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6959 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6960 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6962 /* try SourceDir after FileCost */
6963 size = MAX_PATH;
6964 lstrcpyA(path, "kiwi");
6965 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
6966 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6967 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
6968 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
6970 /* try SOURCEDIR after FileCost */
6971 size = MAX_PATH;
6972 lstrcpyA(path, "kiwi");
6973 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
6974 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
6975 ok(!lstrcmpA(path, "kiwi"),
6976 "Expected path to be unchanged, got \"%s\"\n", path);
6977 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
6979 /* try SubDir after FileCost */
6980 size = MAX_PATH;
6981 lstrcpyA(path, "kiwi");
6982 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
6983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6984 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
6985 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
6987 /* try SubDir2 after FileCost */
6988 size = MAX_PATH;
6989 lstrcpyA(path, "kiwi");
6990 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
6991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6992 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
6993 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
6995 r = MsiDoAction(hpkg, "CostFinalize");
6996 ok(r == ERROR_SUCCESS, "file cost failed\n");
6998 /* try TARGETDIR after CostFinalize */
6999 size = MAX_PATH;
7000 lstrcpyA(path, "kiwi");
7001 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
7002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7003 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7004 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7006 /* try SourceDir after CostFinalize */
7007 size = MAX_PATH;
7008 lstrcpyA(path, "kiwi");
7009 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7011 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7012 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7014 /* try SOURCEDIR after CostFinalize */
7015 size = MAX_PATH;
7016 lstrcpyA(path, "kiwi");
7017 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7018 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7019 ok(!lstrcmpA(path, "kiwi"),
7020 "Expected path to be unchanged, got \"%s\"\n", path);
7021 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7023 /* try SubDir after CostFinalize */
7024 size = MAX_PATH;
7025 lstrcpyA(path, "kiwi");
7026 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7028 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7029 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7031 /* try SubDir2 after CostFinalize */
7032 size = MAX_PATH;
7033 lstrcpyA(path, "kiwi");
7034 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7036 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
7037 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
7039 /* nonexistent directory */
7040 size = MAX_PATH;
7041 lstrcpyA(path, "kiwi");
7042 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
7043 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7044 ok(!lstrcmpA(path, "kiwi"),
7045 "Expected path to be unchanged, got \"%s\"\n", path);
7046 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7048 /* NULL szPathBuf */
7049 size = MAX_PATH;
7050 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
7051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7052 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7054 /* NULL pcchPathBuf */
7055 lstrcpyA(path, "kiwi");
7056 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
7057 ok(r == ERROR_INVALID_PARAMETER,
7058 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
7059 ok(!lstrcmpA(path, "kiwi"),
7060 "Expected path to be unchanged, got \"%s\"\n", path);
7062 /* pcchPathBuf is 0 */
7063 size = 0;
7064 lstrcpyA(path, "kiwi");
7065 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7066 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7067 ok(!lstrcmpA(path, "kiwi"),
7068 "Expected path to be unchanged, got \"%s\"\n", path);
7069 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7071 /* pcchPathBuf does not have room for NULL terminator */
7072 size = lstrlenA(cwd);
7073 lstrcpyA(path, "kiwi");
7074 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7075 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7076 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
7077 "Expected path with no backslash, got \"%s\"\n", path);
7078 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7080 /* pcchPathBuf has room for NULL terminator */
7081 size = lstrlenA(cwd) + 1;
7082 lstrcpyA(path, "kiwi");
7083 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7085 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7086 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7088 MsiCloseHandle(hpkg);
7090 /* compressed source */
7092 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
7093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7095 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
7097 hpkg = package_from_db(hdb);
7098 ok(hpkg, "failed to create package\n");
7100 r = MsiDoAction(hpkg, "CostInitialize");
7101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7102 r = MsiDoAction(hpkg, "FileCost");
7103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7104 r = MsiDoAction(hpkg, "CostFinalize");
7105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7107 /* try TARGETDIR after CostFinalize */
7108 size = MAX_PATH;
7109 lstrcpyA(path, "kiwi");
7110 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
7111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7112 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7113 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7115 /* try SourceDir after CostFinalize */
7116 size = MAX_PATH;
7117 lstrcpyA(path, "kiwi");
7118 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7120 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7121 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7123 /* try SOURCEDIR after CostFinalize */
7124 size = MAX_PATH;
7125 lstrcpyA(path, "kiwi");
7126 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7127 todo_wine
7129 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7130 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7131 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7134 /* try SubDir after CostFinalize */
7135 size = MAX_PATH;
7136 lstrcpyA(path, "kiwi");
7137 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7139 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7140 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7142 /* try SubDir2 after CostFinalize */
7143 size = MAX_PATH;
7144 lstrcpyA(path, "kiwi");
7145 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7146 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7147 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7148 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7150 MsiCloseHandle(hpkg);
7151 DeleteFile(msifile);
7154 static void test_shortlongsource(void)
7156 MSIHANDLE hdb, hpkg;
7157 CHAR path[MAX_PATH];
7158 CHAR cwd[MAX_PATH];
7159 CHAR subsrc[MAX_PATH];
7160 DWORD size;
7161 UINT r;
7163 lstrcpyA(cwd, CURR_DIR);
7164 lstrcatA(cwd, "\\");
7166 lstrcpyA(subsrc, cwd);
7167 lstrcatA(subsrc, "long");
7168 lstrcatA(subsrc, "\\");
7170 /* long file names */
7172 hdb = create_package_db();
7173 ok( hdb, "failed to create database\n");
7175 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
7177 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
7178 ok(r == S_OK, "failed\n");
7180 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
7181 ok(r == S_OK, "failed\n");
7183 /* CostInitialize:short */
7184 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
7185 ok(r == S_OK, "failed\n");
7187 /* CostInitialize:long */
7188 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
7189 ok(r == S_OK, "failed\n");
7191 /* FileCost:short */
7192 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
7193 ok(r == S_OK, "failed\n");
7195 /* FileCost:long */
7196 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
7197 ok(r == S_OK, "failed\n");
7199 /* CostFinalize:short */
7200 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
7201 ok(r == S_OK, "failed\n");
7203 /* CostFinalize:long */
7204 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
7205 ok(r == S_OK, "failed\n");
7207 MsiDatabaseCommit(hdb);
7209 hpkg = package_from_db(hdb);
7210 ok(hpkg, "failed to create package\n");
7212 MsiCloseHandle(hdb);
7214 CreateDirectoryA("one", NULL);
7215 CreateDirectoryA("four", NULL);
7217 r = MsiDoAction(hpkg, "CostInitialize");
7218 ok(r == ERROR_SUCCESS, "file cost failed\n");
7220 CreateDirectory("five", NULL);
7221 CreateDirectory("eight", NULL);
7223 r = MsiDoAction(hpkg, "FileCost");
7224 ok(r == ERROR_SUCCESS, "file cost failed\n");
7226 CreateDirectory("nine", NULL);
7227 CreateDirectory("twelve", NULL);
7229 r = MsiDoAction(hpkg, "CostFinalize");
7230 ok(r == ERROR_SUCCESS, "file cost failed\n");
7232 /* neither short nor long source directories exist */
7233 size = MAX_PATH;
7234 lstrcpyA(path, "kiwi");
7235 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7236 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7237 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7238 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7240 CreateDirectoryA("short", NULL);
7242 /* short source directory exists */
7243 size = MAX_PATH;
7244 lstrcpyA(path, "kiwi");
7245 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7247 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7248 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7250 CreateDirectoryA("long", NULL);
7252 /* both short and long source directories exist */
7253 size = MAX_PATH;
7254 lstrcpyA(path, "kiwi");
7255 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7257 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7258 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7260 lstrcpyA(subsrc, cwd);
7261 lstrcatA(subsrc, "two");
7262 lstrcatA(subsrc, "\\");
7264 /* short dir exists before CostInitialize */
7265 size = MAX_PATH;
7266 lstrcpyA(path, "kiwi");
7267 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7268 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7269 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7270 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7272 lstrcpyA(subsrc, cwd);
7273 lstrcatA(subsrc, "four");
7274 lstrcatA(subsrc, "\\");
7276 /* long dir exists before CostInitialize */
7277 size = MAX_PATH;
7278 lstrcpyA(path, "kiwi");
7279 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
7280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7281 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7282 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7284 lstrcpyA(subsrc, cwd);
7285 lstrcatA(subsrc, "six");
7286 lstrcatA(subsrc, "\\");
7288 /* short dir exists before FileCost */
7289 size = MAX_PATH;
7290 lstrcpyA(path, "kiwi");
7291 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
7292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7293 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7294 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7296 lstrcpyA(subsrc, cwd);
7297 lstrcatA(subsrc, "eight");
7298 lstrcatA(subsrc, "\\");
7300 /* long dir exists before FileCost */
7301 size = MAX_PATH;
7302 lstrcpyA(path, "kiwi");
7303 r = MsiGetSourcePath(hpkg, "SubDir5", 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, "ten");
7310 lstrcatA(subsrc, "\\");
7312 /* short dir exists before CostFinalize */
7313 size = MAX_PATH;
7314 lstrcpyA(path, "kiwi");
7315 r = MsiGetSourcePath(hpkg, "SubDir6", 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, "twelve");
7322 lstrcatA(subsrc, "\\");
7324 /* long dir exists before CostFinalize */
7325 size = MAX_PATH;
7326 lstrcpyA(path, "kiwi");
7327 r = MsiGetSourcePath(hpkg, "SubDir7", 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 MsiCloseHandle(hpkg);
7333 RemoveDirectoryA("short");
7334 RemoveDirectoryA("long");
7335 RemoveDirectoryA("one");
7336 RemoveDirectoryA("four");
7337 RemoveDirectoryA("five");
7338 RemoveDirectoryA("eight");
7339 RemoveDirectoryA("nine");
7340 RemoveDirectoryA("twelve");
7342 /* short file names */
7344 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
7345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7347 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
7349 hpkg = package_from_db(hdb);
7350 ok(hpkg, "failed to create package\n");
7352 MsiCloseHandle(hdb);
7354 CreateDirectoryA("one", NULL);
7355 CreateDirectoryA("four", NULL);
7357 r = MsiDoAction(hpkg, "CostInitialize");
7358 ok(r == ERROR_SUCCESS, "file cost failed\n");
7360 CreateDirectory("five", NULL);
7361 CreateDirectory("eight", NULL);
7363 r = MsiDoAction(hpkg, "FileCost");
7364 ok(r == ERROR_SUCCESS, "file cost failed\n");
7366 CreateDirectory("nine", NULL);
7367 CreateDirectory("twelve", NULL);
7369 r = MsiDoAction(hpkg, "CostFinalize");
7370 ok(r == ERROR_SUCCESS, "file cost failed\n");
7372 lstrcpyA(subsrc, cwd);
7373 lstrcatA(subsrc, "short");
7374 lstrcatA(subsrc, "\\");
7376 /* neither short nor long source directories exist */
7377 size = MAX_PATH;
7378 lstrcpyA(path, "kiwi");
7379 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7381 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7382 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7384 CreateDirectoryA("short", NULL);
7386 /* short source directory exists */
7387 size = MAX_PATH;
7388 lstrcpyA(path, "kiwi");
7389 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7391 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7392 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7394 CreateDirectoryA("long", NULL);
7396 /* both short and long source directories exist */
7397 size = MAX_PATH;
7398 lstrcpyA(path, "kiwi");
7399 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
7400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7401 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7402 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7404 lstrcpyA(subsrc, cwd);
7405 lstrcatA(subsrc, "one");
7406 lstrcatA(subsrc, "\\");
7408 /* short dir exists before CostInitialize */
7409 size = MAX_PATH;
7410 lstrcpyA(path, "kiwi");
7411 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
7412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7413 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7414 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7416 lstrcpyA(subsrc, cwd);
7417 lstrcatA(subsrc, "three");
7418 lstrcatA(subsrc, "\\");
7420 /* long dir exists before CostInitialize */
7421 size = MAX_PATH;
7422 lstrcpyA(path, "kiwi");
7423 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
7424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7425 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7426 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7428 lstrcpyA(subsrc, cwd);
7429 lstrcatA(subsrc, "five");
7430 lstrcatA(subsrc, "\\");
7432 /* short dir exists before FileCost */
7433 size = MAX_PATH;
7434 lstrcpyA(path, "kiwi");
7435 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
7436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7437 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7438 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7440 lstrcpyA(subsrc, cwd);
7441 lstrcatA(subsrc, "seven");
7442 lstrcatA(subsrc, "\\");
7444 /* long dir exists before FileCost */
7445 size = MAX_PATH;
7446 lstrcpyA(path, "kiwi");
7447 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
7448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7449 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7450 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7452 lstrcpyA(subsrc, cwd);
7453 lstrcatA(subsrc, "nine");
7454 lstrcatA(subsrc, "\\");
7456 /* short dir exists before CostFinalize */
7457 size = MAX_PATH;
7458 lstrcpyA(path, "kiwi");
7459 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
7460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7461 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7462 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7464 lstrcpyA(subsrc, cwd);
7465 lstrcatA(subsrc, "eleven");
7466 lstrcatA(subsrc, "\\");
7468 /* long dir exists before CostFinalize */
7469 size = MAX_PATH;
7470 lstrcpyA(path, "kiwi");
7471 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
7472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7473 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
7474 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
7476 MsiCloseHandle(hpkg);
7477 RemoveDirectoryA("short");
7478 RemoveDirectoryA("long");
7479 RemoveDirectoryA("one");
7480 RemoveDirectoryA("four");
7481 RemoveDirectoryA("five");
7482 RemoveDirectoryA("eight");
7483 RemoveDirectoryA("nine");
7484 RemoveDirectoryA("twelve");
7485 DeleteFileA(msifile);
7488 static void test_sourcedir(void)
7490 MSIHANDLE hdb, hpkg;
7491 CHAR package[10];
7492 CHAR path[MAX_PATH];
7493 CHAR cwd[MAX_PATH];
7494 CHAR subsrc[MAX_PATH];
7495 DWORD size;
7496 UINT r;
7498 lstrcpyA(cwd, CURR_DIR);
7499 lstrcatA(cwd, "\\");
7501 lstrcpyA(subsrc, cwd);
7502 lstrcatA(subsrc, "long");
7503 lstrcatA(subsrc, "\\");
7505 hdb = create_package_db();
7506 ok( hdb, "failed to create database\n");
7508 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
7509 ok(r == S_OK, "failed\n");
7511 sprintf(package, "#%li", hdb);
7512 r = MsiOpenPackage(package, &hpkg);
7513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7515 /* properties only */
7517 /* SourceDir prop */
7518 size = MAX_PATH;
7519 lstrcpyA(path, "kiwi");
7520 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7522 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7523 ok(size == 0, "Expected 0, got %d\n", size);
7525 /* SOURCEDIR prop */
7526 size = MAX_PATH;
7527 lstrcpyA(path, "kiwi");
7528 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7530 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7531 ok(size == 0, "Expected 0, got %d\n", size);
7533 r = MsiDoAction(hpkg, "CostInitialize");
7534 ok(r == ERROR_SUCCESS, "file cost failed\n");
7536 /* SourceDir after CostInitialize */
7537 size = MAX_PATH;
7538 lstrcpyA(path, "kiwi");
7539 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7540 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7541 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7542 ok(size == 0, "Expected 0, got %d\n", size);
7544 /* SOURCEDIR after CostInitialize */
7545 size = MAX_PATH;
7546 lstrcpyA(path, "kiwi");
7547 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7548 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7549 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7550 ok(size == 0, "Expected 0, got %d\n", size);
7552 r = MsiDoAction(hpkg, "FileCost");
7553 ok(r == ERROR_SUCCESS, "file cost failed\n");
7555 /* SourceDir after FileCost */
7556 size = MAX_PATH;
7557 lstrcpyA(path, "kiwi");
7558 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7560 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7561 ok(size == 0, "Expected 0, got %d\n", size);
7563 /* SOURCEDIR after FileCost */
7564 size = MAX_PATH;
7565 lstrcpyA(path, "kiwi");
7566 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7568 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7569 ok(size == 0, "Expected 0, got %d\n", size);
7571 r = MsiDoAction(hpkg, "CostFinalize");
7572 ok(r == ERROR_SUCCESS, "file cost failed\n");
7574 /* SourceDir after CostFinalize */
7575 size = MAX_PATH;
7576 lstrcpyA(path, "kiwi");
7577 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7578 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7579 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7580 ok(size == 0, "Expected 0, got %d\n", size);
7582 /* SOURCEDIR after CostFinalize */
7583 size = MAX_PATH;
7584 lstrcpyA(path, "kiwi");
7585 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7586 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7587 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7588 ok(size == 0, "Expected 0, got %d\n", size);
7590 r = MsiDoAction(hpkg, "ResolveSource");
7591 ok(r == ERROR_SUCCESS, "file cost failed\n");
7593 /* SourceDir after ResolveSource */
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 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7599 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7601 /* SOURCEDIR after ResolveSource */
7602 size = MAX_PATH;
7603 lstrcpyA(path, "kiwi");
7604 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7605 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7606 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7607 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7609 /* random casing */
7610 size = MAX_PATH;
7611 lstrcpyA(path, "kiwi");
7612 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
7613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7614 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7615 ok(size == 0, "Expected 0, got %d\n", size);
7617 MsiCloseHandle(hpkg);
7619 /* reset the package state */
7620 sprintf(package, "#%li", hdb);
7621 r = MsiOpenPackage(package, &hpkg);
7622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7624 /* test how MsiGetSourcePath affects the properties */
7626 /* SourceDir prop */
7627 size = MAX_PATH;
7628 lstrcpyA(path, "kiwi");
7629 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7630 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7631 todo_wine
7633 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7634 ok(size == 0, "Expected 0, got %d\n", size);
7637 size = MAX_PATH;
7638 lstrcpyA(path, "kiwi");
7639 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7640 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7641 ok(!lstrcmpA(path, "kiwi"),
7642 "Expected path to be unchanged, got \"%s\"\n", path);
7643 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7645 /* SourceDir after MsiGetSourcePath */
7646 size = MAX_PATH;
7647 lstrcpyA(path, "kiwi");
7648 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7650 todo_wine
7652 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7653 ok(size == 0, "Expected 0, got %d\n", size);
7656 /* SOURCEDIR prop */
7657 size = MAX_PATH;
7658 lstrcpyA(path, "kiwi");
7659 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7661 todo_wine
7663 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7664 ok(size == 0, "Expected 0, got %d\n", size);
7667 size = MAX_PATH;
7668 lstrcpyA(path, "kiwi");
7669 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7670 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7671 ok(!lstrcmpA(path, "kiwi"),
7672 "Expected path to be unchanged, got \"%s\"\n", path);
7673 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7675 /* SOURCEDIR prop after MsiGetSourcePath */
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 todo_wine
7682 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7683 ok(size == 0, "Expected 0, got %d\n", size);
7686 r = MsiDoAction(hpkg, "CostInitialize");
7687 ok(r == ERROR_SUCCESS, "file cost failed\n");
7689 /* SourceDir after CostInitialize */
7690 size = MAX_PATH;
7691 lstrcpyA(path, "kiwi");
7692 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7694 todo_wine
7696 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
7697 ok(size == 0, "Expected 0, got %d\n", size);
7700 size = MAX_PATH;
7701 lstrcpyA(path, "kiwi");
7702 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
7703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7704 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7705 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7707 /* SourceDir after MsiGetSourcePath */
7708 size = MAX_PATH;
7709 lstrcpyA(path, "kiwi");
7710 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7712 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7713 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7715 /* SOURCEDIR after CostInitialize */
7716 size = MAX_PATH;
7717 lstrcpyA(path, "kiwi");
7718 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7719 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7720 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7721 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7723 /* SOURCEDIR source path still does not exist */
7724 size = MAX_PATH;
7725 lstrcpyA(path, "kiwi");
7726 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7727 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7728 ok(!lstrcmpA(path, "kiwi"),
7729 "Expected path to be unchanged, got \"%s\"\n", path);
7730 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7732 r = MsiDoAction(hpkg, "FileCost");
7733 ok(r == ERROR_SUCCESS, "file cost failed\n");
7735 /* SourceDir after FileCost */
7736 size = MAX_PATH;
7737 lstrcpyA(path, "kiwi");
7738 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7739 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7740 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7741 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7743 /* SOURCEDIR after FileCost */
7744 size = MAX_PATH;
7745 lstrcpyA(path, "kiwi");
7746 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7747 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7748 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7749 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7751 /* SOURCEDIR source path still does not exist */
7752 size = MAX_PATH;
7753 lstrcpyA(path, "kiwi");
7754 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7755 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7756 ok(!lstrcmpA(path, "kiwi"),
7757 "Expected path to be unchanged, got \"%s\"\n", path);
7758 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7760 r = MsiDoAction(hpkg, "CostFinalize");
7761 ok(r == ERROR_SUCCESS, "file cost failed\n");
7763 /* SourceDir after CostFinalize */
7764 size = MAX_PATH;
7765 lstrcpyA(path, "kiwi");
7766 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7768 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7769 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7771 /* SOURCEDIR after CostFinalize */
7772 size = MAX_PATH;
7773 lstrcpyA(path, "kiwi");
7774 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7776 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7777 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7779 /* SOURCEDIR source path still does not exist */
7780 size = MAX_PATH;
7781 lstrcpyA(path, "kiwi");
7782 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7783 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7784 ok(!lstrcmpA(path, "kiwi"),
7785 "Expected path to be unchanged, got \"%s\"\n", path);
7786 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7788 r = MsiDoAction(hpkg, "ResolveSource");
7789 ok(r == ERROR_SUCCESS, "file cost failed\n");
7791 /* SourceDir after ResolveSource */
7792 size = MAX_PATH;
7793 lstrcpyA(path, "kiwi");
7794 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
7795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7796 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7797 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7799 /* SOURCEDIR after ResolveSource */
7800 size = MAX_PATH;
7801 lstrcpyA(path, "kiwi");
7802 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
7803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7804 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
7805 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
7807 /* SOURCEDIR source path still does not exist */
7808 size = MAX_PATH;
7809 lstrcpyA(path, "kiwi");
7810 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
7811 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
7812 ok(!lstrcmpA(path, "kiwi"),
7813 "Expected path to be unchanged, got \"%s\"\n", path);
7814 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
7816 MsiCloseHandle(hdb);
7817 MsiCloseHandle(hpkg);
7818 DeleteFileA(msifile);
7821 struct access_res
7823 BOOL gothandle;
7824 DWORD lasterr;
7827 static const struct access_res create[16] =
7829 { TRUE, ERROR_SUCCESS },
7830 { TRUE, ERROR_SUCCESS },
7831 { TRUE, ERROR_SUCCESS },
7832 { TRUE, ERROR_SUCCESS },
7833 { FALSE, ERROR_SHARING_VIOLATION },
7834 { FALSE, ERROR_SHARING_VIOLATION },
7835 { FALSE, ERROR_SHARING_VIOLATION },
7836 { TRUE, ERROR_SUCCESS },
7837 { FALSE, ERROR_SHARING_VIOLATION },
7838 { FALSE, ERROR_SHARING_VIOLATION },
7839 { FALSE, ERROR_SHARING_VIOLATION },
7840 { TRUE, ERROR_SUCCESS },
7841 { FALSE, ERROR_SHARING_VIOLATION },
7842 { FALSE, ERROR_SHARING_VIOLATION },
7843 { FALSE, ERROR_SHARING_VIOLATION },
7844 { TRUE, ERROR_SUCCESS }
7847 static const struct access_res create_commit[16] =
7849 { TRUE, ERROR_SUCCESS },
7850 { TRUE, ERROR_SUCCESS },
7851 { TRUE, ERROR_SUCCESS },
7852 { TRUE, ERROR_SUCCESS },
7853 { FALSE, ERROR_SHARING_VIOLATION },
7854 { FALSE, ERROR_SHARING_VIOLATION },
7855 { FALSE, ERROR_SHARING_VIOLATION },
7856 { TRUE, ERROR_SUCCESS },
7857 { FALSE, ERROR_SHARING_VIOLATION },
7858 { FALSE, ERROR_SHARING_VIOLATION },
7859 { FALSE, ERROR_SHARING_VIOLATION },
7860 { TRUE, ERROR_SUCCESS },
7861 { FALSE, ERROR_SHARING_VIOLATION },
7862 { FALSE, ERROR_SHARING_VIOLATION },
7863 { FALSE, ERROR_SHARING_VIOLATION },
7864 { TRUE, ERROR_SUCCESS }
7867 static const struct access_res create_close[16] =
7869 { TRUE, ERROR_SUCCESS },
7870 { TRUE, ERROR_SUCCESS },
7871 { TRUE, ERROR_SUCCESS },
7872 { TRUE, ERROR_SUCCESS },
7873 { TRUE, ERROR_SUCCESS },
7874 { TRUE, ERROR_SUCCESS },
7875 { TRUE, ERROR_SUCCESS },
7876 { TRUE, ERROR_SUCCESS },
7877 { TRUE, ERROR_SUCCESS },
7878 { TRUE, ERROR_SUCCESS },
7879 { TRUE, ERROR_SUCCESS },
7880 { TRUE, ERROR_SUCCESS },
7881 { TRUE, ERROR_SUCCESS },
7882 { TRUE, ERROR_SUCCESS },
7883 { TRUE, ERROR_SUCCESS },
7884 { TRUE, ERROR_SUCCESS }
7887 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
7889 DWORD access = 0, share = 0;
7890 DWORD lasterr;
7891 HANDLE hfile;
7892 int i, j, idx = 0;
7894 for (i = 0; i < 4; i++)
7896 if (i == 0) access = 0;
7897 if (i == 1) access = GENERIC_READ;
7898 if (i == 2) access = GENERIC_WRITE;
7899 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
7901 for (j = 0; j < 4; j++)
7903 if (j == 0) share = 0;
7904 if (j == 1) share = FILE_SHARE_READ;
7905 if (j == 2) share = FILE_SHARE_WRITE;
7906 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
7908 SetLastError(0xdeadbeef);
7909 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
7910 FILE_ATTRIBUTE_NORMAL, 0);
7911 lasterr = GetLastError();
7913 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
7914 "(%d, handle, %d): Expected %d, got %d\n",
7915 line, idx, ares[idx].gothandle,
7916 (hfile != INVALID_HANDLE_VALUE));
7918 ok(lasterr == ares[idx].lasterr,
7919 "(%d, lasterr, %d): Expected %d, got %d\n",
7920 line, idx, ares[idx].lasterr, lasterr);
7922 CloseHandle(hfile);
7923 idx++;
7928 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
7930 static void test_access(void)
7932 MSIHANDLE hdb;
7933 UINT r;
7935 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
7936 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7938 test_file_access(msifile, create);
7940 r = MsiDatabaseCommit(hdb);
7941 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7943 test_file_access(msifile, create_commit);
7945 MsiCloseHandle(hdb);
7947 test_file_access(msifile, create_close);
7949 DeleteFileA(msifile);
7951 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
7952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7954 test_file_access(msifile, create);
7956 r = MsiDatabaseCommit(hdb);
7957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7959 test_file_access(msifile, create_commit);
7961 MsiCloseHandle(hdb);
7963 test_file_access(msifile, create_close);
7965 DeleteFileA(msifile);
7968 START_TEST(package)
7970 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
7972 test_createpackage();
7973 test_doaction();
7974 test_gettargetpath_bad();
7975 test_settargetpath();
7976 test_props();
7977 test_property_table();
7978 test_condition();
7979 test_msipackage();
7980 test_formatrecord2();
7981 test_states();
7982 test_getproperty();
7983 test_removefiles();
7984 test_appsearch();
7985 test_featureparents();
7986 test_installprops();
7987 test_launchconditions();
7988 test_ccpsearch();
7989 test_complocator();
7990 test_MsiGetSourcePath();
7991 test_shortlongsource();
7992 test_sourcedir();
7993 test_access();