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
29 #include "wine/test.h"
31 static const char msifile[] = "winetest.msi";
32 char CURR_DIR[MAX_PATH];
34 /* RegDeleteTreeW from dlls/advapi32/registry.c */
35 LSTATUS WINAPI package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
38 DWORD dwMaxSubkeyLen, dwMaxValueLen;
39 DWORD dwMaxLen, dwSize;
40 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
45 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
49 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
50 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
51 if (ret) goto cleanup;
55 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
56 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
58 /* Name too big: alloc a buffer for it */
59 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
61 ret = ERROR_NOT_ENOUGH_MEMORY;
66 /* Recursively delete all the subkeys */
70 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
71 NULL, NULL, NULL)) break;
73 ret = package_RegDeleteTreeW(hSubKey, lpszName);
74 if (ret) goto cleanup;
78 ret = RegDeleteKeyW(hKey, lpszSubKey);
83 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
84 NULL, NULL, NULL, NULL)) break;
86 ret = RegDeleteValueW(hKey, lpszName);
87 if (ret) goto cleanup;
91 if (lpszName != szNameBuf)
92 HeapFree(GetProcessHeap(), 0, lpszName);
98 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
103 /* open a select query */
104 r = MsiDatabaseOpenView(hdb, query, &hview);
105 if (r != ERROR_SUCCESS)
107 r = MsiViewExecute(hview, 0);
108 if (r != ERROR_SUCCESS)
110 ret = MsiViewFetch(hview, phrec);
111 r = MsiViewClose(hview);
112 if (r != ERROR_SUCCESS)
114 r = MsiCloseHandle(hview);
115 if (r != ERROR_SUCCESS)
120 static UINT run_query( MSIHANDLE hdb, const char *query )
125 r = MsiDatabaseOpenView(hdb, query, &hview);
126 if( r != ERROR_SUCCESS )
129 r = MsiViewExecute(hview, 0);
130 if( r == ERROR_SUCCESS )
131 r = MsiViewClose(hview);
132 MsiCloseHandle(hview);
136 static UINT create_component_table( MSIHANDLE hdb )
138 return run_query( hdb,
139 "CREATE TABLE `Component` ( "
140 "`Component` CHAR(72) NOT NULL, "
141 "`ComponentId` CHAR(38), "
142 "`Directory_` CHAR(72) NOT NULL, "
143 "`Attributes` SHORT NOT NULL, "
144 "`Condition` CHAR(255), "
145 "`KeyPath` CHAR(72) "
146 "PRIMARY KEY `Component`)" );
149 static UINT create_feature_table( MSIHANDLE hdb )
151 return run_query( hdb,
152 "CREATE TABLE `Feature` ( "
153 "`Feature` CHAR(38) NOT NULL, "
154 "`Feature_Parent` CHAR(38), "
156 "`Description` CHAR(255), "
157 "`Display` SHORT NOT NULL, "
158 "`Level` SHORT NOT NULL, "
159 "`Directory_` CHAR(72), "
160 "`Attributes` SHORT NOT NULL "
161 "PRIMARY KEY `Feature`)" );
164 static UINT create_feature_components_table( MSIHANDLE hdb )
166 return run_query( hdb,
167 "CREATE TABLE `FeatureComponents` ( "
168 "`Feature_` CHAR(38) NOT NULL, "
169 "`Component_` CHAR(72) NOT NULL "
170 "PRIMARY KEY `Feature_`, `Component_` )" );
173 static UINT create_file_table( MSIHANDLE hdb )
175 return run_query( hdb,
176 "CREATE TABLE `File` ("
177 "`File` CHAR(72) NOT NULL, "
178 "`Component_` CHAR(72) NOT NULL, "
179 "`FileName` CHAR(255) NOT NULL, "
180 "`FileSize` LONG NOT NULL, "
181 "`Version` CHAR(72), "
182 "`Language` CHAR(20), "
183 "`Attributes` SHORT, "
184 "`Sequence` SHORT NOT NULL "
185 "PRIMARY KEY `File`)" );
188 static UINT create_remove_file_table( MSIHANDLE hdb )
190 return run_query( hdb,
191 "CREATE TABLE `RemoveFile` ("
192 "`FileKey` CHAR(72) NOT NULL, "
193 "`Component_` CHAR(72) NOT NULL, "
194 "`FileName` CHAR(255) LOCALIZABLE, "
195 "`DirProperty` CHAR(72) NOT NULL, "
196 "`InstallMode` SHORT NOT NULL "
197 "PRIMARY KEY `FileKey`)" );
200 static UINT create_appsearch_table( MSIHANDLE hdb )
202 return run_query( hdb,
203 "CREATE TABLE `AppSearch` ("
204 "`Property` CHAR(72) NOT NULL, "
205 "`Signature_` CHAR(72) NOT NULL "
206 "PRIMARY KEY `Property`, `Signature_`)" );
209 static UINT create_reglocator_table( MSIHANDLE hdb )
211 return run_query( hdb,
212 "CREATE TABLE `RegLocator` ("
213 "`Signature_` CHAR(72) NOT NULL, "
214 "`Root` SHORT NOT NULL, "
215 "`Key` CHAR(255) NOT NULL, "
218 "PRIMARY KEY `Signature_`)" );
221 static UINT create_signature_table( MSIHANDLE hdb )
223 return run_query( hdb,
224 "CREATE TABLE `Signature` ("
225 "`Signature` CHAR(72) NOT NULL, "
226 "`FileName` CHAR(255) NOT NULL, "
227 "`MinVersion` CHAR(20), "
228 "`MaxVersion` CHAR(20), "
233 "`Languages` CHAR(255) "
234 "PRIMARY KEY `Signature`)" );
237 static UINT create_launchcondition_table( MSIHANDLE hdb )
239 return run_query( hdb,
240 "CREATE TABLE `LaunchCondition` ("
241 "`Condition` CHAR(255) NOT NULL, "
242 "`Description` CHAR(255) NOT NULL "
243 "PRIMARY KEY `Condition`)" );
246 static UINT create_property_table( MSIHANDLE hdb )
248 return run_query( hdb,
249 "CREATE TABLE `Property` ("
250 "`Property` CHAR(72) NOT NULL, "
252 "PRIMARY KEY `Property`)" );
255 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
257 return run_query( hdb,
258 "CREATE TABLE `InstallExecuteSequence` ("
259 "`Action` CHAR(72) NOT NULL, "
260 "`Condition` CHAR(255), "
262 "PRIMARY KEY `Action`)" );
265 static UINT create_media_table( MSIHANDLE hdb )
267 return run_query( hdb,
268 "CREATE TABLE `Media` ("
269 "`DiskId` SHORT NOT NULL, "
270 "`LastSequence` SHORT NOT NULL, "
271 "`DiskPrompt` CHAR(64), "
272 "`Cabinet` CHAR(255), "
273 "`VolumeLabel` CHAR(32), "
275 "PRIMARY KEY `DiskId`)" );
278 static UINT create_ccpsearch_table( MSIHANDLE hdb )
280 return run_query( hdb,
281 "CREATE TABLE `CCPSearch` ("
282 "`Signature_` CHAR(72) NOT NULL "
283 "PRIMARY KEY `Signature_`)" );
286 static UINT create_drlocator_table( MSIHANDLE hdb )
288 return run_query( hdb,
289 "CREATE TABLE `DrLocator` ("
290 "`Signature_` CHAR(72) NOT NULL, "
291 "`Parent` CHAR(72), "
294 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
297 static UINT create_complocator_table( MSIHANDLE hdb )
299 return run_query( hdb,
300 "CREATE TABLE `CompLocator` ("
301 "`Signature_` CHAR(72) NOT NULL, "
302 "`ComponentId` CHAR(38) NOT NULL, "
304 "PRIMARY KEY `Signature_`)" );
307 static UINT add_component_entry( MSIHANDLE hdb, const char *values )
309 char insert[] = "INSERT INTO `Component` "
310 "(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
315 sz = strlen(values) + sizeof insert;
316 query = HeapAlloc(GetProcessHeap(),0,sz);
317 sprintf(query,insert,values);
318 r = run_query( hdb, query );
319 HeapFree(GetProcessHeap(), 0, query);
323 static UINT add_feature_entry( MSIHANDLE hdb, const char *values )
325 char insert[] = "INSERT INTO `Feature` (`Feature`, `Feature_Parent`, "
326 "`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )";
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);
338 static UINT add_feature_components_entry( MSIHANDLE hdb, const char *values )
340 char insert[] = "INSERT INTO `FeatureComponents` "
341 "(`Feature_`, `Component_`) "
346 sz = strlen(values) + sizeof insert;
347 query = HeapAlloc(GetProcessHeap(),0,sz);
348 sprintf(query,insert,values);
349 r = run_query( hdb, query );
350 HeapFree(GetProcessHeap(), 0, query);
354 static UINT add_file_entry( MSIHANDLE hdb, const char *values )
356 char insert[] = "INSERT INTO `File` "
357 "(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) "
362 sz = strlen(values) + sizeof insert;
363 query = HeapAlloc(GetProcessHeap(),0,sz);
364 sprintf(query,insert,values);
365 r = run_query( hdb, query );
366 HeapFree(GetProcessHeap(), 0, query);
370 static UINT add_appsearch_entry( MSIHANDLE hdb, const char *values )
372 char insert[] = "INSERT INTO `AppSearch` "
373 "(`Property`, `Signature_`) "
378 sz = strlen(values) + sizeof insert;
379 query = HeapAlloc(GetProcessHeap(),0,sz);
380 sprintf(query,insert,values);
381 r = run_query( hdb, query );
382 HeapFree(GetProcessHeap(), 0, query);
386 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *values )
388 char insert[] = "INSERT INTO `RegLocator` "
389 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) "
394 sz = strlen(values) + sizeof insert;
395 query = HeapAlloc(GetProcessHeap(),0,sz);
396 sprintf(query,insert,values);
397 r = run_query( hdb, query );
398 HeapFree(GetProcessHeap(), 0, query);
402 static UINT add_signature_entry( MSIHANDLE hdb, const char *values )
404 char insert[] = "INSERT INTO `Signature` "
405 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
406 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
411 sz = strlen(values) + sizeof insert;
412 query = HeapAlloc(GetProcessHeap(),0,sz);
413 sprintf(query,insert,values);
414 r = run_query( hdb, query );
415 HeapFree(GetProcessHeap(), 0, query);
419 static UINT add_launchcondition_entry( MSIHANDLE hdb, const char *values )
421 char insert[] = "INSERT INTO `LaunchCondition` "
422 "(`Condition`, `Description`) "
427 sz = strlen(values) + sizeof insert;
428 query = HeapAlloc(GetProcessHeap(),0,sz);
429 sprintf(query,insert,values);
430 r = run_query( hdb, query );
431 HeapFree(GetProcessHeap(), 0, query);
435 static UINT add_property_entry( MSIHANDLE hdb, const char *values )
437 char insert[] = "INSERT INTO `Property` "
438 "(`Property`, `Value`) "
443 sz = strlen(values) + sizeof insert;
444 query = HeapAlloc(GetProcessHeap(),0,sz);
445 sprintf(query,insert,values);
446 r = run_query( hdb, query );
447 HeapFree(GetProcessHeap(), 0, query);
451 static UINT add_install_execute_sequence_entry( MSIHANDLE hdb, const char *values )
453 char insert[] = "INSERT INTO `InstallExecuteSequence` "
454 "(`Action`, `Condition`, `Sequence`) "
459 sz = strlen(values) + sizeof insert;
460 query = HeapAlloc(GetProcessHeap(),0,sz);
461 sprintf(query,insert,values);
462 r = run_query( hdb, query );
463 HeapFree(GetProcessHeap(), 0, query);
467 static UINT add_media_entry( MSIHANDLE hdb, const char *values )
469 char insert[] = "INSERT INTO `Media` "
470 "(`DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source`) "
475 sz = strlen(values) + sizeof insert;
476 query = HeapAlloc(GetProcessHeap(),0,sz);
477 sprintf(query,insert,values);
478 r = run_query( hdb, query );
479 HeapFree(GetProcessHeap(), 0, query);
483 static UINT add_ccpsearch_entry( MSIHANDLE hdb, const char *values )
485 char insert[] = "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )";
489 sz = strlen(values) + sizeof insert;
490 query = HeapAlloc(GetProcessHeap(),0,sz);
491 sprintf(query,insert,values);
492 r = run_query( hdb, query );
493 HeapFree(GetProcessHeap(), 0, query);
497 static UINT add_drlocator_entry( MSIHANDLE hdb, const char *values )
499 char insert[] = "INSERT INTO `DrLocator` "
500 "(`Signature_`, `Parent`, `Path`, `Depth`) "
505 sz = strlen(values) + sizeof insert;
506 query = HeapAlloc(GetProcessHeap(),0,sz);
507 sprintf(query,insert,values);
508 r = run_query( hdb, query );
509 HeapFree(GetProcessHeap(), 0, query);
513 static UINT add_complocator_entry( MSIHANDLE hdb, const char *values )
515 char insert[] = "INSERT INTO `CompLocator` "
516 "(`Signature_`, `ComponentId`, `Type`) "
521 sz = strlen(values) + sizeof insert;
522 query = HeapAlloc(GetProcessHeap(),0,sz);
523 sprintf(query,insert,values);
524 r = run_query( hdb, query );
525 HeapFree(GetProcessHeap(), 0, query);
529 static UINT set_summary_info(MSIHANDLE hdb)
534 /* build summmary info */
535 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
536 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
538 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
539 "Installation Database");
540 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
542 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
543 "Installation Database");
544 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
546 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
548 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
550 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
552 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
554 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
555 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
556 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
558 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
559 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
561 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
562 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
564 res = MsiSummaryInfoPersist(suminfo);
565 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
567 res = MsiCloseHandle( suminfo);
568 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
574 static MSIHANDLE create_package_db(void)
581 /* create an empty database */
582 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
583 ok( res == ERROR_SUCCESS , "Failed to create database\n" );
584 if( res != ERROR_SUCCESS )
587 res = MsiDatabaseCommit( hdb );
588 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
590 res = set_summary_info(hdb);
592 res = run_query( hdb,
593 "CREATE TABLE `Directory` ( "
594 "`Directory` CHAR(255) NOT NULL, "
595 "`Directory_Parent` CHAR(255), "
596 "`DefaultDir` CHAR(255) NOT NULL "
597 "PRIMARY KEY `Directory`)" );
598 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
603 static MSIHANDLE package_from_db(MSIHANDLE hdb)
609 sprintf(szPackage,"#%li",hdb);
610 res = MsiOpenPackage(szPackage,&hPackage);
611 if (res != ERROR_SUCCESS)
614 res = MsiCloseHandle(hdb);
615 if (res != ERROR_SUCCESS)
621 static void create_test_file(const CHAR *name)
626 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
627 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
628 WriteFile(file, name, strlen(name), &written, NULL);
629 WriteFile(file, "\n", strlen("\n"), &written, NULL);
633 static void test_createpackage(void)
635 MSIHANDLE hPackage = 0;
638 hPackage = package_from_db(create_package_db());
639 ok( hPackage != 0, " Failed to create package\n");
641 res = MsiCloseHandle( hPackage);
642 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
646 static void test_getsourcepath_bad( void )
648 static const char str[] = { 0 };
653 r = MsiGetSourcePath( -1, NULL, NULL, NULL );
654 ok( r == ERROR_INVALID_PARAMETER, "return value wrong\n");
657 r = MsiGetSourcePath( -1, NULL, buffer, &sz );
658 ok( r == ERROR_INVALID_PARAMETER, "return value wrong\n");
661 r = MsiGetSourcePath( -1, str, NULL, &sz );
662 ok( r == ERROR_INVALID_HANDLE, "return value wrong\n");
665 r = MsiGetSourcePath( -1, str, NULL, NULL );
666 ok( r == ERROR_INVALID_HANDLE, "return value wrong\n");
669 r = MsiGetSourcePath( -1, str, buffer, &sz );
670 ok( r == ERROR_INVALID_HANDLE, "return value wrong\n");
673 static UINT add_directory_entry( MSIHANDLE hdb, const char *values )
675 char insert[] = "INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )";
679 sz = strlen(values) + sizeof insert;
680 query = HeapAlloc(GetProcessHeap(),0,sz);
681 sprintf(query,insert,values);
682 r = run_query( hdb, query );
683 HeapFree(GetProcessHeap(), 0, query);
687 static void test_getsourcepath( void )
689 static const char str[] = { 0 };
695 hpkg = package_from_db(create_package_db());
696 ok( hpkg, "failed to create package\n");
700 r = MsiGetSourcePath( hpkg, str, buffer, &sz );
701 ok( r == ERROR_DIRECTORY, "return value wrong\n");
702 ok( buffer[0] == 'x', "buffer modified\n");
706 r = MsiGetSourcePath( hpkg, str, buffer, &sz );
707 ok( r == ERROR_DIRECTORY, "return value wrong\n");
708 ok( buffer[0] == 'x', "buffer modified\n");
710 MsiCloseHandle( hpkg );
713 /* another test but try create a directory this time */
714 hdb = create_package_db();
715 ok( hdb, "failed to create database\n");
717 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
718 ok( r == S_OK, "failed\n");
720 hpkg = package_from_db(hdb);
721 ok( hpkg, "failed to create package\n");
723 sz = sizeof buffer -1;
724 strcpy(buffer,"x bad");
725 r = MsiGetSourcePath( hpkg, "TARGETDIR", buffer, &sz );
726 ok( r == ERROR_DIRECTORY, "return value wrong\n");
728 r = MsiDoAction( hpkg, "CostInitialize");
729 ok( r == ERROR_SUCCESS, "cost init failed\n");
730 r = MsiDoAction( hpkg, "CostFinalize");
731 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
733 sz = sizeof buffer -1;
735 r = MsiGetSourcePath( hpkg, "TARGETDIR", buffer, &sz );
736 ok( r == ERROR_SUCCESS, "return value wrong\n");
737 ok( sz == strlen(buffer), "returned length wrong\n");
740 strcpy(buffer,"x bad");
741 r = MsiGetSourcePath( hpkg, "TARGETDIR", buffer, &sz );
742 ok( r == ERROR_MORE_DATA, "return value wrong\n");
743 ok( buffer[0] == 'x', "buffer modified\n");
745 r = MsiGetSourcePath( hpkg, "TARGETDIR", NULL, NULL );
746 ok( r == ERROR_SUCCESS, "return value wrong\n");
748 r = MsiGetSourcePath( hpkg, "TARGETDIR ", NULL, NULL );
749 ok( r == ERROR_DIRECTORY, "return value wrong\n");
751 r = MsiGetSourcePath( hpkg, "targetdir", NULL, NULL );
752 ok( r == ERROR_DIRECTORY, "return value wrong\n");
754 r = MsiGetSourcePath( hpkg, "TARGETDIR", buffer, NULL );
755 ok( r == ERROR_INVALID_PARAMETER, "return value wrong\n");
757 r = MsiGetSourcePath( hpkg, "TARGETDIR", NULL, &sz );
758 ok( r == ERROR_SUCCESS, "return value wrong\n");
760 MsiCloseHandle( hpkg );
764 static void test_doaction( void )
769 r = MsiDoAction( -1, NULL );
770 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
772 hpkg = package_from_db(create_package_db());
773 ok( hpkg, "failed to create package\n");
775 r = MsiDoAction(hpkg, NULL);
776 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
778 r = MsiDoAction(0, "boo");
779 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
781 r = MsiDoAction(hpkg, "boo");
782 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
784 MsiCloseHandle( hpkg );
788 static void test_gettargetpath_bad(void)
795 hpkg = package_from_db(create_package_db());
796 ok( hpkg, "failed to create package\n");
798 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
799 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
801 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
802 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
804 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
805 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
807 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
808 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
810 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
811 ok( r == ERROR_DIRECTORY, "wrong return val\n");
813 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
814 ok( r == ERROR_DIRECTORY, "wrong return val\n");
816 MsiCloseHandle( hpkg );
820 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
826 rec = MsiCreateRecord( 1 );
827 ok(rec, "MsiCreate record failed\n");
829 r = MsiRecordSetString( rec, 0, file );
830 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
833 r = MsiFormatRecord( hpkg, rec, buff, &size );
834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
836 MsiCloseHandle( rec );
839 static void test_settargetpath(void)
841 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
847 hdb = create_package_db();
848 ok ( hdb, "failed to create package database\n" );
850 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
851 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
853 r = create_component_table( hdb );
854 ok( r == S_OK, "cannot create Component table: %d\n", r );
856 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
857 ok( r == S_OK, "cannot add dummy component: %d\n", r );
859 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
860 ok( r == S_OK, "cannot add test component: %d\n", r );
862 r = create_feature_table( hdb );
863 ok( r == S_OK, "cannot create Feature table: %d\n", r );
865 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
866 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
868 r = create_feature_components_table( hdb );
869 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
871 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
872 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
874 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
875 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
877 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
878 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
880 r = create_file_table( hdb );
881 ok( r == S_OK, "cannot create File table: %d\n", r );
883 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
884 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
886 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
887 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
889 hpkg = package_from_db( hdb );
890 ok( hpkg, "failed to create package\n");
892 r = MsiDoAction( hpkg, "CostInitialize");
893 ok( r == ERROR_SUCCESS, "cost init failed\n");
895 r = MsiDoAction( hpkg, "FileCost");
896 ok( r == ERROR_SUCCESS, "file cost failed\n");
898 r = MsiDoAction( hpkg, "CostFinalize");
899 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
901 r = MsiSetTargetPath( 0, NULL, NULL );
902 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
904 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
905 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
907 r = MsiSetTargetPath( hpkg, "boo", NULL );
908 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
910 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
911 ok( r == ERROR_DIRECTORY, "wrong return val\n");
913 sz = sizeof tempdir - 1;
914 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
915 sprintf( file, "%srootfile.txt", tempdir );
916 query_file_path( hpkg, "[#RootFile]", buffer );
917 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
918 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
920 GetTempFileName( tempdir, "_wt", 0, buffer );
921 sprintf( tempdir, "%s\\subdir", buffer );
923 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
924 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on file returned %d\n", r );
926 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
927 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
929 DeleteFile( buffer );
931 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
932 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
934 r = GetFileAttributes( buffer );
935 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
937 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
938 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
940 sz = sizeof buffer - 1;
941 lstrcat( tempdir, "\\" );
942 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
943 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
944 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
946 sprintf( file, "%srootfile.txt", tempdir );
947 query_file_path( hpkg, "[#RootFile]", buffer );
948 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
950 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
951 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
953 query_file_path( hpkg, "[#TestFile]", buffer );
954 ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
955 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
957 sz = sizeof buffer - 1;
958 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
959 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
960 ok( !lstrcmp(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
962 MsiCloseHandle( hpkg );
965 static void test_condition(void)
970 hpkg = package_from_db(create_package_db());
971 ok( hpkg, "failed to create package\n");
973 r = MsiEvaluateCondition(0, NULL);
974 ok( r == MSICONDITION_ERROR, "wrong return val\n");
976 r = MsiEvaluateCondition(hpkg, NULL);
977 ok( r == MSICONDITION_NONE, "wrong return val\n");
979 r = MsiEvaluateCondition(hpkg, "");
980 ok( r == MSICONDITION_NONE, "wrong return val\n");
982 r = MsiEvaluateCondition(hpkg, "1");
983 ok( r == MSICONDITION_TRUE, "wrong return val\n");
985 r = MsiEvaluateCondition(hpkg, "0");
986 ok( r == MSICONDITION_FALSE, "wrong return val\n");
988 r = MsiEvaluateCondition(hpkg, "0 = 0");
989 ok( r == MSICONDITION_TRUE, "wrong return val\n");
991 r = MsiEvaluateCondition(hpkg, "0 <> 0");
992 ok( r == MSICONDITION_FALSE, "wrong return val\n");
994 r = MsiEvaluateCondition(hpkg, "0 = 1");
995 ok( r == MSICONDITION_FALSE, "wrong return val\n");
997 r = MsiEvaluateCondition(hpkg, "0 > 1");
998 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1000 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1001 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1003 r = MsiEvaluateCondition(hpkg, "1 > 1");
1004 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1006 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1007 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1009 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1010 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1012 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1013 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1015 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1016 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1018 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1019 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1021 r = MsiEvaluateCondition(hpkg, "0 < 1");
1022 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1024 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1025 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1027 r = MsiEvaluateCondition(hpkg, "1 < 1");
1028 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1030 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1031 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1033 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1034 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1036 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1037 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1039 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1040 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1042 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1043 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1045 r = MsiEvaluateCondition(hpkg, "0 >=");
1046 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1048 r = MsiEvaluateCondition(hpkg, " ");
1049 ok( r == MSICONDITION_NONE, "wrong return val\n");
1051 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1052 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1054 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1055 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1057 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1058 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1060 r = MsiEvaluateCondition(hpkg, "not 0");
1061 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1063 r = MsiEvaluateCondition(hpkg, "not LicView");
1064 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1066 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1067 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1069 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1070 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1072 r = MsiEvaluateCondition(hpkg, "\"0\"");
1073 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1075 r = MsiEvaluateCondition(hpkg, "1 and 2");
1076 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1078 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1079 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1081 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1082 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1084 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1085 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1087 r = MsiEvaluateCondition(hpkg, "(0)");
1088 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1090 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1091 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1093 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1094 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1096 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1097 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1099 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1100 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1102 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1103 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1105 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1106 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1108 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1109 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1111 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1112 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1114 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1115 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1117 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1118 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1120 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1121 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1123 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1124 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1126 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1127 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1129 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1130 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1132 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1133 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1135 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1136 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1138 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1139 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1141 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1142 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1144 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1145 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1147 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1148 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1150 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1151 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1153 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1154 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1156 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1157 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1159 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1160 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1162 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1163 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1165 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1166 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1168 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1169 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1171 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1172 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1174 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1175 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1177 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1178 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1180 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1181 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1183 MsiSetProperty(hpkg, "mm", "5" );
1185 r = MsiEvaluateCondition(hpkg, "mm = 5");
1186 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1188 r = MsiEvaluateCondition(hpkg, "mm < 6");
1189 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1191 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1192 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1194 r = MsiEvaluateCondition(hpkg, "mm > 4");
1195 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1197 r = MsiEvaluateCondition(hpkg, "mm < 12");
1198 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1200 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1201 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1203 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1204 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1207 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1210 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1212 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1213 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1215 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1216 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1218 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1219 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1221 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1222 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1224 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1225 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1228 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1230 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1231 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1234 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1237 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1239 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1240 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1242 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1243 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1246 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1249 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1252 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1254 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1255 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1257 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1258 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1260 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1261 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1263 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1264 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1266 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1267 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1269 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1270 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1272 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1273 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1275 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1276 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1278 MsiSetProperty(hpkg, "bandalmael", "0" );
1279 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1280 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1282 MsiSetProperty(hpkg, "bandalmael", "" );
1283 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1284 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1286 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1287 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1288 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1290 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1291 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1292 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1294 MsiSetProperty(hpkg, "bandalmael", "0 " );
1295 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1296 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1298 MsiSetProperty(hpkg, "bandalmael", "-0" );
1299 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1300 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1302 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1303 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1304 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1306 MsiSetProperty(hpkg, "bandalmael", "--0" );
1307 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1308 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1310 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1311 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1312 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1314 MsiSetProperty(hpkg, "bandalmael", "-" );
1315 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1316 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1318 MsiSetProperty(hpkg, "bandalmael", "+0" );
1319 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1320 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1322 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1323 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1324 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1325 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1326 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1328 MsiSetProperty(hpkg, "one", "hi");
1329 MsiSetProperty(hpkg, "two", "hithere");
1330 r = MsiEvaluateCondition(hpkg, "one >< two");
1331 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1333 MsiSetProperty(hpkg, "one", "hithere");
1334 MsiSetProperty(hpkg, "two", "hi");
1335 r = MsiEvaluateCondition(hpkg, "one >< two");
1336 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1338 MsiSetProperty(hpkg, "one", "hello");
1339 MsiSetProperty(hpkg, "two", "hi");
1340 r = MsiEvaluateCondition(hpkg, "one >< two");
1341 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1343 MsiSetProperty(hpkg, "one", "hellohithere");
1344 MsiSetProperty(hpkg, "two", "hi");
1345 r = MsiEvaluateCondition(hpkg, "one >< two");
1346 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1348 MsiSetProperty(hpkg, "one", "");
1349 MsiSetProperty(hpkg, "two", "hi");
1350 r = MsiEvaluateCondition(hpkg, "one >< two");
1351 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1353 MsiSetProperty(hpkg, "one", "hi");
1354 MsiSetProperty(hpkg, "two", "");
1355 r = MsiEvaluateCondition(hpkg, "one >< two");
1356 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1358 MsiSetProperty(hpkg, "one", "");
1359 MsiSetProperty(hpkg, "two", "");
1360 r = MsiEvaluateCondition(hpkg, "one >< two");
1361 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1363 MsiSetProperty(hpkg, "one", "1234");
1364 MsiSetProperty(hpkg, "two", "1");
1365 r = MsiEvaluateCondition(hpkg, "one >< two");
1366 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1368 MsiSetProperty(hpkg, "one", "one 1234");
1369 MsiSetProperty(hpkg, "two", "1");
1370 r = MsiEvaluateCondition(hpkg, "one >< two");
1371 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1373 MsiSetProperty(hpkg, "one", "hithere");
1374 MsiSetProperty(hpkg, "two", "hi");
1375 r = MsiEvaluateCondition(hpkg, "one << two");
1376 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1378 MsiSetProperty(hpkg, "one", "hi");
1379 MsiSetProperty(hpkg, "two", "hithere");
1380 r = MsiEvaluateCondition(hpkg, "one << two");
1381 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1383 MsiSetProperty(hpkg, "one", "hi");
1384 MsiSetProperty(hpkg, "two", "hi");
1385 r = MsiEvaluateCondition(hpkg, "one << two");
1386 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1388 MsiSetProperty(hpkg, "one", "abcdhithere");
1389 MsiSetProperty(hpkg, "two", "hi");
1390 r = MsiEvaluateCondition(hpkg, "one << two");
1391 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1393 MsiSetProperty(hpkg, "one", "");
1394 MsiSetProperty(hpkg, "two", "hi");
1395 r = MsiEvaluateCondition(hpkg, "one << two");
1396 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1398 MsiSetProperty(hpkg, "one", "hithere");
1399 MsiSetProperty(hpkg, "two", "");
1400 r = MsiEvaluateCondition(hpkg, "one << two");
1401 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1403 MsiSetProperty(hpkg, "one", "");
1404 MsiSetProperty(hpkg, "two", "");
1405 r = MsiEvaluateCondition(hpkg, "one << two");
1406 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1408 MsiSetProperty(hpkg, "one", "1234");
1409 MsiSetProperty(hpkg, "two", "1");
1410 r = MsiEvaluateCondition(hpkg, "one << two");
1411 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1413 MsiSetProperty(hpkg, "one", "1234 one");
1414 MsiSetProperty(hpkg, "two", "1");
1415 r = MsiEvaluateCondition(hpkg, "one << two");
1416 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1418 MsiSetProperty(hpkg, "one", "hithere");
1419 MsiSetProperty(hpkg, "two", "there");
1420 r = MsiEvaluateCondition(hpkg, "one >> two");
1421 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1423 MsiSetProperty(hpkg, "one", "hithere");
1424 MsiSetProperty(hpkg, "two", "hi");
1425 r = MsiEvaluateCondition(hpkg, "one >> two");
1426 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1428 MsiSetProperty(hpkg, "one", "there");
1429 MsiSetProperty(hpkg, "two", "hithere");
1430 r = MsiEvaluateCondition(hpkg, "one >> two");
1431 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1433 MsiSetProperty(hpkg, "one", "there");
1434 MsiSetProperty(hpkg, "two", "there");
1435 r = MsiEvaluateCondition(hpkg, "one >> two");
1436 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1438 MsiSetProperty(hpkg, "one", "abcdhithere");
1439 MsiSetProperty(hpkg, "two", "hi");
1440 r = MsiEvaluateCondition(hpkg, "one >> two");
1441 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1443 MsiSetProperty(hpkg, "one", "");
1444 MsiSetProperty(hpkg, "two", "there");
1445 r = MsiEvaluateCondition(hpkg, "one >> two");
1446 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1448 MsiSetProperty(hpkg, "one", "there");
1449 MsiSetProperty(hpkg, "two", "");
1450 r = MsiEvaluateCondition(hpkg, "one >> two");
1451 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1453 MsiSetProperty(hpkg, "one", "");
1454 MsiSetProperty(hpkg, "two", "");
1455 r = MsiEvaluateCondition(hpkg, "one >> two");
1456 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1458 MsiSetProperty(hpkg, "one", "1234");
1459 MsiSetProperty(hpkg, "two", "4");
1460 r = MsiEvaluateCondition(hpkg, "one >> two");
1461 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1463 MsiSetProperty(hpkg, "one", "one 1234");
1464 MsiSetProperty(hpkg, "two", "4");
1465 r = MsiEvaluateCondition(hpkg, "one >> two");
1466 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1468 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1470 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1471 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1473 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1474 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1476 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1477 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1479 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1480 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1482 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1483 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1485 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1486 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1488 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1489 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1491 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1492 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1494 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1495 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1497 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1498 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1500 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1501 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1503 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1504 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1506 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1507 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1509 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1510 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1512 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1513 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1515 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1516 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1518 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1519 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1521 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1522 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1524 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1525 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1527 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1528 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1530 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1531 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1533 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1534 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1536 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1537 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1539 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1540 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1542 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1543 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1545 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1546 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1548 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1549 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1551 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1552 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1554 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1555 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1557 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1558 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1560 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1561 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1563 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1564 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1566 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1567 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1569 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1570 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1572 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1573 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1575 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1576 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1578 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1579 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1581 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1582 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1583 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1585 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1586 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1588 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1589 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1591 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1592 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1594 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1595 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1597 MsiSetProperty(hpkg, "one", "1");
1598 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1599 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1601 MsiSetProperty(hpkg, "X", "5.0");
1603 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1604 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1606 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1607 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1609 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1610 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1612 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1613 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1615 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1616 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1618 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1619 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1621 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1622 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1624 MsiCloseHandle( hpkg );
1625 DeleteFile(msifile);
1628 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1636 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1637 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1640 static void test_props(void)
1642 MSIHANDLE hpkg, hdb;
1647 hdb = create_package_db();
1649 "CREATE TABLE `Property` ( "
1650 "`Property` CHAR(255) NOT NULL, "
1651 "`Value` CHAR(255) "
1652 "PRIMARY KEY `Property`)" );
1653 ok( r == ERROR_SUCCESS , "Failed\n" );
1656 "INSERT INTO `Property` "
1657 "(`Property`, `Value`) "
1658 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1659 ok( r == ERROR_SUCCESS , "Failed\n" );
1661 hpkg = package_from_db( hdb );
1662 ok( hpkg, "failed to create package\n");
1664 /* test invalid values */
1665 r = MsiGetProperty( 0, NULL, NULL, NULL );
1666 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1668 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1669 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1671 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1672 ok( r == ERROR_SUCCESS, "wrong return val\n");
1674 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1675 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1677 /* test retrieving an empty/nonexistent property */
1679 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1680 ok( r == ERROR_SUCCESS, "wrong return val\n");
1681 ok( sz == 0, "wrong size returned\n");
1683 check_prop_empty( hpkg, "boo");
1686 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1687 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1688 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1689 ok( sz == 0, "wrong size returned\n");
1693 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1694 ok( r == ERROR_SUCCESS, "wrong return val\n");
1695 ok( buffer[0] == 0, "buffer was not changed\n");
1696 ok( sz == 0, "wrong size returned\n");
1698 /* set the property to something */
1699 r = MsiSetProperty( 0, NULL, NULL );
1700 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1702 r = MsiSetProperty( hpkg, NULL, NULL );
1703 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1705 r = MsiSetProperty( hpkg, "", NULL );
1706 ok( r == ERROR_SUCCESS, "wrong return val\n");
1708 /* try set and get some illegal property identifiers */
1709 r = MsiSetProperty( hpkg, "", "asdf" );
1710 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1712 r = MsiSetProperty( hpkg, "=", "asdf" );
1713 ok( r == ERROR_SUCCESS, "wrong return val\n");
1715 r = MsiSetProperty( hpkg, " ", "asdf" );
1716 ok( r == ERROR_SUCCESS, "wrong return val\n");
1718 r = MsiSetProperty( hpkg, "'", "asdf" );
1719 ok( r == ERROR_SUCCESS, "wrong return val\n");
1723 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1724 ok( r == ERROR_SUCCESS, "wrong return val\n");
1725 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1727 /* set empty values */
1728 r = MsiSetProperty( hpkg, "boo", NULL );
1729 ok( r == ERROR_SUCCESS, "wrong return val\n");
1730 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1732 r = MsiSetProperty( hpkg, "boo", "" );
1733 ok( r == ERROR_SUCCESS, "wrong return val\n");
1734 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
1736 /* set a non-empty value */
1737 r = MsiSetProperty( hpkg, "boo", "xyz" );
1738 ok( r == ERROR_SUCCESS, "wrong return val\n");
1742 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1743 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1744 ok( buffer[0] == 0, "buffer was not changed\n");
1745 ok( sz == 3, "wrong size returned\n");
1749 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1750 ok( r == ERROR_SUCCESS, "wrong return val\n");
1751 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
1752 ok( sz == 3, "wrong size returned\n");
1756 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1757 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1758 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
1759 ok( sz == 3, "wrong size returned\n");
1761 r = MsiSetProperty(hpkg, "SourceDir", "foo");
1762 ok( r == ERROR_SUCCESS, "wrong return val\n");
1765 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
1766 ok( r == ERROR_SUCCESS, "wrong return val\n");
1767 ok( !strcmp(buffer,""), "buffer wrong\n");
1768 ok( sz == 0, "wrong size returned\n");
1771 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
1772 ok( r == ERROR_SUCCESS, "wrong return val\n");
1773 ok( !strcmp(buffer,""), "buffer wrong\n");
1774 ok( sz == 0, "wrong size returned\n");
1777 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
1778 ok( r == ERROR_SUCCESS, "wrong return val\n");
1779 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
1780 ok( sz == 3, "wrong size returned\n");
1782 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
1783 ok( r == ERROR_SUCCESS, "wrong return val\n");
1786 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
1787 ok( r == ERROR_SUCCESS, "return wrong\n");
1788 ok( sz == 13, "size wrong (%d)\n", sz);
1791 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
1792 ok( r == ERROR_MORE_DATA, "return wrong\n");
1793 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
1795 r = MsiSetProperty(hpkg, "property", "value");
1796 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1799 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1800 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1801 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
1803 r = MsiSetProperty(hpkg, "property", NULL);
1804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1807 r = MsiGetProperty(hpkg, "property", buffer, &sz);
1808 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1809 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
1811 MsiCloseHandle( hpkg );
1812 DeleteFile(msifile);
1815 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
1817 MSIHANDLE hview, hrec;
1819 CHAR buffer[MAX_PATH];
1823 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
1824 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
1825 r = MsiViewExecute(hview, 0);
1826 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
1829 while (r == ERROR_SUCCESS && !found)
1831 r = MsiViewFetch(hview, &hrec);
1832 if (r != ERROR_SUCCESS) break;
1835 r = MsiRecordGetString(hrec, 1, buffer, &sz);
1836 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
1839 r = MsiRecordGetString(hrec, 2, buffer, &sz);
1840 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
1844 MsiCloseHandle(hrec);
1847 MsiViewClose(hview);
1848 MsiCloseHandle(hview);
1853 static void test_property_table(void)
1857 MSIHANDLE hpkg, hdb, hrec;
1858 char buffer[MAX_PATH];
1862 hdb = create_package_db();
1863 ok( hdb, "failed to create package\n");
1865 hpkg = package_from_db(hdb);
1866 ok( hpkg, "failed to create package\n");
1868 MsiCloseHandle(hdb);
1870 hdb = MsiGetActiveDatabase(hpkg);
1872 query = "CREATE TABLE `_Property` ( "
1873 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1874 r = run_query(hdb, query);
1875 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1877 MsiCloseHandle(hdb);
1878 MsiCloseHandle(hpkg);
1879 DeleteFile(msifile);
1881 hdb = create_package_db();
1882 ok( hdb, "failed to create package\n");
1884 query = "CREATE TABLE `_Property` ( "
1885 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1886 r = run_query(hdb, query);
1887 ok(r == ERROR_SUCCESS, "failed to create table\n");
1889 query = "ALTER `_Property` ADD `foo` INTEGER";
1890 r = run_query(hdb, query);
1891 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1893 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
1894 r = run_query(hdb, query);
1895 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
1897 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
1898 r = run_query(hdb, query);
1899 ok(r == ERROR_SUCCESS, "failed to add column\n");
1901 hpkg = package_from_db(hdb);
1904 ok(!hpkg, "package should not be created\n");
1907 MsiCloseHandle(hdb);
1908 MsiCloseHandle(hpkg);
1909 DeleteFile(msifile);
1911 hdb = create_package_db();
1912 ok (hdb, "failed to create package database\n");
1914 r = create_property_table(hdb);
1915 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
1917 r = add_property_entry(hdb, "'prop', 'val'");
1918 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1920 hpkg = package_from_db(hdb);
1921 ok(hpkg, "failed to create package\n");
1923 MsiCloseHandle(hdb);
1926 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
1927 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1928 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
1930 hdb = MsiGetActiveDatabase(hpkg);
1932 found = find_prop_in_property(hdb, "prop", "val");
1933 ok(found, "prop should be in the _Property table\n");
1935 r = add_property_entry(hdb, "'dantes', 'mercedes'");
1936 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
1938 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1939 r = do_query(hdb, query, &hrec);
1940 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
1942 found = find_prop_in_property(hdb, "dantes", "mercedes");
1943 ok(found == FALSE, "dantes should not be in the _Property table\n");
1946 lstrcpy(buffer, "aaa");
1947 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
1948 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1949 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
1951 r = MsiSetProperty(hpkg, "dantes", "mercedes");
1952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
1954 found = find_prop_in_property(hdb, "dantes", "mercedes");
1955 ok(found == TRUE, "dantes should be in the _Property table\n");
1957 MsiCloseHandle(hdb);
1958 MsiCloseHandle(hpkg);
1959 DeleteFile(msifile);
1962 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
1967 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
1968 if( res == ERROR_SUCCESS )
1972 r = MsiViewExecute( htab, hrec );
1973 if( r != ERROR_SUCCESS )
1976 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
1979 r = MsiViewClose( htab );
1980 if( r != ERROR_SUCCESS )
1983 r = MsiCloseHandle( htab );
1984 if( r != ERROR_SUCCESS )
1990 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
1992 return try_query_param( hdb, szQuery, 0 );
1995 static void test_msipackage(void)
1997 MSIHANDLE hdb = 0, hpack = 100;
2002 DeleteFile(msifile);
2006 r = MsiOpenPackage(name, &hpack);
2007 ok(r == ERROR_SUCCESS, "failed to open package with no name\n");
2008 r = MsiCloseHandle(hpack);
2009 ok(r == ERROR_SUCCESS, "failed to close package\n");
2012 /* just MsiOpenDatabase should not create a file */
2013 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2014 ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n");
2018 r = MsiOpenPackage(name, &hpack);
2019 ok(r == ERROR_INVALID_HANDLE, "MsiOpenPackage returned wrong code\n");
2022 /* now try again with our empty database */
2023 sprintf(name, "#%ld", hdb);
2024 r = MsiOpenPackage(name, &hpack);
2025 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "MsiOpenPackage returned wrong code\n");
2026 if (!r) MsiCloseHandle(hpack);
2029 /* create a table */
2030 query = "CREATE TABLE `Property` ( "
2031 "`Property` CHAR(72), `Value` CHAR(0) "
2032 "PRIMARY KEY `Property`)";
2033 r = try_query(hdb, query);
2034 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2036 query = "CREATE TABLE `InstallExecuteSequence` ("
2037 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2038 "PRIMARY KEY `Action`)";
2039 r = try_query(hdb, query);
2040 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2043 sprintf(name, "#%ld", hdb);
2044 r = MsiOpenPackage(name, &hpack);
2045 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "MsiOpenPackage returned wrong code\n");
2046 if (!r) MsiCloseHandle(hpack);
2049 r = MsiCloseHandle(hdb);
2050 ok(r == ERROR_SUCCESS, "MsiCloseHandle(database) failed\n");
2051 DeleteFile(msifile);
2054 static void test_formatrecord2(void)
2056 MSIHANDLE hpkg, hrec ;
2061 hpkg = package_from_db(create_package_db());
2062 ok( hpkg, "failed to create package\n");
2064 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2065 ok( r == ERROR_SUCCESS, "set property failed\n");
2067 hrec = MsiCreateRecord(2);
2068 ok(hrec, "create record failed\n");
2070 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2071 ok( r == ERROR_SUCCESS, "format record failed\n");
2075 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2077 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2078 r = MsiRecordSetString(hrec, 1, "hoo");
2080 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2081 ok( sz == 3, "size wrong\n");
2082 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2083 ok( r == ERROR_SUCCESS, "format failed\n");
2085 r = MsiRecordSetString(hrec, 0, "x[~]x");
2087 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2088 ok( sz == 3, "size wrong\n");
2089 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2090 ok( r == ERROR_SUCCESS, "format failed\n");
2092 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2093 r = MsiRecordSetString(hrec, 1, "hoo");
2095 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2096 ok( sz == 3, "size wrong\n");
2097 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2098 ok( r == ERROR_SUCCESS, "format failed\n");
2100 r = MsiRecordSetString(hrec, 0, "[\\[]");
2102 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2103 ok( sz == 1, "size wrong\n");
2104 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2105 ok( r == ERROR_SUCCESS, "format failed\n");
2107 SetEnvironmentVariable("FOO", "BAR");
2108 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2110 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2111 ok( sz == 3, "size wrong\n");
2112 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2113 ok( r == ERROR_SUCCESS, "format failed\n");
2115 r = MsiRecordSetString(hrec, 0, "[[1]]");
2116 r = MsiRecordSetString(hrec, 1, "%FOO");
2118 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2119 ok( sz == 3, "size wrong\n");
2120 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2121 ok( r == ERROR_SUCCESS, "format failed\n");
2123 MsiCloseHandle( hrec );
2124 MsiCloseHandle( hpkg );
2125 DeleteFile(msifile);
2128 /* FIXME: state is INSTALLSTATE_UNKNOWN if any features are removed and the
2129 * feature in question is not in ADD*
2131 static void test_states(void)
2136 INSTALLSTATE state, action;
2138 hdb = create_package_db();
2139 ok ( hdb, "failed to create package database\n" );
2141 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2142 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2144 r = create_property_table( hdb );
2145 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2147 r = add_property_entry( hdb, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2148 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2150 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2151 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2153 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2154 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2156 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2157 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2159 r = create_install_execute_sequence_table( hdb );
2160 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2162 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2163 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2165 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2166 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2168 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2169 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2171 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2172 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2174 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2175 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2177 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2178 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2180 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2181 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2183 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2184 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2186 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2187 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2189 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2190 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2192 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2193 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2195 r = create_media_table( hdb );
2196 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2198 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2199 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2201 r = create_feature_table( hdb );
2202 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2204 r = create_component_table( hdb );
2205 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2207 /* msidbFeatureAttributesFavorLocal */
2208 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2209 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2211 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2212 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2213 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2215 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2216 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2217 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2219 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2220 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2221 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2223 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2224 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2225 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2227 /* msidbFeatureAttributesFavorSource */
2228 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2229 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2231 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2232 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2233 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2235 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2236 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2237 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2239 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2240 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2241 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2243 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2244 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2245 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2247 /* msidbFeatureAttributesFavorSource */
2248 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2249 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2251 /* msidbFeatureAttributesFavorLocal */
2252 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2253 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2256 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2257 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2259 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2260 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2261 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2263 /* no feature parent:msidbComponentAttributesLocalOnly */
2264 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2265 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2267 /* msidbFeatureAttributesFavorLocal:removed */
2268 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2269 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2271 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2272 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2273 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2275 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2276 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2277 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2279 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2280 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2281 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2283 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2284 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2285 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2287 /* msidbFeatureAttributesFavorSource:removed */
2288 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2289 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2291 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2292 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2293 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2295 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2296 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2297 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2299 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2300 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2301 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2303 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2304 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2305 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2307 r = create_feature_components_table( hdb );
2308 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2310 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2311 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2313 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2314 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2316 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2317 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2319 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2320 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2322 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2323 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2325 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2326 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2328 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2329 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2331 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2332 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2334 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2335 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2337 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2338 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2340 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2341 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2343 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2344 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2346 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2347 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2349 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2350 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2352 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2353 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2355 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2356 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2358 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2359 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2361 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2362 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2364 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2365 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2367 r = create_file_table( hdb );
2368 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2370 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2371 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2373 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2374 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2376 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2377 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2379 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2380 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2382 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2383 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2385 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2386 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2388 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2389 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2391 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2392 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2394 /* compressed file */
2395 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2396 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2398 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2399 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2401 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2402 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2404 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2405 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2407 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2408 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2410 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2411 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2413 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2414 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2416 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2417 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2419 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2420 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2422 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2423 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2425 MsiDatabaseCommit(hdb);
2427 /* these properties must not be in the saved msi file */
2428 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2429 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2431 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2432 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2434 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2435 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2437 hpkg = package_from_db( hdb );
2438 ok( hpkg, "failed to create package\n");
2440 MsiCloseHandle(hdb);
2444 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2445 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2446 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2447 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2451 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2452 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2453 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2454 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2458 r = MsiGetFeatureState(hpkg, "three", &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);
2465 r = MsiGetFeatureState(hpkg, "four", &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);
2472 r = MsiGetFeatureState(hpkg, "five", &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);
2479 r = MsiGetFeatureState(hpkg, "six", &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);
2486 r = MsiGetFeatureState(hpkg, "seven", &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);
2493 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2494 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2495 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2496 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2500 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2501 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2502 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2503 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2507 r = MsiGetComponentState(hpkg, "gamma", &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);
2514 r = MsiGetComponentState(hpkg, "theta", &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);
2521 r = MsiGetComponentState(hpkg, "delta", &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);
2528 r = MsiGetComponentState(hpkg, "epsilon", &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);
2535 r = MsiGetComponentState(hpkg, "zeta", &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);
2542 r = MsiGetComponentState(hpkg, "iota", &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);
2549 r = MsiGetComponentState(hpkg, "eta", &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);
2556 r = MsiGetComponentState(hpkg, "kappa", &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);
2563 r = MsiGetComponentState(hpkg, "lambda", &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);
2570 r = MsiGetComponentState(hpkg, "mu", &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);
2577 r = MsiGetComponentState(hpkg, "nu", &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);
2584 r = MsiGetComponentState(hpkg, "xi", &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);
2591 r = MsiGetComponentState(hpkg, "omicron", &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);
2598 r = MsiGetComponentState(hpkg, "pi", &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);
2605 r = MsiGetComponentState(hpkg, "rho", &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);
2612 r = MsiGetComponentState(hpkg, "sigma", &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 r = MsiDoAction( hpkg, "CostInitialize");
2618 ok( r == ERROR_SUCCESS, "cost init failed\n");
2622 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2624 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2625 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2629 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2630 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2631 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2632 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2636 r = MsiGetFeatureState(hpkg, "three", &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);
2643 r = MsiGetFeatureState(hpkg, "four", &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);
2650 r = MsiGetFeatureState(hpkg, "five", &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);
2657 r = MsiGetFeatureState(hpkg, "six", &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);
2664 r = MsiGetFeatureState(hpkg, "seven", &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);
2671 r = MsiGetComponentState(hpkg, "alpha", &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);
2678 r = MsiGetComponentState(hpkg, "beta", &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);
2685 r = MsiGetComponentState(hpkg, "gamma", &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);
2692 r = MsiGetComponentState(hpkg, "theta", &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);
2699 r = MsiGetComponentState(hpkg, "delta", &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);
2706 r = MsiGetComponentState(hpkg, "epsilon", &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);
2713 r = MsiGetComponentState(hpkg, "zeta", &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);
2720 r = MsiGetComponentState(hpkg, "iota", &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);
2727 r = MsiGetComponentState(hpkg, "eta", &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);
2734 r = MsiGetComponentState(hpkg, "kappa", &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);
2741 r = MsiGetComponentState(hpkg, "lambda", &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);
2748 r = MsiGetComponentState(hpkg, "mu", &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);
2755 r = MsiGetComponentState(hpkg, "nu", &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);
2762 r = MsiGetComponentState(hpkg, "xi", &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);
2769 r = MsiGetComponentState(hpkg, "omicron", &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);
2776 r = MsiGetComponentState(hpkg, "pi", &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);
2783 r = MsiGetComponentState(hpkg, "rho", &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);
2790 r = MsiGetComponentState(hpkg, "sigma", &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 r = MsiDoAction( hpkg, "FileCost");
2796 ok( r == ERROR_SUCCESS, "file cost failed\n");
2800 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2801 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2802 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2803 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2807 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2808 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2809 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
2810 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2814 r = MsiGetFeatureState(hpkg, "three", &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);
2821 r = MsiGetFeatureState(hpkg, "four", &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);
2828 r = MsiGetFeatureState(hpkg, "five", &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);
2835 r = MsiGetFeatureState(hpkg, "six", &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);
2842 r = MsiGetFeatureState(hpkg, "seven", &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);
2849 r = MsiGetComponentState(hpkg, "alpha", &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);
2856 r = MsiGetComponentState(hpkg, "beta", &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);
2863 r = MsiGetComponentState(hpkg, "gamma", &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);
2870 r = MsiGetComponentState(hpkg, "theta", &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);
2877 r = MsiGetComponentState(hpkg, "delta", &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);
2884 r = MsiGetComponentState(hpkg, "epsilon", &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);
2891 r = MsiGetComponentState(hpkg, "zeta", &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);
2898 r = MsiGetComponentState(hpkg, "iota", &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);
2905 r = MsiGetComponentState(hpkg, "eta", &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);
2912 r = MsiGetComponentState(hpkg, "kappa", &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);
2919 r = MsiGetComponentState(hpkg, "lambda", &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);
2926 r = MsiGetComponentState(hpkg, "mu", &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);
2933 r = MsiGetComponentState(hpkg, "nu", &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);
2940 r = MsiGetComponentState(hpkg, "xi", &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);
2947 r = MsiGetComponentState(hpkg, "omicron", &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);
2954 r = MsiGetComponentState(hpkg, "pi", &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);
2961 r = MsiGetComponentState(hpkg, "rho", &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);
2968 r = MsiGetComponentState(hpkg, "sigma", &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 r = MsiDoAction( hpkg, "CostFinalize");
2974 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
2978 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2979 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2980 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
2981 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
2985 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2986 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
2987 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
2988 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
2992 r = MsiGetFeatureState(hpkg, "three", &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);
2999 r = MsiGetFeatureState(hpkg, "four", &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_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3006 r = MsiGetFeatureState(hpkg, "five", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3013 r = MsiGetFeatureState(hpkg, "six", &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);
3018 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3023 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3025 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3028 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3033 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3034 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3035 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3036 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3040 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3041 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3042 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3043 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3047 r = MsiGetComponentState(hpkg, "gamma", &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);
3054 r = MsiGetComponentState(hpkg, "theta", &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_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3061 r = MsiGetComponentState(hpkg, "delta", &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);
3068 r = MsiGetComponentState(hpkg, "epsilon", &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_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3075 r = MsiGetComponentState(hpkg, "zeta", &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_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3082 r = MsiGetComponentState(hpkg, "iota", &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_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3089 r = MsiGetComponentState(hpkg, "eta", &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_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3096 r = MsiGetComponentState(hpkg, "kappa", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3103 r = MsiGetComponentState(hpkg, "lambda", &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);
3108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3113 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3114 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3115 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3118 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3123 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3124 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3125 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3128 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3133 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3135 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3143 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3144 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3145 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3153 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3154 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3155 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3158 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3163 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3165 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3168 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3173 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3175 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3181 MsiCloseHandle( hpkg );
3183 /* publish the features and components */
3184 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3185 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3187 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3188 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3190 /* these properties must not be in the saved msi file */
3191 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3192 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3194 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3195 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3197 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3198 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3200 hpkg = package_from_db( hdb );
3201 ok( hpkg, "failed to create package\n");
3203 MsiCloseHandle(hdb);
3207 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3208 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3209 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3210 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3214 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3215 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3216 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3217 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3221 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3222 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3223 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3224 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3228 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3229 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3230 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3231 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3235 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3236 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3237 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3238 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3242 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3243 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3244 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3245 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3249 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3250 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3251 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3252 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3256 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3257 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3258 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3259 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3263 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3264 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3265 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3266 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3270 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3271 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3272 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3273 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3277 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3278 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3279 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3280 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3284 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3285 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3286 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3287 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3291 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3292 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3293 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3294 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3298 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3299 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3300 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3301 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3305 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3306 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3307 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3308 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3312 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3313 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3314 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3315 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3319 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3320 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3321 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3322 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3326 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3327 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3328 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3329 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3333 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3334 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3335 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3336 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3340 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3341 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3342 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3343 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3347 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3348 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3349 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3350 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3354 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3355 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3356 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3357 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3361 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3362 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3363 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3364 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3368 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3369 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3370 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3371 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3375 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3376 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3377 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3378 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3380 r = MsiDoAction( hpkg, "CostInitialize");
3381 ok( r == ERROR_SUCCESS, "cost init failed\n");
3385 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3386 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3387 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3388 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3392 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3393 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3394 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3395 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3399 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3400 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3401 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3402 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3406 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3407 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3408 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3409 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3413 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3415 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3416 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3420 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3422 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3423 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3427 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3429 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3430 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3434 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3436 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3437 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3441 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3443 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3444 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3448 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3450 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3451 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3455 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3457 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3458 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3462 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3464 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3465 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3469 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3471 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3472 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3476 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3478 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3479 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3483 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3485 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3486 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3490 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3492 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3493 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3497 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3499 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3500 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3504 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3506 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3507 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3511 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3513 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3514 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3518 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3520 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3521 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3525 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3526 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3527 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3528 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3532 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3533 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3534 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3535 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3539 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3540 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3541 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3542 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3546 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3547 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3548 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3549 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3553 r = MsiGetComponentState(hpkg, "sigma", &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 r = MsiDoAction( hpkg, "FileCost");
3559 ok( r == ERROR_SUCCESS, "file cost failed\n");
3563 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3564 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3565 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3566 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3570 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3571 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3572 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3573 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3577 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3578 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3579 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3580 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3584 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3585 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3586 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3587 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3591 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3593 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3594 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3598 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3599 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3600 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3601 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3605 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3606 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3607 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3608 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3612 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3614 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3615 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3619 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3621 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3622 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3626 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3627 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3628 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3629 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3633 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3634 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3635 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3636 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3640 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3642 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3643 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3647 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3649 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3650 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3654 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3655 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3656 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3657 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3661 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3663 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3664 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3668 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3669 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3670 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3671 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3675 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3676 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3677 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3678 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3682 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3683 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3684 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3685 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3689 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3690 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3691 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3692 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3696 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3697 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3698 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3699 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3703 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3704 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3705 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3706 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3710 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3711 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3712 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3713 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3717 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3718 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3719 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3720 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3724 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3725 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3726 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3727 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3731 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3732 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3733 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3734 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3736 r = MsiDoAction( hpkg, "CostFinalize");
3737 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3741 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3745 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3747 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3751 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3752 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3755 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3757 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3761 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3762 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3765 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3767 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3771 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3775 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3777 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3781 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3782 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3783 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3784 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3788 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3789 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3790 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3793 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3798 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3800 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3803 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3808 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3809 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3812 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3814 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3818 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3819 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3822 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3824 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3828 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3829 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3832 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3834 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3838 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3839 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3842 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3844 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3848 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3849 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3852 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3854 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3858 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3859 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3862 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3863 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3868 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3872 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
3873 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3878 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3879 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3882 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3884 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3888 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3889 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3892 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3894 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3898 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3899 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3900 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3901 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3905 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3906 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3907 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3910 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3915 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3916 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3917 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3920 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3925 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3927 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3930 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3935 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3936 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3937 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3940 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3945 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3946 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3947 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3950 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3955 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3956 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3957 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3960 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3965 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3967 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3975 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3976 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3977 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3980 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3983 MsiCloseHandle(hpkg);
3985 /* uninstall the product */
3986 r = MsiInstallProduct(msifile, "REMOVE=ALL");
3987 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3989 DeleteFileA(msifile);
3992 static void test_getproperty(void)
3994 MSIHANDLE hPackage = 0;
3996 static CHAR empty[] = "";
4000 hPackage = package_from_db(create_package_db());
4001 ok( hPackage != 0, " Failed to create package\n");
4003 /* set the property */
4004 r = MsiSetProperty(hPackage, "Name", "Value");
4005 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4007 /* retrieve the size, NULL pointer */
4009 r = MsiGetProperty(hPackage, "Name", NULL, &size);
4010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4011 ok( size == 5, "Expected 5, got %d\n", size);
4013 /* retrieve the size, empty string */
4015 r = MsiGetProperty(hPackage, "Name", empty, &size);
4016 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
4017 ok( size == 5, "Expected 5, got %d\n", size);
4019 /* don't change size */
4020 r = MsiGetProperty(hPackage, "Name", prop, &size);
4021 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
4022 ok( size == 5, "Expected 5, got %d\n", size);
4023 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
4025 /* increase the size by 1 */
4027 r = MsiGetProperty(hPackage, "Name", prop, &size);
4028 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4029 ok( size == 5, "Expected 5, got %d\n", size);
4030 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
4032 r = MsiCloseHandle( hPackage);
4033 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
4034 DeleteFile(msifile);
4037 static void test_removefiles(void)
4043 hdb = create_package_db();
4044 ok ( hdb, "failed to create package database\n" );
4046 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
4047 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
4049 r = create_feature_table( hdb );
4050 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
4052 r = create_component_table( hdb );
4053 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
4055 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
4056 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
4058 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
4059 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4061 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
4062 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4064 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
4065 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4067 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
4068 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4070 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
4071 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4073 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
4074 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4076 r = create_feature_components_table( hdb );
4077 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
4079 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
4080 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4082 r = add_feature_components_entry( hdb, "'one', 'helium'" );
4083 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4085 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
4086 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4088 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
4089 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4091 r = add_feature_components_entry( hdb, "'one', 'boron'" );
4092 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4094 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
4095 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4097 r = create_file_table( hdb );
4098 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
4100 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
4101 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4103 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
4104 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4106 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
4107 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4109 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
4110 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4112 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
4113 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4115 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
4116 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4118 r = create_remove_file_table( hdb );
4119 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
4121 hpkg = package_from_db( hdb );
4122 ok( hpkg, "failed to create package\n");
4124 MsiCloseHandle( hdb );
4126 create_test_file( "hydrogen.txt" );
4127 create_test_file( "helium.txt" );
4128 create_test_file( "lithium.txt" );
4129 create_test_file( "beryllium.txt" );
4130 create_test_file( "boron.txt" );
4131 create_test_file( "carbon.txt" );
4133 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
4134 ok( r == ERROR_SUCCESS, "set property failed\n");
4136 r = MsiDoAction( hpkg, "CostInitialize");
4137 ok( r == ERROR_SUCCESS, "cost init failed\n");
4139 r = MsiDoAction( hpkg, "FileCost");
4140 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
4142 r = MsiDoAction( hpkg, "CostFinalize");
4143 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
4145 r = MsiDoAction( hpkg, "InstallValidate");
4146 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
4148 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
4149 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
4151 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
4152 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
4154 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
4155 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
4157 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
4158 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
4160 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
4161 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
4163 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
4164 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
4166 r = MsiDoAction( hpkg, "RemoveFiles");
4167 ok( r == ERROR_SUCCESS, "remove files failed\n");
4169 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
4170 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
4171 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
4172 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
4173 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
4174 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
4176 MsiCloseHandle( hpkg );
4177 DeleteFileA(msifile);
4180 static void test_appsearch(void)
4185 CHAR prop[MAX_PATH];
4186 DWORD size = MAX_PATH;
4188 hdb = create_package_db();
4189 ok ( hdb, "failed to create package database\n" );
4191 r = create_appsearch_table( hdb );
4192 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
4194 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
4195 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
4197 r = create_reglocator_table( hdb );
4198 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
4200 r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
4201 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
4203 r = create_signature_table( hdb );
4204 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
4206 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
4207 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
4209 hpkg = package_from_db( hdb );
4210 ok( hpkg, "failed to create package\n");
4212 MsiCloseHandle( hdb );
4214 r = MsiDoAction( hpkg, "AppSearch" );
4215 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
4217 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
4218 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
4219 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
4221 MsiCloseHandle( hpkg );
4222 DeleteFileA(msifile);
4225 static void test_featureparents(void)
4230 INSTALLSTATE state, action;
4232 hdb = create_package_db();
4233 ok ( hdb, "failed to create package database\n" );
4235 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
4236 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
4238 r = create_feature_table( hdb );
4239 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
4241 r = create_component_table( hdb );
4242 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
4244 r = create_feature_components_table( hdb );
4245 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
4247 r = create_file_table( hdb );
4248 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
4250 /* msidbFeatureAttributesFavorLocal */
4251 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
4252 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
4254 /* msidbFeatureAttributesFavorSource */
4255 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
4256 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
4258 /* msidbFeatureAttributesFavorLocal */
4259 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
4260 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
4262 /* disabled because of install level */
4263 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
4264 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
4266 /* child feature of disabled feature */
4267 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
4268 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
4270 /* component of disabled feature (install level) */
4271 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
4272 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4274 /* component of disabled child feature (install level) */
4275 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
4276 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4278 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
4279 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
4280 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4282 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
4283 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
4284 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4286 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
4287 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
4288 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4290 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
4291 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
4292 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4294 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
4295 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
4296 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4298 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
4299 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
4300 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4302 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
4303 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
4304 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4306 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
4307 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
4308 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
4310 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
4311 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
4313 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
4314 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4316 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
4317 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4319 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
4320 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4322 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
4323 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4325 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
4326 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4328 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
4329 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4331 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
4332 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4334 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
4335 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4337 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
4338 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4340 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
4341 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4343 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
4344 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4346 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
4347 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4349 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
4350 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4352 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
4353 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4355 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
4356 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4358 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
4359 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4361 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
4362 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
4364 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
4365 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4367 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
4368 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4370 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
4371 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4373 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
4374 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4376 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
4377 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4379 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
4380 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4382 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
4383 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4385 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
4386 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4388 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
4389 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4391 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
4392 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4394 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
4395 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
4397 hpkg = package_from_db( hdb );
4398 ok( hpkg, "failed to create package\n");
4400 MsiCloseHandle( hdb );
4402 r = MsiDoAction( hpkg, "CostInitialize");
4403 ok( r == ERROR_SUCCESS, "cost init failed\n");
4405 r = MsiDoAction( hpkg, "FileCost");
4406 ok( r == ERROR_SUCCESS, "file cost failed\n");
4408 r = MsiDoAction( hpkg, "CostFinalize");
4409 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
4413 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
4414 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4415 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4416 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4420 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
4421 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4422 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4423 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4427 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
4428 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4429 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4430 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4434 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
4435 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4436 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4437 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4441 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
4442 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4443 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4444 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4448 r = MsiGetComponentState(hpkg, "leo", &state, &action);
4449 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4450 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4451 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4455 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
4456 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4457 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
4458 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
4462 r = MsiGetComponentState(hpkg, "libra", &state, &action);
4463 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4464 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
4465 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
4469 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
4470 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4471 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
4472 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
4476 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
4477 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4478 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
4479 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
4483 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
4484 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4485 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
4486 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
4490 r = MsiGetComponentState(hpkg, "canis", &state, &action);
4491 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4492 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
4493 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
4497 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
4498 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4499 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
4500 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
4504 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
4505 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4506 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
4507 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
4511 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
4512 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4513 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
4514 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
4518 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
4519 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4520 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
4521 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
4523 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
4524 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
4528 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
4529 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4530 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
4531 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
4535 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
4536 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4537 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
4538 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
4542 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
4543 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4544 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
4545 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
4549 r = MsiGetComponentState(hpkg, "leo", &state, &action);
4550 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4551 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
4552 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
4556 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
4557 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4558 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
4559 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
4563 r = MsiGetComponentState(hpkg, "libra", &state, &action);
4564 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4565 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
4566 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
4570 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
4571 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4572 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
4573 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
4577 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
4578 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4579 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
4580 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
4584 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
4585 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4586 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
4587 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
4591 r = MsiGetComponentState(hpkg, "canis", &state, &action);
4592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4593 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
4594 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
4598 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
4599 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4600 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
4601 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
4605 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
4606 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4607 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
4608 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
4612 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
4613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4614 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
4615 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
4619 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
4620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4621 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
4622 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
4624 MsiCloseHandle(hpkg);
4625 DeleteFileA(msifile);
4628 static void test_installprops(void)
4630 MSIHANDLE hpkg, hdb;
4631 CHAR path[MAX_PATH];
4637 GetCurrentDirectory(MAX_PATH, path);
4638 lstrcat(path, "\\");
4639 lstrcat(path, msifile);
4641 hdb = create_package_db();
4642 ok( hdb, "failed to create database\n");
4644 hpkg = package_from_db(hdb);
4645 ok( hpkg, "failed to create package\n");
4647 MsiCloseHandle(hdb);
4650 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
4651 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4652 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
4654 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey);
4658 RegQueryValueEx(hkey, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
4661 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
4662 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4663 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
4667 RegQueryValueEx(hkey, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
4670 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
4671 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4672 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
4675 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
4676 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4677 trace("VersionDatabase = %s\n", buf);
4680 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
4681 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4682 trace("VersionMsi = %s\n", buf);
4685 r = MsiGetProperty(hpkg, "Date", buf, &size);
4686 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4687 trace("Date = %s\n", buf);
4690 r = MsiGetProperty(hpkg, "Time", buf, &size);
4691 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4692 trace("Time = %s\n", buf);
4695 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
4696 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4697 trace("PackageCode = %s\n", buf);
4700 MsiCloseHandle(hpkg);
4701 DeleteFile(msifile);
4704 static void test_sourcedirprop(void)
4706 MSIHANDLE hpkg, hdb;
4707 CHAR source_dir[MAX_PATH];
4708 CHAR path[MAX_PATH];
4712 hdb = create_package_db();
4713 ok ( hdb, "failed to create package database\n" );
4715 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
4716 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
4718 hpkg = package_from_db( hdb );
4719 ok( hpkg, "failed to create package\n");
4721 MsiCloseHandle( hdb );
4724 r = MsiGetProperty( hpkg, "SourceDir", source_dir, &size );
4725 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4726 ok( !lstrlenA(source_dir), "Expected emtpy source dir, got %s\n", source_dir);
4729 r = MsiGetProperty( hpkg, "SOURCEDIR", source_dir, &size );
4730 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4731 ok( !lstrlenA(source_dir), "Expected emtpy source dir, got %s\n", source_dir);
4733 r = MsiDoAction( hpkg, "CostInitialize");
4734 ok( r == ERROR_SUCCESS, "cost init failed\n");
4737 r = MsiGetProperty( hpkg, "SourceDir", source_dir, &size );
4738 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4739 ok( !lstrlenA(source_dir), "Expected emtpy source dir, got %s\n", source_dir);
4742 r = MsiGetProperty( hpkg, "SOURCEDIR", source_dir, &size );
4743 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4744 ok( !lstrlenA(source_dir), "Expected emtpy source dir, got %s\n", source_dir);
4746 r = MsiDoAction( hpkg, "ResolveSource");
4747 ok( r == ERROR_SUCCESS, "file cost failed\n");
4749 GetCurrentDirectory(MAX_PATH, path);
4750 lstrcatA(path, "\\");
4753 r = MsiGetProperty( hpkg, "SourceDir", source_dir, &size );
4754 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4755 ok( !lstrcmpA(source_dir, path), "Expected %s, got %s\n", path, source_dir);
4758 r = MsiGetProperty( hpkg, "SOURCEDIR", source_dir, &size );
4759 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4760 ok( !lstrcmpA(source_dir, path), "Expected %s, got %s\n", path, source_dir);
4763 r = MsiGetProperty( hpkg, "SoUrCeDiR", source_dir, &size );
4764 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
4765 ok( !lstrlenA(source_dir), "Expected emtpy source dir, got %s\n", source_dir);
4767 MsiCloseHandle(hpkg);
4768 DeleteFileA(msifile);
4771 static void test_prop_path(void)
4773 MSIHANDLE hpkg, hdb;
4774 char buffer[MAX_PATH], cwd[MAX_PATH];
4778 GetCurrentDirectory(MAX_PATH, cwd);
4781 hdb = create_package_db();
4782 ok( hdb, "failed to create database\n");
4784 r = add_directory_entry( hdb, "'TARGETDIR','','SourceDir'" );
4785 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
4787 r = add_directory_entry( hdb, "'foo','TARGETDIR','foosrc:footgt'" );
4788 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
4790 hpkg = package_from_db(hdb);
4791 ok( hpkg, "failed to create package\n");
4793 r = MsiGetSourcePath(hpkg, "SourceDir", buffer, &sz );
4794 ok( r == ERROR_DIRECTORY, "failed to get source path\n");
4796 r = MsiGetSourcePath(hpkg, "SOURCEDIR", buffer, &sz );
4797 ok( r == ERROR_DIRECTORY, "failed to get source path\n");
4799 r = MsiDoAction( hpkg, "CostInitialize");
4800 ok( r == ERROR_SUCCESS, "cost init failed\n");
4804 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
4805 ok( r == ERROR_SUCCESS, "property not set\n");
4806 ok( !buffer[0], "SourceDir should be empty\n");
4810 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
4811 ok( r == ERROR_SUCCESS, "property not set\n");
4812 ok( !buffer[0], "SourceDir should be empty\n");
4816 r = MsiGetSourcePath(hpkg, "SourceDir", buffer, &sz );
4817 ok( r == ERROR_SUCCESS, "failed to get source path\n");
4818 ok( !lstrcmpi(cwd, buffer), "SourceDir (%s) should be current dir (%s)\n", buffer, cwd);
4822 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
4823 ok( r == ERROR_SUCCESS, "property not set\n");
4825 ok( !lstrcmpi(cwd, buffer), "SourceDir (%s) should be current dir (%s)\n", buffer, cwd);
4830 r = MsiGetSourcePath(hpkg, "SOURCEDIR", buffer, &sz );
4831 ok( r == ERROR_DIRECTORY, "failed to get source path\n");
4835 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
4836 ok( r == ERROR_SUCCESS, "property not set\n");
4838 ok( !lstrcmpi(cwd, buffer), "SourceDir (%s) should be current dir (%s)\n", buffer, cwd);
4841 r = MsiSetProperty(hpkg, "SourceDir", "goo");
4842 ok( r == ERROR_SUCCESS, "property not set\n");
4846 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
4847 ok( r == ERROR_SUCCESS, "property not set\n");
4848 ok( !lstrcmpi(buffer, "goo"), "SourceDir (%s) should be goo\n", buffer);
4852 r = MsiGetSourcePath(hpkg, "SourceDir", buffer, &sz );
4853 ok( r == ERROR_SUCCESS, "failed to get source path\n");
4854 ok( !lstrcmpi(buffer, cwd), "SourceDir (%s) should be goo\n", buffer);
4858 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
4859 ok( r == ERROR_SUCCESS, "property not set\n");
4860 ok( !lstrcmpi(buffer, "goo"), "SourceDir (%s) should be goo\n", buffer);
4862 MsiCloseHandle( hpkg );
4863 DeleteFile(msifile);
4866 static void test_launchconditions(void)
4872 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4874 hdb = create_package_db();
4875 ok( hdb, "failed to create package database\n" );
4877 r = create_launchcondition_table( hdb );
4878 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
4880 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
4881 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
4883 /* invalid condition */
4884 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
4885 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
4887 hpkg = package_from_db( hdb );
4888 ok( hpkg, "failed to create package\n");
4890 MsiCloseHandle( hdb );
4892 r = MsiSetProperty( hpkg, "X", "1" );
4893 ok( r == ERROR_SUCCESS, "failed to set property\n" );
4895 /* invalid conditions are ignored */
4896 r = MsiDoAction( hpkg, "LaunchConditions" );
4897 ok( r == ERROR_SUCCESS, "cost init failed\n" );
4899 /* verify LaunchConditions still does some verification */
4900 r = MsiSetProperty( hpkg, "X", "2" );
4901 ok( r == ERROR_SUCCESS, "failed to set property\n" );
4903 r = MsiDoAction( hpkg, "LaunchConditions" );
4904 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
4906 MsiCloseHandle( hpkg );
4907 DeleteFile( msifile );
4910 static void test_ccpsearch(void)
4912 MSIHANDLE hdb, hpkg;
4913 CHAR prop[MAX_PATH];
4914 DWORD size = MAX_PATH;
4917 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4919 hdb = create_package_db();
4920 ok(hdb, "failed to create package database\n");
4922 r = create_ccpsearch_table(hdb);
4923 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4925 r = add_ccpsearch_entry(hdb, "'CCP_random'");
4926 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4928 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
4929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4931 r = create_reglocator_table(hdb);
4932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4934 r = add_reglocator_entry(hdb, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
4935 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4937 r = create_drlocator_table(hdb);
4938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4940 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
4941 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4943 r = create_signature_table(hdb);
4944 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4946 hpkg = package_from_db(hdb);
4947 ok(hpkg, "failed to create package\n");
4949 MsiCloseHandle(hdb);
4951 r = MsiDoAction(hpkg, "CCPSearch");
4952 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4954 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
4955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4956 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
4958 MsiCloseHandle(hpkg);
4959 DeleteFileA(msifile);
4962 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
4967 if (FAILED(CLSIDFromString((LPOLESTR)in, &guid)))
4974 out[11-i] = in[n++];
4977 out[15-i] = in[n++];
4981 out[17+i*2] = in[n++];
4982 out[16+i*2] = in[n++];
4987 out[17+i*2] = in[n++];
4988 out[16+i*2] = in[n++];
4994 static void set_component_path(LPCSTR filename, LPCSTR guid)
4996 WCHAR guidW[MAX_PATH];
4997 WCHAR squashedW[MAX_PATH];
4998 CHAR squashed[MAX_PATH];
4999 CHAR substr[MAX_PATH];
5000 CHAR path[MAX_PATH];
5003 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
5004 squash_guid(guidW, squashedW);
5005 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
5007 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
5008 "Installer\\UserData\\S-1-5-18\\Components\\");
5009 lstrcatA(substr, squashed);
5011 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
5013 lstrcpyA(path, CURR_DIR);
5014 lstrcatA(path, "\\");
5015 lstrcatA(path, filename);
5017 /* just using a random squashed product code */
5018 RegSetValueExA(hkey, "7D2F387510109040002000060BECB6AB", 0,
5019 REG_SZ, (LPBYTE)path, lstrlenA(path));
5023 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
5024 RegCreateKeyA(HKEY_LOCAL_MACHINE, substr, &hkey);
5027 static void delete_component_path(LPCSTR guid)
5029 WCHAR guidW[MAX_PATH];
5030 WCHAR squashedW[MAX_PATH];
5031 WCHAR substrW[MAX_PATH];
5032 CHAR squashed[MAX_PATH];
5033 CHAR substr[MAX_PATH];
5035 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
5036 squash_guid(guidW, squashedW);
5037 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
5039 lstrcpyA(substr, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
5040 "Installer\\UserData\\S-1-5-18\\Components\\");
5041 lstrcatA(substr, squashed);
5043 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
5044 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
5046 lstrcpyA(substr, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
5047 MultiByteToWideChar(CP_ACP, 0, substr, -1, substrW, MAX_PATH);
5048 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW);
5051 static void test_complocator(void)
5053 MSIHANDLE hdb, hpkg;
5055 CHAR prop[MAX_PATH];
5056 CHAR expected[MAX_PATH];
5057 DWORD size = MAX_PATH;
5059 hdb = create_package_db();
5060 ok(hdb, "failed to create package database\n");
5062 r = create_appsearch_table(hdb);
5063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5065 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
5066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5068 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
5069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5071 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
5072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5074 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
5075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5077 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
5078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5080 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
5081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5083 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
5084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5086 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
5087 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5089 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
5090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5092 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
5093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5095 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
5096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5098 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
5099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5101 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
5102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5104 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
5105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5107 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
5108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5110 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
5111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5113 r = create_complocator_table(hdb);
5114 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5116 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
5117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5119 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
5120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5122 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
5123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5125 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
5126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5128 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
5129 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5131 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
5132 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5134 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
5135 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5137 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
5138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5140 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
5141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5143 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
5144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5146 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
5147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5149 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
5150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5152 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
5153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5155 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
5156 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5158 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
5159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5161 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
5162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5164 r = create_signature_table(hdb);
5165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5167 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
5168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5170 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
5171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5173 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
5174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5176 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
5177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5179 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
5180 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5182 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
5183 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5185 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
5186 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5188 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
5189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5191 hpkg = package_from_db(hdb);
5192 ok(hpkg, "failed to create package\n");
5194 MsiCloseHandle(hdb);
5196 create_test_file("abelisaurus");
5197 create_test_file("bactrosaurus");
5198 create_test_file("camelotia");
5199 create_test_file("diclonius");
5200 create_test_file("echinodon");
5201 create_test_file("falcarius");
5202 create_test_file("gallimimus");
5203 create_test_file("hagryphus");
5204 CreateDirectoryA("iguanodon", NULL);
5205 CreateDirectoryA("jobaria", NULL);
5206 CreateDirectoryA("kakuru", NULL);
5207 CreateDirectoryA("labocania", NULL);
5208 CreateDirectoryA("megaraptor", NULL);
5209 CreateDirectoryA("neosodon", NULL);
5210 CreateDirectoryA("olorotitan", NULL);
5211 CreateDirectoryA("pantydraco", NULL);
5213 set_component_path("abelisaurus", "{E3619EED-305A-418C-B9C7-F7D7377F0934}");
5214 set_component_path("bactrosaurus", "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
5215 set_component_path("echinodon", "{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
5216 set_component_path("falcarius", "{17762FA1-A7AE-4CC6-8827-62873C35361D}");
5217 set_component_path("iguanodon", "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
5218 set_component_path("jobaria", "{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
5219 set_component_path("megaraptor", "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
5220 set_component_path("neosodon", "{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
5222 r = MsiDoAction(hpkg, "AppSearch");
5223 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5226 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
5227 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5229 lstrcpyA(expected, CURR_DIR);
5230 lstrcatA(expected, "\\abelisaurus");
5233 ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
5237 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
5238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5239 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5242 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
5243 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5244 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5247 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
5248 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5249 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5252 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
5253 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5255 lstrcpyA(expected, CURR_DIR);
5256 lstrcatA(expected, "\\");
5259 ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
5263 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
5264 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5265 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5268 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
5269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5270 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5273 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
5274 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5275 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5278 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
5279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5280 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5283 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
5284 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5285 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5288 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
5289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5290 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5293 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
5294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5295 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5298 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
5299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5301 lstrcpyA(expected, CURR_DIR);
5302 lstrcatA(expected, "\\");
5305 ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
5309 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
5310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5312 lstrcpyA(expected, CURR_DIR);
5313 lstrcatA(expected, "\\neosodon\\");
5316 ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
5320 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
5321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5322 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5325 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
5326 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5327 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
5329 MsiCloseHandle(hpkg);
5330 DeleteFileA("abelisaurus");
5331 DeleteFileA("bactrosaurus");
5332 DeleteFileA("camelotia");
5333 DeleteFileA("diclonius");
5334 DeleteFileA("echinodon");
5335 DeleteFileA("falcarius");
5336 DeleteFileA("gallimimus");
5337 DeleteFileA("hagryphus");
5338 RemoveDirectoryA("iguanodon");
5339 RemoveDirectoryA("jobaria");
5340 RemoveDirectoryA("kakuru");
5341 RemoveDirectoryA("labocania");
5342 RemoveDirectoryA("megaraptor");
5343 RemoveDirectoryA("neosodon");
5344 RemoveDirectoryA("olorotitan");
5345 RemoveDirectoryA("pantydraco");
5346 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}");
5347 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
5348 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
5349 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}");
5350 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
5351 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
5352 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
5353 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
5354 DeleteFileA(msifile);
5359 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
5361 test_createpackage();
5362 test_getsourcepath_bad();
5363 test_getsourcepath();
5365 test_gettargetpath_bad();
5366 test_settargetpath();
5368 test_property_table();
5371 test_formatrecord2();
5376 test_featureparents();
5377 test_installprops();
5378 test_sourcedirprop();
5380 test_launchconditions();