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
30 #include "wine/test.h"
32 static const char msifile
[] = "winetest.msi";
33 char CURR_DIR
[MAX_PATH
];
35 /* RegDeleteTreeW from dlls/advapi32/registry.c */
36 LSTATUS WINAPI
package_RegDeleteTreeW(HKEY hKey
, LPCWSTR lpszSubKey
)
39 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
40 DWORD dwMaxLen
, dwSize
;
41 WCHAR szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
46 ret
= RegOpenKeyExW(hKey
, lpszSubKey
, 0, KEY_READ
, &hSubKey
);
50 ret
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, NULL
,
51 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
52 if (ret
) goto cleanup
;
56 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
57 if (dwMaxLen
> sizeof(szNameBuf
)/sizeof(WCHAR
))
59 /* Name too big: alloc a buffer for it */
60 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
*sizeof(WCHAR
))))
62 ret
= ERROR_NOT_ENOUGH_MEMORY
;
67 /* Recursively delete all the subkeys */
71 if (RegEnumKeyExW(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
72 NULL
, NULL
, NULL
)) break;
74 ret
= package_RegDeleteTreeW(hSubKey
, lpszName
);
75 if (ret
) goto cleanup
;
79 ret
= RegDeleteKeyW(hKey
, lpszSubKey
);
84 if (RegEnumValueW(hKey
, 0, lpszName
, &dwSize
,
85 NULL
, NULL
, NULL
, NULL
)) break;
87 ret
= RegDeleteValueW(hKey
, lpszName
);
88 if (ret
) goto cleanup
;
92 if (lpszName
!= szNameBuf
)
93 HeapFree(GetProcessHeap(), 0, lpszName
);
99 static UINT
do_query(MSIHANDLE hdb
, const char *query
, MSIHANDLE
*phrec
)
104 /* open a select query */
105 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
106 if (r
!= ERROR_SUCCESS
)
108 r
= MsiViewExecute(hview
, 0);
109 if (r
!= ERROR_SUCCESS
)
111 ret
= MsiViewFetch(hview
, phrec
);
112 r
= MsiViewClose(hview
);
113 if (r
!= ERROR_SUCCESS
)
115 r
= MsiCloseHandle(hview
);
116 if (r
!= ERROR_SUCCESS
)
121 static UINT
run_query( MSIHANDLE hdb
, const char *query
)
126 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
127 if( r
!= ERROR_SUCCESS
)
130 r
= MsiViewExecute(hview
, 0);
131 if( r
== ERROR_SUCCESS
)
132 r
= MsiViewClose(hview
);
133 MsiCloseHandle(hview
);
137 static UINT
create_component_table( MSIHANDLE hdb
)
139 return run_query( hdb
,
140 "CREATE TABLE `Component` ( "
141 "`Component` CHAR(72) NOT NULL, "
142 "`ComponentId` CHAR(38), "
143 "`Directory_` CHAR(72) NOT NULL, "
144 "`Attributes` SHORT NOT NULL, "
145 "`Condition` CHAR(255), "
146 "`KeyPath` CHAR(72) "
147 "PRIMARY KEY `Component`)" );
150 static UINT
create_feature_table( MSIHANDLE hdb
)
152 return run_query( hdb
,
153 "CREATE TABLE `Feature` ( "
154 "`Feature` CHAR(38) NOT NULL, "
155 "`Feature_Parent` CHAR(38), "
157 "`Description` CHAR(255), "
158 "`Display` SHORT NOT NULL, "
159 "`Level` SHORT NOT NULL, "
160 "`Directory_` CHAR(72), "
161 "`Attributes` SHORT NOT NULL "
162 "PRIMARY KEY `Feature`)" );
165 static UINT
create_feature_components_table( MSIHANDLE hdb
)
167 return run_query( hdb
,
168 "CREATE TABLE `FeatureComponents` ( "
169 "`Feature_` CHAR(38) NOT NULL, "
170 "`Component_` CHAR(72) NOT NULL "
171 "PRIMARY KEY `Feature_`, `Component_` )" );
174 static UINT
create_file_table( MSIHANDLE hdb
)
176 return run_query( hdb
,
177 "CREATE TABLE `File` ("
178 "`File` CHAR(72) NOT NULL, "
179 "`Component_` CHAR(72) NOT NULL, "
180 "`FileName` CHAR(255) NOT NULL, "
181 "`FileSize` LONG NOT NULL, "
182 "`Version` CHAR(72), "
183 "`Language` CHAR(20), "
184 "`Attributes` SHORT, "
185 "`Sequence` SHORT NOT NULL "
186 "PRIMARY KEY `File`)" );
189 static UINT
create_remove_file_table( MSIHANDLE hdb
)
191 return run_query( hdb
,
192 "CREATE TABLE `RemoveFile` ("
193 "`FileKey` CHAR(72) NOT NULL, "
194 "`Component_` CHAR(72) NOT NULL, "
195 "`FileName` CHAR(255) LOCALIZABLE, "
196 "`DirProperty` CHAR(72) NOT NULL, "
197 "`InstallMode` SHORT NOT NULL "
198 "PRIMARY KEY `FileKey`)" );
201 static UINT
create_appsearch_table( MSIHANDLE hdb
)
203 return run_query( hdb
,
204 "CREATE TABLE `AppSearch` ("
205 "`Property` CHAR(72) NOT NULL, "
206 "`Signature_` CHAR(72) NOT NULL "
207 "PRIMARY KEY `Property`, `Signature_`)" );
210 static UINT
create_reglocator_table( MSIHANDLE hdb
)
212 return run_query( hdb
,
213 "CREATE TABLE `RegLocator` ("
214 "`Signature_` CHAR(72) NOT NULL, "
215 "`Root` SHORT NOT NULL, "
216 "`Key` CHAR(255) NOT NULL, "
219 "PRIMARY KEY `Signature_`)" );
222 static UINT
create_signature_table( MSIHANDLE hdb
)
224 return run_query( hdb
,
225 "CREATE TABLE `Signature` ("
226 "`Signature` CHAR(72) NOT NULL, "
227 "`FileName` CHAR(255) NOT NULL, "
228 "`MinVersion` CHAR(20), "
229 "`MaxVersion` CHAR(20), "
234 "`Languages` CHAR(255) "
235 "PRIMARY KEY `Signature`)" );
238 static UINT
create_launchcondition_table( MSIHANDLE hdb
)
240 return run_query( hdb
,
241 "CREATE TABLE `LaunchCondition` ("
242 "`Condition` CHAR(255) NOT NULL, "
243 "`Description` CHAR(255) NOT NULL "
244 "PRIMARY KEY `Condition`)" );
247 static UINT
create_property_table( MSIHANDLE hdb
)
249 return run_query( hdb
,
250 "CREATE TABLE `Property` ("
251 "`Property` CHAR(72) NOT NULL, "
253 "PRIMARY KEY `Property`)" );
256 static UINT
create_install_execute_sequence_table( MSIHANDLE hdb
)
258 return run_query( hdb
,
259 "CREATE TABLE `InstallExecuteSequence` ("
260 "`Action` CHAR(72) NOT NULL, "
261 "`Condition` CHAR(255), "
263 "PRIMARY KEY `Action`)" );
266 static UINT
create_media_table( MSIHANDLE hdb
)
268 return run_query( hdb
,
269 "CREATE TABLE `Media` ("
270 "`DiskId` SHORT NOT NULL, "
271 "`LastSequence` SHORT NOT NULL, "
272 "`DiskPrompt` CHAR(64), "
273 "`Cabinet` CHAR(255), "
274 "`VolumeLabel` CHAR(32), "
276 "PRIMARY KEY `DiskId`)" );
279 static UINT
create_ccpsearch_table( MSIHANDLE hdb
)
281 return run_query( hdb
,
282 "CREATE TABLE `CCPSearch` ("
283 "`Signature_` CHAR(72) NOT NULL "
284 "PRIMARY KEY `Signature_`)" );
287 static UINT
create_drlocator_table( MSIHANDLE hdb
)
289 return run_query( hdb
,
290 "CREATE TABLE `DrLocator` ("
291 "`Signature_` CHAR(72) NOT NULL, "
292 "`Parent` CHAR(72), "
295 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
298 static UINT
create_complocator_table( MSIHANDLE hdb
)
300 return run_query( hdb
,
301 "CREATE TABLE `CompLocator` ("
302 "`Signature_` CHAR(72) NOT NULL, "
303 "`ComponentId` CHAR(38) NOT NULL, "
305 "PRIMARY KEY `Signature_`)" );
308 static UINT
add_component_entry( MSIHANDLE hdb
, const char *values
)
310 char insert
[] = "INSERT INTO `Component` "
311 "(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
316 sz
= strlen(values
) + sizeof insert
;
317 query
= HeapAlloc(GetProcessHeap(),0,sz
);
318 sprintf(query
,insert
,values
);
319 r
= run_query( hdb
, query
);
320 HeapFree(GetProcessHeap(), 0, query
);
324 static UINT
add_directory_entry( MSIHANDLE hdb
, const char *values
)
326 char insert
[] = "INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) 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_entry( MSIHANDLE hdb
, const char *values
)
340 char insert
[] = "INSERT INTO `Feature` (`Feature`, `Feature_Parent`, "
341 "`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )";
345 sz
= strlen(values
) + sizeof insert
;
346 query
= HeapAlloc(GetProcessHeap(),0,sz
);
347 sprintf(query
,insert
,values
);
348 r
= run_query( hdb
, query
);
349 HeapFree(GetProcessHeap(), 0, query
);
353 static UINT
add_feature_components_entry( MSIHANDLE hdb
, const char *values
)
355 char insert
[] = "INSERT INTO `FeatureComponents` "
356 "(`Feature_`, `Component_`) "
361 sz
= strlen(values
) + sizeof insert
;
362 query
= HeapAlloc(GetProcessHeap(),0,sz
);
363 sprintf(query
,insert
,values
);
364 r
= run_query( hdb
, query
);
365 HeapFree(GetProcessHeap(), 0, query
);
369 static UINT
add_file_entry( MSIHANDLE hdb
, const char *values
)
371 char insert
[] = "INSERT INTO `File` "
372 "(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) "
377 sz
= strlen(values
) + sizeof insert
;
378 query
= HeapAlloc(GetProcessHeap(),0,sz
);
379 sprintf(query
,insert
,values
);
380 r
= run_query( hdb
, query
);
381 HeapFree(GetProcessHeap(), 0, query
);
385 static UINT
add_appsearch_entry( MSIHANDLE hdb
, const char *values
)
387 char insert
[] = "INSERT INTO `AppSearch` "
388 "(`Property`, `Signature_`) "
393 sz
= strlen(values
) + sizeof insert
;
394 query
= HeapAlloc(GetProcessHeap(),0,sz
);
395 sprintf(query
,insert
,values
);
396 r
= run_query( hdb
, query
);
397 HeapFree(GetProcessHeap(), 0, query
);
401 static UINT
add_reglocator_entry( MSIHANDLE hdb
, const char *values
)
403 char insert
[] = "INSERT INTO `RegLocator` "
404 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) "
409 sz
= strlen(values
) + sizeof insert
;
410 query
= HeapAlloc(GetProcessHeap(),0,sz
);
411 sprintf(query
,insert
,values
);
412 r
= run_query( hdb
, query
);
413 HeapFree(GetProcessHeap(), 0, query
);
417 static UINT
add_signature_entry( MSIHANDLE hdb
, const char *values
)
419 char insert
[] = "INSERT INTO `Signature` "
420 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
421 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
426 sz
= strlen(values
) + sizeof insert
;
427 query
= HeapAlloc(GetProcessHeap(),0,sz
);
428 sprintf(query
,insert
,values
);
429 r
= run_query( hdb
, query
);
430 HeapFree(GetProcessHeap(), 0, query
);
434 static UINT
add_launchcondition_entry( MSIHANDLE hdb
, const char *values
)
436 char insert
[] = "INSERT INTO `LaunchCondition` "
437 "(`Condition`, `Description`) "
442 sz
= strlen(values
) + sizeof insert
;
443 query
= HeapAlloc(GetProcessHeap(),0,sz
);
444 sprintf(query
,insert
,values
);
445 r
= run_query( hdb
, query
);
446 HeapFree(GetProcessHeap(), 0, query
);
450 static UINT
add_property_entry( MSIHANDLE hdb
, const char *values
)
452 char insert
[] = "INSERT INTO `Property` "
453 "(`Property`, `Value`) "
458 sz
= strlen(values
) + sizeof insert
;
459 query
= HeapAlloc(GetProcessHeap(),0,sz
);
460 sprintf(query
,insert
,values
);
461 r
= run_query( hdb
, query
);
462 HeapFree(GetProcessHeap(), 0, query
);
466 static UINT
add_install_execute_sequence_entry( MSIHANDLE hdb
, const char *values
)
468 char insert
[] = "INSERT INTO `InstallExecuteSequence` "
469 "(`Action`, `Condition`, `Sequence`) "
474 sz
= strlen(values
) + sizeof insert
;
475 query
= HeapAlloc(GetProcessHeap(),0,sz
);
476 sprintf(query
,insert
,values
);
477 r
= run_query( hdb
, query
);
478 HeapFree(GetProcessHeap(), 0, query
);
482 static UINT
add_media_entry( MSIHANDLE hdb
, const char *values
)
484 char insert
[] = "INSERT INTO `Media` "
485 "(`DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source`) "
490 sz
= strlen(values
) + sizeof insert
;
491 query
= HeapAlloc(GetProcessHeap(),0,sz
);
492 sprintf(query
,insert
,values
);
493 r
= run_query( hdb
, query
);
494 HeapFree(GetProcessHeap(), 0, query
);
498 static UINT
add_ccpsearch_entry( MSIHANDLE hdb
, const char *values
)
500 char insert
[] = "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )";
504 sz
= strlen(values
) + sizeof insert
;
505 query
= HeapAlloc(GetProcessHeap(),0,sz
);
506 sprintf(query
,insert
,values
);
507 r
= run_query( hdb
, query
);
508 HeapFree(GetProcessHeap(), 0, query
);
512 static UINT
add_drlocator_entry( MSIHANDLE hdb
, const char *values
)
514 char insert
[] = "INSERT INTO `DrLocator` "
515 "(`Signature_`, `Parent`, `Path`, `Depth`) "
520 sz
= strlen(values
) + sizeof insert
;
521 query
= HeapAlloc(GetProcessHeap(),0,sz
);
522 sprintf(query
,insert
,values
);
523 r
= run_query( hdb
, query
);
524 HeapFree(GetProcessHeap(), 0, query
);
528 static UINT
add_complocator_entry( MSIHANDLE hdb
, const char *values
)
530 char insert
[] = "INSERT INTO `CompLocator` "
531 "(`Signature_`, `ComponentId`, `Type`) "
536 sz
= strlen(values
) + sizeof insert
;
537 query
= HeapAlloc(GetProcessHeap(),0,sz
);
538 sprintf(query
,insert
,values
);
539 r
= run_query( hdb
, query
);
540 HeapFree(GetProcessHeap(), 0, query
);
544 static UINT
set_summary_info(MSIHANDLE hdb
)
549 /* build summary info */
550 res
= MsiGetSummaryInformation(hdb
, NULL
, 7, &suminfo
);
551 ok( res
== ERROR_SUCCESS
, "Failed to open summaryinfo\n" );
553 res
= MsiSummaryInfoSetProperty(suminfo
,2, VT_LPSTR
, 0,NULL
,
554 "Installation Database");
555 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
557 res
= MsiSummaryInfoSetProperty(suminfo
,3, VT_LPSTR
, 0,NULL
,
558 "Installation Database");
559 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
561 res
= MsiSummaryInfoSetProperty(suminfo
,4, VT_LPSTR
, 0,NULL
,
563 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
565 res
= MsiSummaryInfoSetProperty(suminfo
,7, VT_LPSTR
, 0,NULL
,
567 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
569 res
= MsiSummaryInfoSetProperty(suminfo
,9, VT_LPSTR
, 0,NULL
,
570 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
571 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
573 res
= MsiSummaryInfoSetProperty(suminfo
, 14, VT_I4
, 100, NULL
, NULL
);
574 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
576 res
= MsiSummaryInfoSetProperty(suminfo
, 15, VT_I4
, 0, NULL
, NULL
);
577 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
579 res
= MsiSummaryInfoPersist(suminfo
);
580 ok( res
== ERROR_SUCCESS
, "Failed to make summary info persist\n" );
582 res
= MsiCloseHandle( suminfo
);
583 ok( res
== ERROR_SUCCESS
, "Failed to close suminfo\n" );
589 static MSIHANDLE
create_package_db(void)
596 /* create an empty database */
597 res
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
598 ok( res
== ERROR_SUCCESS
, "Failed to create database\n" );
599 if( res
!= ERROR_SUCCESS
)
602 res
= MsiDatabaseCommit( hdb
);
603 ok( res
== ERROR_SUCCESS
, "Failed to commit database\n" );
605 res
= set_summary_info(hdb
);
607 res
= run_query( hdb
,
608 "CREATE TABLE `Directory` ( "
609 "`Directory` CHAR(255) NOT NULL, "
610 "`Directory_Parent` CHAR(255), "
611 "`DefaultDir` CHAR(255) NOT NULL "
612 "PRIMARY KEY `Directory`)" );
613 ok( res
== ERROR_SUCCESS
, "Failed to create directory table\n" );
618 static MSIHANDLE
package_from_db(MSIHANDLE hdb
)
624 sprintf(szPackage
,"#%li",hdb
);
625 res
= MsiOpenPackage(szPackage
,&hPackage
);
626 if (res
!= ERROR_SUCCESS
)
629 res
= MsiCloseHandle(hdb
);
630 if (res
!= ERROR_SUCCESS
)
636 static void create_test_file(const CHAR
*name
)
641 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
642 ok(file
!= INVALID_HANDLE_VALUE
, "Failure to open file %s\n", name
);
643 WriteFile(file
, name
, strlen(name
), &written
, NULL
);
644 WriteFile(file
, "\n", strlen("\n"), &written
, NULL
);
648 static void test_createpackage(void)
650 MSIHANDLE hPackage
= 0;
653 hPackage
= package_from_db(create_package_db());
654 ok( hPackage
!= 0, " Failed to create package\n");
656 res
= MsiCloseHandle( hPackage
);
657 ok( res
== ERROR_SUCCESS
, "Failed to close package\n" );
661 static void test_doaction( void )
666 r
= MsiDoAction( -1, NULL
);
667 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
669 hpkg
= package_from_db(create_package_db());
670 ok( hpkg
, "failed to create package\n");
672 r
= MsiDoAction(hpkg
, NULL
);
673 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
675 r
= MsiDoAction(0, "boo");
676 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
678 r
= MsiDoAction(hpkg
, "boo");
679 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "wrong return val\n");
681 MsiCloseHandle( hpkg
);
685 static void test_gettargetpath_bad(void)
692 hpkg
= package_from_db(create_package_db());
693 ok( hpkg
, "failed to create package\n");
695 r
= MsiGetTargetPath( 0, NULL
, NULL
, NULL
);
696 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
698 r
= MsiGetTargetPath( 0, NULL
, NULL
, &sz
);
699 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
701 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
702 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
704 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
705 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
707 r
= MsiGetTargetPath( hpkg
, "boo", NULL
, NULL
);
708 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
710 r
= MsiGetTargetPath( hpkg
, "boo", buffer
, NULL
);
711 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
713 MsiCloseHandle( hpkg
);
717 static void query_file_path(MSIHANDLE hpkg
, LPCSTR file
, LPSTR buff
)
723 rec
= MsiCreateRecord( 1 );
724 ok(rec
, "MsiCreate record failed\n");
726 r
= MsiRecordSetString( rec
, 0, file
);
727 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
730 r
= MsiFormatRecord( hpkg
, rec
, buff
, &size
);
731 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
733 MsiCloseHandle( rec
);
736 static void test_settargetpath(void)
738 char tempdir
[MAX_PATH
+8], buffer
[MAX_PATH
], file
[MAX_PATH
];
744 hdb
= create_package_db();
745 ok ( hdb
, "failed to create package database\n" );
747 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
748 ok( r
== S_OK
, "failed to add directory entry: %d\n" , r
);
750 r
= create_component_table( hdb
);
751 ok( r
== S_OK
, "cannot create Component table: %d\n", r
);
753 r
= add_component_entry( hdb
, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
754 ok( r
== S_OK
, "cannot add dummy component: %d\n", r
);
756 r
= add_component_entry( hdb
, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
757 ok( r
== S_OK
, "cannot add test component: %d\n", r
);
759 r
= create_feature_table( hdb
);
760 ok( r
== S_OK
, "cannot create Feature table: %d\n", r
);
762 r
= add_feature_entry( hdb
, "'TestFeature', '', '', '', 0, 1, '', 0" );
763 ok( r
== ERROR_SUCCESS
, "cannot add TestFeature to Feature table: %d\n", r
);
765 r
= create_feature_components_table( hdb
);
766 ok( r
== S_OK
, "cannot create FeatureComponents table: %d\n", r
);
768 r
= add_feature_components_entry( hdb
, "'TestFeature', 'RootComp'" );
769 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
771 r
= add_feature_components_entry( hdb
, "'TestFeature', 'TestComp'" );
772 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
774 add_directory_entry( hdb
, "'TestParent', 'TARGETDIR', 'TestParent'" );
775 add_directory_entry( hdb
, "'TestDir', 'TestParent', 'TestDir'" );
777 r
= create_file_table( hdb
);
778 ok( r
== S_OK
, "cannot create File table: %d\n", r
);
780 r
= add_file_entry( hdb
, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
781 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
783 r
= add_file_entry( hdb
, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
784 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
786 hpkg
= package_from_db( hdb
);
787 ok( hpkg
, "failed to create package\n");
789 r
= MsiDoAction( hpkg
, "CostInitialize");
790 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
792 r
= MsiDoAction( hpkg
, "FileCost");
793 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
795 r
= MsiDoAction( hpkg
, "CostFinalize");
796 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
798 r
= MsiSetTargetPath( 0, NULL
, NULL
);
799 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
801 r
= MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
802 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
804 r
= MsiSetTargetPath( hpkg
, "boo", NULL
);
805 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
807 r
= MsiSetTargetPath( hpkg
, "boo", "c:\\bogusx" );
808 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
810 sz
= sizeof tempdir
- 1;
811 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", tempdir
, &sz
);
812 sprintf( file
, "%srootfile.txt", tempdir
);
813 query_file_path( hpkg
, "[#RootFile]", buffer
);
814 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
815 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
817 GetTempFileName( tempdir
, "_wt", 0, buffer
);
818 sprintf( tempdir
, "%s\\subdir", buffer
);
820 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
821 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
822 "MsiSetTargetPath on file returned %d\n", r
);
824 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
825 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
826 "MsiSetTargetPath on 'subdir' of file returned %d\n", r
);
828 DeleteFile( buffer
);
830 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
831 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
833 r
= GetFileAttributes( buffer
);
834 ok ( r
== INVALID_FILE_ATTRIBUTES
, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r
);
836 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
837 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath on subsubdir returned %d\n", r
);
839 sz
= sizeof buffer
- 1;
840 lstrcat( tempdir
, "\\" );
841 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", buffer
, &sz
);
842 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
843 ok( !lstrcmp(buffer
, tempdir
), "Expected %s, got %s\n", tempdir
, buffer
);
845 sprintf( file
, "%srootfile.txt", tempdir
);
846 query_file_path( hpkg
, "[#RootFile]", buffer
);
847 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
849 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two" );
850 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
852 query_file_path( hpkg
, "[#TestFile]", buffer
);
853 ok( !lstrcmp(buffer
, "C:\\one\\two\\TestDir\\testfile.txt"),
854 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer
);
856 sz
= sizeof buffer
- 1;
857 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
858 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
859 ok( !lstrcmp(buffer
, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer
);
861 MsiCloseHandle( hpkg
);
864 static void test_condition(void)
869 hpkg
= package_from_db(create_package_db());
870 ok( hpkg
, "failed to create package\n");
872 r
= MsiEvaluateCondition(0, NULL
);
873 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
875 r
= MsiEvaluateCondition(hpkg
, NULL
);
876 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
878 r
= MsiEvaluateCondition(hpkg
, "");
879 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
881 r
= MsiEvaluateCondition(hpkg
, "1");
882 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
884 r
= MsiEvaluateCondition(hpkg
, "0");
885 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
887 r
= MsiEvaluateCondition(hpkg
, "-1");
888 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
890 r
= MsiEvaluateCondition(hpkg
, "0 = 0");
891 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
893 r
= MsiEvaluateCondition(hpkg
, "0 <> 0");
894 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
896 r
= MsiEvaluateCondition(hpkg
, "0 = 1");
897 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
899 r
= MsiEvaluateCondition(hpkg
, "0 > 1");
900 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
902 r
= MsiEvaluateCondition(hpkg
, "0 ~> 1");
903 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
905 r
= MsiEvaluateCondition(hpkg
, "1 > 1");
906 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
908 r
= MsiEvaluateCondition(hpkg
, "1 ~> 1");
909 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
911 r
= MsiEvaluateCondition(hpkg
, "0 >= 1");
912 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
914 r
= MsiEvaluateCondition(hpkg
, "0 ~>= 1");
915 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
917 r
= MsiEvaluateCondition(hpkg
, "1 >= 1");
918 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
920 r
= MsiEvaluateCondition(hpkg
, "1 ~>= 1");
921 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
923 r
= MsiEvaluateCondition(hpkg
, "0 < 1");
924 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
926 r
= MsiEvaluateCondition(hpkg
, "0 ~< 1");
927 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
929 r
= MsiEvaluateCondition(hpkg
, "1 < 1");
930 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
932 r
= MsiEvaluateCondition(hpkg
, "1 ~< 1");
933 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
935 r
= MsiEvaluateCondition(hpkg
, "0 <= 1");
936 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
938 r
= MsiEvaluateCondition(hpkg
, "0 ~<= 1");
939 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
941 r
= MsiEvaluateCondition(hpkg
, "1 <= 1");
942 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
944 r
= MsiEvaluateCondition(hpkg
, "1 ~<= 1");
945 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
947 r
= MsiEvaluateCondition(hpkg
, "0 >=");
948 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
950 r
= MsiEvaluateCondition(hpkg
, " ");
951 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
953 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"1\"");
954 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
956 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"0\"");
957 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
959 r
= MsiEvaluateCondition(hpkg
, "LicView <> LicView");
960 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
962 r
= MsiEvaluateCondition(hpkg
, "not 0");
963 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
965 r
= MsiEvaluateCondition(hpkg
, "not LicView");
966 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
968 r
= MsiEvaluateCondition(hpkg
, "not \"A\"");
969 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
971 r
= MsiEvaluateCondition(hpkg
, "~not \"A\"");
972 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
974 r
= MsiEvaluateCondition(hpkg
, "\"0\"");
975 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
977 r
= MsiEvaluateCondition(hpkg
, "1 and 2");
978 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
980 r
= MsiEvaluateCondition(hpkg
, "not 0 and 3");
981 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
983 r
= MsiEvaluateCondition(hpkg
, "not 0 and 0");
984 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
986 r
= MsiEvaluateCondition(hpkg
, "not 0 or 1");
987 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
989 r
= MsiEvaluateCondition(hpkg
, "(0)");
990 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
992 r
= MsiEvaluateCondition(hpkg
, "(((((1))))))");
993 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
995 r
= MsiEvaluateCondition(hpkg
, "(((((1)))))");
996 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
998 r
= MsiEvaluateCondition(hpkg
, " \"A\" < \"B\" ");
999 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1001 r
= MsiEvaluateCondition(hpkg
, " \"A\" > \"B\" ");
1002 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1004 r
= MsiEvaluateCondition(hpkg
, " \"1\" > \"12\" ");
1005 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1007 r
= MsiEvaluateCondition(hpkg
, " \"100\" < \"21\" ");
1008 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1010 r
= MsiEvaluateCondition(hpkg
, "0 < > 0");
1011 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1013 r
= MsiEvaluateCondition(hpkg
, "(1<<1) == 2");
1014 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1016 r
= MsiEvaluateCondition(hpkg
, " \"A\" = \"a\" ");
1017 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1019 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~ = \"a\" ");
1020 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1022 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= \"a\" ");
1023 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1025 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= 1 ");
1026 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1028 r
= MsiEvaluateCondition(hpkg
, " \"A\" = 1 ");
1029 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1031 r
= MsiEvaluateCondition(hpkg
, " 1 ~= 1 ");
1032 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1034 r
= MsiEvaluateCondition(hpkg
, " 1 ~= \"1\" ");
1035 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1037 r
= MsiEvaluateCondition(hpkg
, " 1 = \"1\" ");
1038 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1040 r
= MsiEvaluateCondition(hpkg
, " 0 = \"1\" ");
1041 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1043 r
= MsiEvaluateCondition(hpkg
, " 0 < \"100\" ");
1044 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1046 r
= MsiEvaluateCondition(hpkg
, " 100 > \"0\" ");
1047 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1049 r
= MsiEvaluateCondition(hpkg
, "1 XOR 1");
1050 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1052 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1");
1053 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1055 r
= MsiEvaluateCondition(hpkg
, "1 IMP 0");
1056 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1058 r
= MsiEvaluateCondition(hpkg
, "0 IMP 0");
1059 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1061 r
= MsiEvaluateCondition(hpkg
, "0 EQV 0");
1062 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1064 r
= MsiEvaluateCondition(hpkg
, "0 EQV 1");
1065 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1067 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1 OR 0");
1068 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1070 r
= MsiEvaluateCondition(hpkg
, "1 IMPL 1");
1071 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1073 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" >< \"S\" ");
1074 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1076 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"s\" ");
1077 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1079 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"\" ");
1080 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1082 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"sss\" ");
1083 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1085 MsiSetProperty(hpkg
, "mm", "5" );
1087 r
= MsiEvaluateCondition(hpkg
, "mm = 5");
1088 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1090 r
= MsiEvaluateCondition(hpkg
, "mm < 6");
1091 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1093 r
= MsiEvaluateCondition(hpkg
, "mm <= 5");
1094 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1096 r
= MsiEvaluateCondition(hpkg
, "mm > 4");
1097 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1099 r
= MsiEvaluateCondition(hpkg
, "mm < 12");
1100 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1102 r
= MsiEvaluateCondition(hpkg
, "mm = \"5\"");
1103 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1105 r
= MsiEvaluateCondition(hpkg
, "0 = \"\"");
1106 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1108 r
= MsiEvaluateCondition(hpkg
, "0 AND \"\"");
1109 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1111 r
= MsiEvaluateCondition(hpkg
, "1 AND \"\"");
1112 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1114 r
= MsiEvaluateCondition(hpkg
, "1 AND \"1\"");
1115 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1117 r
= MsiEvaluateCondition(hpkg
, "3 >< 1");
1118 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1120 r
= MsiEvaluateCondition(hpkg
, "3 >< 4");
1121 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1123 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 0");
1124 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1126 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1");
1127 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1129 r
= MsiEvaluateCondition(hpkg
, "NOT 1 OR 0");
1130 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1132 r
= MsiEvaluateCondition(hpkg
, "0 AND 1 OR 1");
1133 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1135 r
= MsiEvaluateCondition(hpkg
, "0 AND 0 OR 1");
1136 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1138 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1 OR 0");
1139 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1141 r
= MsiEvaluateCondition(hpkg
, "_1 = _1");
1142 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1144 r
= MsiEvaluateCondition(hpkg
, "( 1 AND 1 ) = 2");
1145 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1147 r
= MsiEvaluateCondition(hpkg
, "NOT ( 1 AND 1 )");
1148 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1150 r
= MsiEvaluateCondition(hpkg
, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1151 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1153 r
= MsiEvaluateCondition(hpkg
, "Installed<>\"\"");
1154 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1156 r
= MsiEvaluateCondition(hpkg
, "NOT 1 AND 0");
1157 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1159 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1160 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1162 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1163 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1165 r
= MsiEvaluateCondition(hpkg
, "bandalmael<0");
1166 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1168 r
= MsiEvaluateCondition(hpkg
, "bandalmael>0");
1169 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1171 r
= MsiEvaluateCondition(hpkg
, "bandalmael>=0");
1172 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1174 r
= MsiEvaluateCondition(hpkg
, "bandalmael<=0");
1175 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1177 r
= MsiEvaluateCondition(hpkg
, "bandalmael~<>0");
1178 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1180 MsiSetProperty(hpkg
, "bandalmael", "0" );
1181 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1182 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1184 MsiSetProperty(hpkg
, "bandalmael", "" );
1185 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1186 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1188 MsiSetProperty(hpkg
, "bandalmael", "asdf" );
1189 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1190 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1192 MsiSetProperty(hpkg
, "bandalmael", "0asdf" );
1193 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1194 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1196 MsiSetProperty(hpkg
, "bandalmael", "0 " );
1197 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1198 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1200 MsiSetProperty(hpkg
, "bandalmael", "-0" );
1201 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1202 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1204 MsiSetProperty(hpkg
, "bandalmael", "0000000000000" );
1205 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1206 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1208 MsiSetProperty(hpkg
, "bandalmael", "--0" );
1209 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1210 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1212 MsiSetProperty(hpkg
, "bandalmael", "0x00" );
1213 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1214 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1216 MsiSetProperty(hpkg
, "bandalmael", "-" );
1217 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1218 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1220 MsiSetProperty(hpkg
, "bandalmael", "+0" );
1221 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1222 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1224 MsiSetProperty(hpkg
, "bandalmael", "0.0" );
1225 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1226 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1227 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1228 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1230 MsiSetProperty(hpkg
, "one", "hi");
1231 MsiSetProperty(hpkg
, "two", "hithere");
1232 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1233 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1235 MsiSetProperty(hpkg
, "one", "hithere");
1236 MsiSetProperty(hpkg
, "two", "hi");
1237 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1238 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1240 MsiSetProperty(hpkg
, "one", "hello");
1241 MsiSetProperty(hpkg
, "two", "hi");
1242 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1243 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1245 MsiSetProperty(hpkg
, "one", "hellohithere");
1246 MsiSetProperty(hpkg
, "two", "hi");
1247 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1248 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1250 MsiSetProperty(hpkg
, "one", "");
1251 MsiSetProperty(hpkg
, "two", "hi");
1252 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1253 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1255 MsiSetProperty(hpkg
, "one", "hi");
1256 MsiSetProperty(hpkg
, "two", "");
1257 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1258 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1260 MsiSetProperty(hpkg
, "one", "");
1261 MsiSetProperty(hpkg
, "two", "");
1262 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1263 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1265 MsiSetProperty(hpkg
, "one", "1234");
1266 MsiSetProperty(hpkg
, "two", "1");
1267 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1268 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1270 MsiSetProperty(hpkg
, "one", "one 1234");
1271 MsiSetProperty(hpkg
, "two", "1");
1272 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1273 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1275 MsiSetProperty(hpkg
, "one", "hithere");
1276 MsiSetProperty(hpkg
, "two", "hi");
1277 r
= MsiEvaluateCondition(hpkg
, "one << two");
1278 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1280 MsiSetProperty(hpkg
, "one", "hi");
1281 MsiSetProperty(hpkg
, "two", "hithere");
1282 r
= MsiEvaluateCondition(hpkg
, "one << two");
1283 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1285 MsiSetProperty(hpkg
, "one", "hi");
1286 MsiSetProperty(hpkg
, "two", "hi");
1287 r
= MsiEvaluateCondition(hpkg
, "one << two");
1288 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1290 MsiSetProperty(hpkg
, "one", "abcdhithere");
1291 MsiSetProperty(hpkg
, "two", "hi");
1292 r
= MsiEvaluateCondition(hpkg
, "one << two");
1293 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1295 MsiSetProperty(hpkg
, "one", "");
1296 MsiSetProperty(hpkg
, "two", "hi");
1297 r
= MsiEvaluateCondition(hpkg
, "one << two");
1298 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1300 MsiSetProperty(hpkg
, "one", "hithere");
1301 MsiSetProperty(hpkg
, "two", "");
1302 r
= MsiEvaluateCondition(hpkg
, "one << two");
1303 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1305 MsiSetProperty(hpkg
, "one", "");
1306 MsiSetProperty(hpkg
, "two", "");
1307 r
= MsiEvaluateCondition(hpkg
, "one << two");
1308 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1310 MsiSetProperty(hpkg
, "one", "1234");
1311 MsiSetProperty(hpkg
, "two", "1");
1312 r
= MsiEvaluateCondition(hpkg
, "one << two");
1313 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1315 MsiSetProperty(hpkg
, "one", "1234 one");
1316 MsiSetProperty(hpkg
, "two", "1");
1317 r
= MsiEvaluateCondition(hpkg
, "one << two");
1318 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1320 MsiSetProperty(hpkg
, "one", "hithere");
1321 MsiSetProperty(hpkg
, "two", "there");
1322 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1323 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1325 MsiSetProperty(hpkg
, "one", "hithere");
1326 MsiSetProperty(hpkg
, "two", "hi");
1327 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1328 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1330 MsiSetProperty(hpkg
, "one", "there");
1331 MsiSetProperty(hpkg
, "two", "hithere");
1332 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1333 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1335 MsiSetProperty(hpkg
, "one", "there");
1336 MsiSetProperty(hpkg
, "two", "there");
1337 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1338 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1340 MsiSetProperty(hpkg
, "one", "abcdhithere");
1341 MsiSetProperty(hpkg
, "two", "hi");
1342 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1343 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1345 MsiSetProperty(hpkg
, "one", "");
1346 MsiSetProperty(hpkg
, "two", "there");
1347 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1348 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1350 MsiSetProperty(hpkg
, "one", "there");
1351 MsiSetProperty(hpkg
, "two", "");
1352 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1353 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1355 MsiSetProperty(hpkg
, "one", "");
1356 MsiSetProperty(hpkg
, "two", "");
1357 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1358 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1360 MsiSetProperty(hpkg
, "one", "1234");
1361 MsiSetProperty(hpkg
, "two", "4");
1362 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1363 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1365 MsiSetProperty(hpkg
, "one", "one 1234");
1366 MsiSetProperty(hpkg
, "two", "4");
1367 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1368 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1370 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", NULL
); /* make sure it's empty */
1372 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1373 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1375 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport > \"1.1.4322\"");
1376 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1378 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport >= \"1.1.4322\"");
1379 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1381 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <= \"1.1.4322\"");
1382 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1384 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <> \"1.1.4322\"");
1385 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1387 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1388 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1390 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"abcd\"");
1391 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1393 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a1.1.4322\"");
1394 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1396 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322a\"");
1397 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1399 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1400 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1402 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1403 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1405 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1406 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1408 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1");
1409 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1411 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1\"");
1412 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1414 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"12.1\"");
1415 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1417 r
= MsiEvaluateCondition(hpkg
, "\"02.1\" < \"2.11\"");
1418 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1420 r
= MsiEvaluateCondition(hpkg
, "\"02.1.1\" < \"2.1\"");
1421 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1423 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1424 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1426 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1427 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1429 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0\"");
1430 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1432 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"-1\"");
1433 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1435 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a\"");
1436 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1438 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1439 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1441 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1442 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1444 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"/\"");
1445 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1447 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \" \"");
1448 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1450 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"azAZ_\"");
1451 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1453 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]\"");
1454 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1456 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]a\"");
1457 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1459 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]\"");
1460 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1462 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]a\"");
1463 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1465 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a}\"");
1466 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1468 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a\"");
1469 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1471 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a\"");
1472 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1474 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a{\"");
1475 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1477 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a]\"");
1478 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1480 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"A\"");
1481 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1483 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", "1.1.4322");
1484 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1485 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1487 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.14322\"");
1488 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1490 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.5\"");
1491 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1493 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1494 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1496 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1497 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1499 MsiSetProperty(hpkg
, "one", "1");
1500 r
= MsiEvaluateCondition(hpkg
, "one < \"1\"");
1501 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1503 MsiSetProperty(hpkg
, "X", "5.0");
1505 r
= MsiEvaluateCondition(hpkg
, "X != \"\"");
1506 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1508 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\"");
1509 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1511 r
= MsiEvaluateCondition(hpkg
, "X =\"5.1\"");
1512 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1514 r
= MsiEvaluateCondition(hpkg
, "X =\"6.0\"");
1515 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1517 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1518 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1520 r
= MsiEvaluateCondition(hpkg
, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1521 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1523 r
= MsiEvaluateCondition(hpkg
, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1524 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1526 /* feature doesn't exist */
1527 r
= MsiEvaluateCondition(hpkg
, "&nofeature");
1528 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1530 MsiSetProperty(hpkg
, "A", "2");
1531 MsiSetProperty(hpkg
, "X", "50");
1533 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1534 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1536 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1537 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1539 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1540 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1542 MsiSetProperty(hpkg
, "X", "50val");
1544 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1545 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1547 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1548 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1550 MsiSetProperty(hpkg
, "A", "7");
1551 MsiSetProperty(hpkg
, "X", "50");
1553 r
= MsiEvaluateCondition(hpkg
, "7 <= X");
1554 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1556 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1557 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1559 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1560 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1562 MsiSetProperty(hpkg
, "X", "50val");
1564 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1565 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1567 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1568 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1570 MsiCloseHandle( hpkg
);
1571 DeleteFile(msifile
);
1574 static BOOL
check_prop_empty( MSIHANDLE hpkg
, const char * prop
)
1582 r
= MsiGetProperty( hpkg
, prop
, buffer
, &sz
);
1583 return r
== ERROR_SUCCESS
&& buffer
[0] == 0 && sz
== 0;
1586 static void test_props(void)
1588 MSIHANDLE hpkg
, hdb
;
1593 hdb
= create_package_db();
1595 "CREATE TABLE `Property` ( "
1596 "`Property` CHAR(255) NOT NULL, "
1597 "`Value` CHAR(255) "
1598 "PRIMARY KEY `Property`)" );
1599 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1602 "INSERT INTO `Property` "
1603 "(`Property`, `Value`) "
1604 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1605 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1607 hpkg
= package_from_db( hdb
);
1608 ok( hpkg
, "failed to create package\n");
1610 /* test invalid values */
1611 r
= MsiGetProperty( 0, NULL
, NULL
, NULL
);
1612 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1614 r
= MsiGetProperty( hpkg
, NULL
, NULL
, NULL
);
1615 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1617 r
= MsiGetProperty( hpkg
, "boo", NULL
, NULL
);
1618 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1620 r
= MsiGetProperty( hpkg
, "boo", buffer
, NULL
);
1621 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1623 /* test retrieving an empty/nonexistent property */
1625 r
= MsiGetProperty( hpkg
, "boo", NULL
, &sz
);
1626 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1627 ok( sz
== 0, "wrong size returned\n");
1629 check_prop_empty( hpkg
, "boo");
1632 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1633 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1634 ok( !strcmp(buffer
,"x"), "buffer was changed\n");
1635 ok( sz
== 0, "wrong size returned\n");
1639 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1640 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1641 ok( buffer
[0] == 0, "buffer was not changed\n");
1642 ok( sz
== 0, "wrong size returned\n");
1644 /* set the property to something */
1645 r
= MsiSetProperty( 0, NULL
, NULL
);
1646 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1648 r
= MsiSetProperty( hpkg
, NULL
, NULL
);
1649 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1651 r
= MsiSetProperty( hpkg
, "", NULL
);
1652 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1654 /* try set and get some illegal property identifiers */
1655 r
= MsiSetProperty( hpkg
, "", "asdf" );
1656 ok( r
== ERROR_FUNCTION_FAILED
, "wrong return val\n");
1658 r
= MsiSetProperty( hpkg
, "=", "asdf" );
1659 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1661 r
= MsiSetProperty( hpkg
, " ", "asdf" );
1662 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1664 r
= MsiSetProperty( hpkg
, "'", "asdf" );
1665 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1669 r
= MsiGetProperty( hpkg
, "'", buffer
, &sz
);
1670 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1671 ok( !strcmp(buffer
,"asdf"), "buffer was not changed\n");
1673 /* set empty values */
1674 r
= MsiSetProperty( hpkg
, "boo", NULL
);
1675 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1676 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1678 r
= MsiSetProperty( hpkg
, "boo", "" );
1679 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1680 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1682 /* set a non-empty value */
1683 r
= MsiSetProperty( hpkg
, "boo", "xyz" );
1684 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1688 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1689 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1690 ok( buffer
[0] == 0, "buffer was not changed\n");
1691 ok( sz
== 3, "wrong size returned\n");
1695 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1696 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1697 ok( !strcmp(buffer
,"xyz"), "buffer was not changed\n");
1698 ok( sz
== 3, "wrong size returned\n");
1702 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1703 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1704 ok( !strcmp(buffer
,"xy"), "buffer was not changed\n");
1705 ok( sz
== 3, "wrong size returned\n");
1707 r
= MsiSetProperty(hpkg
, "SourceDir", "foo");
1708 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1711 r
= MsiGetProperty(hpkg
, "SOURCEDIR", buffer
, &sz
);
1712 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1713 ok( !strcmp(buffer
,""), "buffer wrong\n");
1714 ok( sz
== 0, "wrong size returned\n");
1717 r
= MsiGetProperty(hpkg
, "SOMERANDOMNAME", buffer
, &sz
);
1718 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1719 ok( !strcmp(buffer
,""), "buffer wrong\n");
1720 ok( sz
== 0, "wrong size returned\n");
1723 r
= MsiGetProperty(hpkg
, "SourceDir", buffer
, &sz
);
1724 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1725 ok( !strcmp(buffer
,"foo"), "buffer wrong\n");
1726 ok( sz
== 3, "wrong size returned\n");
1728 r
= MsiSetProperty(hpkg
, "MetadataCompName", "Photoshop.dll");
1729 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1732 r
= MsiGetProperty(hpkg
, "MetadataCompName", NULL
, &sz
);
1733 ok( r
== ERROR_SUCCESS
, "return wrong\n");
1734 ok( sz
== 13, "size wrong (%d)\n", sz
);
1737 r
= MsiGetProperty(hpkg
, "MetadataCompName", buffer
, &sz
);
1738 ok( r
== ERROR_MORE_DATA
, "return wrong\n");
1739 ok( !strcmp(buffer
,"Photoshop.dl"), "buffer wrong\n");
1741 r
= MsiSetProperty(hpkg
, "property", "value");
1742 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1745 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
1746 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1747 ok( !strcmp(buffer
, "value"), "Expected value, got %s\n", buffer
);
1749 r
= MsiSetProperty(hpkg
, "property", NULL
);
1750 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1753 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
1754 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1755 ok( !strlen(buffer
), "Expected empty string, got %s\n", buffer
);
1757 MsiCloseHandle( hpkg
);
1758 DeleteFile(msifile
);
1761 static BOOL
find_prop_in_property(MSIHANDLE hdb
, LPCSTR prop
, LPCSTR val
)
1763 MSIHANDLE hview
, hrec
;
1765 CHAR buffer
[MAX_PATH
];
1769 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
1770 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
1771 r
= MsiViewExecute(hview
, 0);
1772 ok(r
== ERROR_SUCCESS
, "MsiViewExecute failed\n");
1775 while (r
== ERROR_SUCCESS
&& !found
)
1777 r
= MsiViewFetch(hview
, &hrec
);
1778 if (r
!= ERROR_SUCCESS
) break;
1781 r
= MsiRecordGetString(hrec
, 1, buffer
, &sz
);
1782 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, prop
))
1785 r
= MsiRecordGetString(hrec
, 2, buffer
, &sz
);
1786 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, val
))
1790 MsiCloseHandle(hrec
);
1793 MsiViewClose(hview
);
1794 MsiCloseHandle(hview
);
1799 static void test_property_table(void)
1803 MSIHANDLE hpkg
, hdb
, hrec
;
1804 char buffer
[MAX_PATH
];
1808 hdb
= create_package_db();
1809 ok( hdb
, "failed to create package\n");
1811 hpkg
= package_from_db(hdb
);
1812 ok( hpkg
, "failed to create package\n");
1814 MsiCloseHandle(hdb
);
1816 hdb
= MsiGetActiveDatabase(hpkg
);
1818 query
= "CREATE TABLE `_Property` ( "
1819 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1820 r
= run_query(hdb
, query
);
1821 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
1823 MsiCloseHandle(hdb
);
1824 MsiCloseHandle(hpkg
);
1825 DeleteFile(msifile
);
1827 hdb
= create_package_db();
1828 ok( hdb
, "failed to create package\n");
1830 query
= "CREATE TABLE `_Property` ( "
1831 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1832 r
= run_query(hdb
, query
);
1833 ok(r
== ERROR_SUCCESS
, "failed to create table\n");
1835 query
= "ALTER `_Property` ADD `foo` INTEGER";
1836 r
= run_query(hdb
, query
);
1837 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
1839 query
= "ALTER TABLE `_Property` ADD `foo` INTEGER";
1840 r
= run_query(hdb
, query
);
1841 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
1843 query
= "ALTER TABLE `_Property` ADD `extra` INTEGER";
1844 r
= run_query(hdb
, query
);
1845 ok(r
== ERROR_SUCCESS
, "failed to add column\n");
1847 hpkg
= package_from_db(hdb
);
1850 ok(!hpkg
, "package should not be created\n");
1853 MsiCloseHandle(hdb
);
1854 MsiCloseHandle(hpkg
);
1855 DeleteFile(msifile
);
1857 hdb
= create_package_db();
1858 ok (hdb
, "failed to create package database\n");
1860 r
= create_property_table(hdb
);
1861 ok(r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
1863 r
= add_property_entry(hdb
, "'prop', 'val'");
1864 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
1866 hpkg
= package_from_db(hdb
);
1867 ok(hpkg
, "failed to create package\n");
1869 MsiCloseHandle(hdb
);
1872 r
= MsiGetProperty(hpkg
, "prop", buffer
, &sz
);
1873 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1874 ok(!lstrcmp(buffer
, "val"), "Expected val, got %s\n", buffer
);
1876 hdb
= MsiGetActiveDatabase(hpkg
);
1878 found
= find_prop_in_property(hdb
, "prop", "val");
1879 ok(found
, "prop should be in the _Property table\n");
1881 r
= add_property_entry(hdb
, "'dantes', 'mercedes'");
1882 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
1884 query
= "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1885 r
= do_query(hdb
, query
, &hrec
);
1886 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
1888 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
1889 ok(found
== FALSE
, "dantes should not be in the _Property table\n");
1892 lstrcpy(buffer
, "aaa");
1893 r
= MsiGetProperty(hpkg
, "dantes", buffer
, &sz
);
1894 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1895 ok(lstrlenA(buffer
) == 0, "Expected empty string, got %s\n", buffer
);
1897 r
= MsiSetProperty(hpkg
, "dantes", "mercedes");
1898 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1900 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
1901 ok(found
== TRUE
, "dantes should be in the _Property table\n");
1903 MsiCloseHandle(hdb
);
1904 MsiCloseHandle(hpkg
);
1905 DeleteFile(msifile
);
1908 static UINT
try_query_param( MSIHANDLE hdb
, LPCSTR szQuery
, MSIHANDLE hrec
)
1913 res
= MsiDatabaseOpenView( hdb
, szQuery
, &htab
);
1914 if( res
== ERROR_SUCCESS
)
1918 r
= MsiViewExecute( htab
, hrec
);
1919 if( r
!= ERROR_SUCCESS
)
1922 fprintf(stderr
,"MsiViewExecute failed %08x\n", res
);
1925 r
= MsiViewClose( htab
);
1926 if( r
!= ERROR_SUCCESS
)
1929 r
= MsiCloseHandle( htab
);
1930 if( r
!= ERROR_SUCCESS
)
1936 static UINT
try_query( MSIHANDLE hdb
, LPCSTR szQuery
)
1938 return try_query_param( hdb
, szQuery
, 0 );
1941 static void set_summary_str(MSIHANDLE hdb
, DWORD pid
, LPCSTR value
)
1946 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
1947 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1949 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_LPSTR
, 0, NULL
, value
);
1950 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1952 r
= MsiSummaryInfoPersist(summary
);
1953 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1955 MsiCloseHandle(summary
);
1958 static void set_summary_dword(MSIHANDLE hdb
, DWORD pid
, DWORD value
)
1963 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
1964 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1966 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_I4
, value
, NULL
, NULL
);
1967 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1969 r
= MsiSummaryInfoPersist(summary
);
1970 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1972 MsiCloseHandle(summary
);
1975 static void test_msipackage(void)
1977 MSIHANDLE hdb
= 0, hpack
= 100;
1982 /* NULL szPackagePath */
1983 r
= MsiOpenPackage(NULL
, &hpack
);
1984 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
1986 /* empty szPackagePath */
1987 r
= MsiOpenPackage("", &hpack
);
1990 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1993 if (r
== ERROR_SUCCESS
)
1994 MsiCloseHandle(hpack
);
1996 /* nonexistent szPackagePath */
1997 r
= MsiOpenPackage("nonexistent", &hpack
);
1998 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r
);
2001 r
= MsiOpenPackage(msifile
, NULL
);
2002 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2006 r
= MsiOpenPackage(name
, &hpack
);
2007 ok(r
== ERROR_INVALID_HANDLE
, "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
2009 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2010 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2012 /* database exists, but is emtpy */
2013 sprintf(name
, "#%ld", hdb
);
2014 r
= MsiOpenPackage(name
, &hpack
);
2015 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2016 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2018 query
= "CREATE TABLE `Property` ( "
2019 "`Property` CHAR(72), `Value` CHAR(0) "
2020 "PRIMARY KEY `Property`)";
2021 r
= try_query(hdb
, query
);
2022 ok(r
== ERROR_SUCCESS
, "failed to create Properties table\n");
2024 query
= "CREATE TABLE `InstallExecuteSequence` ("
2025 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2026 "PRIMARY KEY `Action`)";
2027 r
= try_query(hdb
, query
);
2028 ok(r
== ERROR_SUCCESS
, "failed to create InstallExecuteSequence table\n");
2030 /* a few key tables exist */
2031 sprintf(name
, "#%ld", hdb
);
2032 r
= MsiOpenPackage(name
, &hpack
);
2033 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2034 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2036 MsiCloseHandle(hdb
);
2037 DeleteFile(msifile
);
2039 /* start with a clean database to show what constitutes a valid package */
2040 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2041 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2043 sprintf(name
, "#%ld", hdb
);
2045 /* The following summary information props must exist:
2050 set_summary_dword(hdb
, PID_PAGECOUNT
, 100);
2051 r
= MsiOpenPackage(name
, &hpack
);
2052 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2053 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2055 set_summary_str(hdb
, PID_REVNUMBER
, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2056 r
= MsiOpenPackage(name
, &hpack
);
2057 ok(r
== ERROR_SUCCESS
,
2058 "Expected ERROR_SUCCESS, got %d\n", r
);
2060 MsiCloseHandle(hpack
);
2061 MsiCloseHandle(hdb
);
2062 DeleteFile(msifile
);
2065 static void test_formatrecord2(void)
2067 MSIHANDLE hpkg
, hrec
;
2072 hpkg
= package_from_db(create_package_db());
2073 ok( hpkg
, "failed to create package\n");
2075 r
= MsiSetProperty(hpkg
, "Manufacturer", " " );
2076 ok( r
== ERROR_SUCCESS
, "set property failed\n");
2078 hrec
= MsiCreateRecord(2);
2079 ok(hrec
, "create record failed\n");
2081 r
= MsiRecordSetString( hrec
, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2082 ok( r
== ERROR_SUCCESS
, "format record failed\n");
2086 r
= MsiFormatRecord( hpkg
, hrec
, buffer
, &sz
);
2088 r
= MsiRecordSetString(hrec
, 0, "[foo][1]");
2089 r
= MsiRecordSetString(hrec
, 1, "hoo");
2091 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2092 ok( sz
== 3, "size wrong\n");
2093 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2094 ok( r
== ERROR_SUCCESS
, "format failed\n");
2096 r
= MsiRecordSetString(hrec
, 0, "x[~]x");
2098 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2099 ok( sz
== 3, "size wrong\n");
2100 ok( 0 == strcmp(buffer
,"x"), "wrong output %s\n",buffer
);
2101 ok( r
== ERROR_SUCCESS
, "format failed\n");
2103 r
= MsiRecordSetString(hrec
, 0, "[foo.$%}][1]");
2104 r
= MsiRecordSetString(hrec
, 1, "hoo");
2106 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2107 ok( sz
== 3, "size wrong\n");
2108 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2109 ok( r
== ERROR_SUCCESS
, "format failed\n");
2111 r
= MsiRecordSetString(hrec
, 0, "[\\[]");
2113 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2114 ok( sz
== 1, "size wrong\n");
2115 ok( 0 == strcmp(buffer
,"["), "wrong output %s\n",buffer
);
2116 ok( r
== ERROR_SUCCESS
, "format failed\n");
2118 SetEnvironmentVariable("FOO", "BAR");
2119 r
= MsiRecordSetString(hrec
, 0, "[%FOO]");
2121 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2122 ok( sz
== 3, "size wrong\n");
2123 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2124 ok( r
== ERROR_SUCCESS
, "format failed\n");
2126 r
= MsiRecordSetString(hrec
, 0, "[[1]]");
2127 r
= MsiRecordSetString(hrec
, 1, "%FOO");
2129 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2130 ok( sz
== 3, "size wrong\n");
2131 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2132 ok( r
== ERROR_SUCCESS
, "format failed\n");
2134 MsiCloseHandle( hrec
);
2135 MsiCloseHandle( hpkg
);
2136 DeleteFile(msifile
);
2139 static void test_states(void)
2144 INSTALLSTATE state
, action
;
2146 static const CHAR msifile2
[] = "winetest2.msi";
2147 static const CHAR msifile3
[] = "winetest3.msi";
2149 hdb
= create_package_db();
2150 ok ( hdb
, "failed to create package database\n" );
2152 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
2153 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
2155 r
= create_property_table( hdb
);
2156 ok( r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2158 r
= add_property_entry( hdb
, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2159 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2161 r
= add_property_entry( hdb
, "'ProductLanguage', '1033'" );
2162 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2164 r
= add_property_entry( hdb
, "'ProductName', 'MSITEST'" );
2165 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2167 r
= add_property_entry( hdb
, "'ProductVersion', '1.1.1'" );
2168 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2170 r
= create_install_execute_sequence_table( hdb
);
2171 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table: %d\n", r
);
2173 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
2174 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2176 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
2177 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2179 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
2180 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2182 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1400'" );
2183 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2185 r
= add_install_execute_sequence_entry( hdb
, "'InstallInitialize', '', '1500'" );
2186 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2188 r
= add_install_execute_sequence_entry( hdb
, "'ProcessComponents', '', '1600'" );
2189 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2191 r
= add_install_execute_sequence_entry( hdb
, "'UnpublishFeatures', '', '1800'" );
2192 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2194 r
= add_install_execute_sequence_entry( hdb
, "'RegisterProduct', '', '6100'" );
2195 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2197 r
= add_install_execute_sequence_entry( hdb
, "'PublishFeatures', '', '6300'" );
2198 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2200 r
= add_install_execute_sequence_entry( hdb
, "'PublishProduct', '', '6400'" );
2201 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2203 r
= add_install_execute_sequence_entry( hdb
, "'InstallFinalize', '', '6600'" );
2204 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2206 r
= create_media_table( hdb
);
2207 ok( r
== ERROR_SUCCESS
, "cannot create media table: %d\n", r
);
2209 r
= add_media_entry( hdb
, "'1', '3', '', '', 'DISK1', ''");
2210 ok( r
== ERROR_SUCCESS
, "cannot add media entry: %d\n", r
);
2212 r
= create_feature_table( hdb
);
2213 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
2215 r
= create_component_table( hdb
);
2216 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
2218 /* msidbFeatureAttributesFavorLocal */
2219 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
2220 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2222 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2223 r
= add_component_entry( hdb
, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2224 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2226 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2227 r
= add_component_entry( hdb
, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2228 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2230 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2231 r
= add_component_entry( hdb
, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2232 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2234 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2235 r
= add_component_entry( hdb
, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2236 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2238 /* msidbFeatureAttributesFavorSource */
2239 r
= add_feature_entry( hdb
, "'two', '', '', '', 2, 1, '', 1" );
2240 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2242 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2243 r
= add_component_entry( hdb
, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2244 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2246 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2247 r
= add_component_entry( hdb
, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2248 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2250 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2251 r
= add_component_entry( hdb
, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2252 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2254 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2255 r
= add_component_entry( hdb
, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2256 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2258 /* msidbFeatureAttributesFavorSource */
2259 r
= add_feature_entry( hdb
, "'three', '', '', '', 2, 1, '', 1" );
2260 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2262 /* msidbFeatureAttributesFavorLocal */
2263 r
= add_feature_entry( hdb
, "'four', '', '', '', 2, 1, '', 0" );
2264 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2267 r
= add_feature_entry( hdb
, "'five', '', '', '', 2, 0, '', 1" );
2268 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2270 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2271 r
= add_component_entry( hdb
, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2272 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2274 /* no feature parent:msidbComponentAttributesLocalOnly */
2275 r
= add_component_entry( hdb
, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2276 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2278 /* msidbFeatureAttributesFavorLocal:removed */
2279 r
= add_feature_entry( hdb
, "'six', '', '', '', 2, 1, '', 0" );
2280 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2282 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2283 r
= add_component_entry( hdb
, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2284 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2286 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2287 r
= add_component_entry( hdb
, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2288 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2290 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2291 r
= add_component_entry( hdb
, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2292 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2294 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2295 r
= add_component_entry( hdb
, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2296 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2298 /* msidbFeatureAttributesFavorSource:removed */
2299 r
= add_feature_entry( hdb
, "'seven', '', '', '', 2, 1, '', 1" );
2300 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2302 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2303 r
= add_component_entry( hdb
, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2304 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2306 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2307 r
= add_component_entry( hdb
, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2308 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2310 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2311 r
= add_component_entry( hdb
, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2312 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2314 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2315 r
= add_component_entry( hdb
, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2316 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2318 r
= create_feature_components_table( hdb
);
2319 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
2321 r
= add_feature_components_entry( hdb
, "'one', 'alpha'" );
2322 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2324 r
= add_feature_components_entry( hdb
, "'one', 'beta'" );
2325 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2327 r
= add_feature_components_entry( hdb
, "'one', 'gamma'" );
2328 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2330 r
= add_feature_components_entry( hdb
, "'one', 'theta'" );
2331 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2333 r
= add_feature_components_entry( hdb
, "'two', 'delta'" );
2334 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2336 r
= add_feature_components_entry( hdb
, "'two', 'epsilon'" );
2337 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2339 r
= add_feature_components_entry( hdb
, "'two', 'zeta'" );
2340 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2342 r
= add_feature_components_entry( hdb
, "'two', 'iota'" );
2343 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2345 r
= add_feature_components_entry( hdb
, "'three', 'eta'" );
2346 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2348 r
= add_feature_components_entry( hdb
, "'four', 'eta'" );
2349 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2351 r
= add_feature_components_entry( hdb
, "'five', 'eta'" );
2352 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2354 r
= add_feature_components_entry( hdb
, "'six', 'lambda'" );
2355 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2357 r
= add_feature_components_entry( hdb
, "'six', 'mu'" );
2358 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2360 r
= add_feature_components_entry( hdb
, "'six', 'nu'" );
2361 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2363 r
= add_feature_components_entry( hdb
, "'six', 'xi'" );
2364 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2366 r
= add_feature_components_entry( hdb
, "'seven', 'omicron'" );
2367 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2369 r
= add_feature_components_entry( hdb
, "'seven', 'pi'" );
2370 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2372 r
= add_feature_components_entry( hdb
, "'seven', 'rho'" );
2373 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2375 r
= add_feature_components_entry( hdb
, "'seven', 'sigma'" );
2376 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2378 r
= create_file_table( hdb
);
2379 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
2381 r
= add_file_entry( hdb
, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2382 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2384 r
= add_file_entry( hdb
, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2385 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2387 r
= add_file_entry( hdb
, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2388 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2390 r
= add_file_entry( hdb
, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2391 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2393 r
= add_file_entry( hdb
, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2394 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2396 r
= add_file_entry( hdb
, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2397 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2399 r
= add_file_entry( hdb
, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2400 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2402 r
= add_file_entry( hdb
, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2403 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2405 /* compressed file */
2406 r
= add_file_entry( hdb
, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2407 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2409 r
= add_file_entry( hdb
, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2410 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2412 r
= add_file_entry( hdb
, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2413 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2415 r
= add_file_entry( hdb
, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2416 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2418 r
= add_file_entry( hdb
, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2419 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2421 r
= add_file_entry( hdb
, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2422 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2424 r
= add_file_entry( hdb
, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2425 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2427 r
= add_file_entry( hdb
, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2428 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2430 r
= add_file_entry( hdb
, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2431 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2433 r
= add_file_entry( hdb
, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2434 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2436 MsiDatabaseCommit(hdb
);
2438 /* these properties must not be in the saved msi file */
2439 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
2440 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2442 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
2443 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2445 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
2446 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2448 hpkg
= package_from_db( hdb
);
2449 ok( hpkg
, "failed to create package\n");
2451 MsiCloseHandle(hdb
);
2453 CopyFileA(msifile
, msifile2
, FALSE
);
2454 CopyFileA(msifile
, msifile3
, FALSE
);
2458 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2459 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2460 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2461 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2465 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2466 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2467 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2468 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2472 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2473 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2474 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2475 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2479 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2480 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2481 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2482 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2486 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2487 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2488 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2489 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2493 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2494 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2495 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2496 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2500 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2501 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2502 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2503 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2507 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2508 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2509 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2510 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2514 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2515 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2516 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2517 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2521 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2522 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2523 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2524 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2528 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2529 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2530 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2531 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2535 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2536 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2537 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2538 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2542 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2543 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2544 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2545 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2549 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2550 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2551 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2552 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2556 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2557 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2558 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2559 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2563 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2564 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2565 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2566 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2570 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2571 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2572 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2573 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2577 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2578 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2579 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2580 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2584 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2585 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2586 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2587 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2591 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2592 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2593 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2594 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2598 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2599 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2600 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2601 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2605 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
2606 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2607 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2608 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2612 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
2613 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2614 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2615 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2619 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
2620 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2621 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2622 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2626 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
2627 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2628 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2629 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2631 r
= MsiDoAction( hpkg
, "CostInitialize");
2632 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
2636 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2637 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2638 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2639 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2643 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2644 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2645 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2646 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2650 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2651 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2652 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2653 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2657 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2658 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2659 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2660 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2664 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2665 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2666 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2667 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2671 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2672 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2673 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2674 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2678 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2679 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2680 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2681 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2685 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2686 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2687 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2688 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2692 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2693 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2694 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2695 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2699 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2700 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2701 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2702 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2706 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2707 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2708 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2709 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2713 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2714 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2715 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2716 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2720 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2721 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2722 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2723 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2727 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2728 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2729 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2730 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2734 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2735 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2736 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2737 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2741 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2742 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2743 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2744 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2748 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2749 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2750 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2751 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2755 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2756 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2757 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2758 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2762 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2763 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2764 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2765 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2769 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2770 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2771 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2772 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2776 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2777 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2778 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2779 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2783 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
2784 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2785 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2786 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2790 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
2791 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2792 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2793 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2797 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
2798 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2799 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2800 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2804 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
2805 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2806 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2807 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2809 r
= MsiDoAction( hpkg
, "FileCost");
2810 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
2814 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2815 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2816 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2817 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2821 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2822 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2823 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2824 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2828 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2829 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2830 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2831 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2835 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2836 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2837 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2838 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2842 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2843 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2844 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2845 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2849 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2850 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2851 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2852 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2856 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2857 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2858 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2859 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2863 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2864 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2865 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2866 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2870 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2871 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2872 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2873 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2877 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2878 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2879 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2880 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2884 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2885 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2886 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2887 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2891 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2892 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2893 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2894 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2898 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2899 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2900 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2901 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2905 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2906 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2907 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2908 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2912 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2913 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2914 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2915 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2919 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2920 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2921 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2922 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2926 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2927 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2928 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2929 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2933 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2934 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2935 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2936 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2940 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2941 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2942 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2943 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2947 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2948 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2949 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2950 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2954 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2955 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2956 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2957 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2961 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
2962 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2963 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2964 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2968 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
2969 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2970 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2971 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2975 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
2976 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2977 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2978 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2982 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
2983 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2984 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2985 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2987 r
= MsiDoAction( hpkg
, "CostFinalize");
2988 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
2992 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2993 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2994 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
2995 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
2999 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3000 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3001 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3002 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3006 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3007 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3008 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3009 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3013 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3014 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3015 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3016 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3020 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3021 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3022 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3023 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3027 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3028 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3029 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3030 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3034 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3035 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3036 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3037 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3041 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3042 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3043 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3044 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3048 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3049 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3050 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3051 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3055 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3056 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3057 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3058 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3062 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3063 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3064 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3065 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3069 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3070 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3071 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3072 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3076 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3077 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3078 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3079 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3083 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3084 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3085 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3086 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3090 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3091 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3092 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3093 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3097 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3098 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3099 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3100 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3104 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3105 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3106 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3107 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3111 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3112 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3113 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3114 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3118 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3119 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3120 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3121 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3125 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3126 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3127 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3128 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3132 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3133 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3134 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3135 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3139 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3140 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3141 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3142 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3146 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3147 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3148 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3149 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3153 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3154 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3155 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3156 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3160 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3161 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3162 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3163 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3165 MsiCloseHandle( hpkg
);
3167 /* publish the features and components */
3168 r
= MsiInstallProduct(msifile
, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3169 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3171 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
3172 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3174 /* these properties must not be in the saved msi file */
3175 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
3176 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3178 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
3179 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3181 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
3182 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3184 hpkg
= package_from_db( hdb
);
3185 ok( hpkg
, "failed to create package\n");
3187 MsiCloseHandle(hdb
);
3191 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3192 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3193 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3194 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3198 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3199 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3200 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3201 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3205 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3206 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3207 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3208 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3212 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3213 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3214 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3215 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3219 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3220 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3221 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3222 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3226 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3227 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3228 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3229 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3233 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3234 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3235 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3236 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3240 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3241 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3242 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3243 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3247 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3248 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3249 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3250 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3254 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3255 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3256 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3257 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3261 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3262 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3263 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3264 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3268 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3269 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3270 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3271 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3275 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3276 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3277 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3278 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3282 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3283 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3284 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3285 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3289 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3290 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3291 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3292 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3296 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3297 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3298 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3299 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3303 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3304 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3305 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3306 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3310 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3311 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3312 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3313 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3317 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3318 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3319 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3320 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3324 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3325 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3326 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3327 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3331 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3332 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3333 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3334 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3338 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3339 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3340 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3341 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3345 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3346 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3347 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3348 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3352 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3353 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3354 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3355 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3359 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3360 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3361 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3362 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3364 r
= MsiDoAction( hpkg
, "CostInitialize");
3365 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3369 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3370 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3371 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3372 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3376 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3377 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3378 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3379 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3383 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3384 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3385 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3386 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3390 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3391 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3392 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3393 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3397 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3398 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3399 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3400 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3404 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3405 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3406 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3407 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3411 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3412 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3413 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3414 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3418 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3419 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3420 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3421 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3425 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3426 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3427 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3428 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3432 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3433 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3434 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3435 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3439 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3440 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3441 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3442 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3446 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3447 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3448 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3449 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3453 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3454 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3455 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3456 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3460 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3461 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3462 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3463 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3467 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3468 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3469 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3470 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3474 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3475 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3476 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3477 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3481 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3482 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3483 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3484 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3488 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3489 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3490 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3491 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3495 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3496 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3497 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3498 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3502 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3503 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3504 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3505 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3509 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3510 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3511 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3512 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3516 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3517 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3518 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3519 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3523 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3524 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3525 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3526 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3530 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3531 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3532 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3533 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3537 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3538 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3539 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3540 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3542 r
= MsiDoAction( hpkg
, "FileCost");
3543 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3547 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3548 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3549 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3550 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3554 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3555 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3556 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3557 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3561 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3562 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3563 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3564 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3568 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3569 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3570 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3571 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3575 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3576 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3577 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3578 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3582 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3583 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3584 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3585 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3589 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3590 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3591 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3592 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3596 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3597 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3598 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3599 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3603 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3604 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3605 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3606 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3610 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3611 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3612 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3613 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3617 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3618 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3619 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3620 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3624 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3625 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3626 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3627 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3631 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3632 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3633 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3634 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3638 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3639 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3640 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3641 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3645 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3646 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3647 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3648 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3652 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3653 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3654 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3655 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3659 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3660 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3661 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3662 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3666 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3667 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3668 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3669 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3673 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3674 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3675 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3676 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3680 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3681 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3682 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3683 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3687 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3688 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3689 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3690 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3694 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3695 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3696 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3697 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3701 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3702 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3703 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3704 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3708 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3709 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3710 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3711 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3715 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3716 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3717 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3718 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3720 r
= MsiDoAction( hpkg
, "CostFinalize");
3721 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3725 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3726 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3727 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3728 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3732 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3733 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3734 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3735 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3739 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3740 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3741 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3742 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3746 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3747 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3748 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3749 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3753 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3754 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3755 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3756 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3760 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3761 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3762 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3763 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3767 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3768 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3769 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3770 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3774 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3775 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3776 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3777 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3781 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3782 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3783 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3784 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3788 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3789 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3790 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3791 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3795 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3796 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3797 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3798 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3802 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3803 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3804 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3805 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3809 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3810 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3811 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3812 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3816 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3817 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3818 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3819 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3823 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3824 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3825 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3826 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3830 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3831 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3832 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3833 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3837 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3838 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3839 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3840 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3844 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3845 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3846 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3847 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3851 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3852 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3853 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3854 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3858 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3859 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3860 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3861 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3865 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3866 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3867 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3868 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3872 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3873 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3874 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3875 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3879 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3880 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3881 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3882 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3886 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3887 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3888 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3889 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3893 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3894 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3895 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3896 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3898 MsiCloseHandle(hpkg
);
3900 /* uninstall the product */
3901 r
= MsiInstallProduct(msifile
, "REMOVE=ALL");
3902 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3904 /* all features installed locally */
3905 r
= MsiInstallProduct(msifile2
, "ADDLOCAL=ALL");
3906 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3908 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_DIRECT
, &hdb
);
3909 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3911 /* these properties must not be in the saved msi file */
3912 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,two,three,four,five,six,seven'");
3913 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3915 hpkg
= package_from_db( hdb
);
3916 ok( hpkg
, "failed to create package\n");
3920 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3921 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3922 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3923 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3927 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3928 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3929 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3930 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3934 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3935 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3936 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3937 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3941 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3942 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3943 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3944 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3948 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3949 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3950 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3951 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3955 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3956 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3957 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3958 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3962 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3963 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3964 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3965 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3969 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3970 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3971 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3972 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3976 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3977 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3978 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3979 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3983 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3984 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3985 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3986 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3990 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3991 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3992 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3993 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3997 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3998 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3999 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4000 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4004 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4005 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4006 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4007 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4011 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4012 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4013 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4014 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4018 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4019 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4020 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4021 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4025 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4026 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4027 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4028 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4032 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4033 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4034 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4035 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4039 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4040 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4041 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4042 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4046 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4047 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4048 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4049 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4053 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4054 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4055 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4056 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4060 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4061 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4062 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4063 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4067 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4068 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4069 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4070 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4074 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4075 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4076 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4077 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4081 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4082 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4083 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4084 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4088 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4089 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4090 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4091 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4093 r
= MsiDoAction( hpkg
, "CostInitialize");
4094 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4098 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4099 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4100 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4101 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4105 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4106 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4107 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4108 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4112 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4113 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4114 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4115 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4119 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4120 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4121 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4122 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4126 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4127 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4128 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4129 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4133 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4134 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4135 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4136 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4140 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4141 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4142 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4143 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4147 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4148 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4149 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4150 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4154 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4155 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4156 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4157 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4161 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4162 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4163 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4164 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4168 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4169 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4170 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4171 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4175 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4176 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4177 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4178 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4182 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4183 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4184 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4185 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4189 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4190 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4191 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4192 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4196 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4197 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4198 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4199 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4203 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4204 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4205 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4206 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4210 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4211 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4212 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4213 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4217 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4218 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4219 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4220 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4224 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4225 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4226 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4227 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4231 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4232 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4233 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4234 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4238 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4239 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4240 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4241 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4245 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4246 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4247 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4248 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4252 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4253 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4254 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4255 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4259 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4260 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4261 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4262 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4266 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4267 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4268 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4269 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4271 r
= MsiDoAction( hpkg
, "FileCost");
4272 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
4276 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4277 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4278 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4279 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4283 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4284 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4285 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4286 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4290 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4291 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4292 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4293 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4297 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4298 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4299 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4300 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4304 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4305 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4306 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4307 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4311 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4312 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4313 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4314 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4318 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4319 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4320 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4321 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4325 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4326 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4327 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4328 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4332 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4333 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4334 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4335 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4339 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4340 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4341 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4342 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4346 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4347 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4348 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4349 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4353 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4354 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4355 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4356 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4360 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4361 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4362 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4363 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4367 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4368 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4369 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4370 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4374 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4375 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4376 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4377 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4381 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4382 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4383 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4384 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4388 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4389 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4390 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4391 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4395 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4396 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4397 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4398 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4402 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4403 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4404 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4405 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4409 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4410 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4411 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4412 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4416 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4417 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4418 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4419 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4423 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4424 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4425 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4426 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4430 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4431 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4432 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4433 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4437 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4438 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4439 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4440 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4444 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4445 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4446 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4447 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4449 r
= MsiDoAction( hpkg
, "CostFinalize");
4450 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4454 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4455 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4456 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4457 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4461 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4462 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4463 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4464 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4468 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4469 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4470 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4471 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4475 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4476 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4477 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4478 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4482 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4483 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4484 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4485 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4489 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4490 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4491 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4492 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4496 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4497 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4498 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4499 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4503 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4504 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4505 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4506 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4510 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4511 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4512 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4513 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4517 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4518 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4519 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4520 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4524 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4525 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4526 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4527 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4531 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4532 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4533 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4534 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4538 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4539 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4540 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4541 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4545 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4546 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4547 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4548 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4552 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4553 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4554 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4555 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4559 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4560 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4561 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4562 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4566 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4567 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4568 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4569 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4573 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4574 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4575 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4576 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4580 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4581 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4582 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4583 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4587 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4588 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4589 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4590 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4594 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4595 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4596 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4597 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4601 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4602 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4603 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4604 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4608 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4609 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4610 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4611 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4615 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4616 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4617 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4618 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4622 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4623 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4624 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4625 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4627 MsiCloseHandle(hpkg
);
4629 /* uninstall the product */
4630 r
= MsiInstallProduct(msifile2
, "REMOVE=ALL");
4631 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4633 /* all features installed from source */
4634 r
= MsiInstallProduct(msifile3
, "ADDSOURCE=ALL");
4635 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4637 r
= MsiOpenDatabase(msifile3
, MSIDBOPEN_DIRECT
, &hdb
);
4638 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4640 /* this property must not be in the saved msi file */
4641 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven'");
4642 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4644 hpkg
= package_from_db( hdb
);
4645 ok( hpkg
, "failed to create package\n");
4649 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4650 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4651 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4652 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4656 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4657 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4658 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4659 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4663 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4664 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4665 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4666 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4670 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4671 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4672 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4673 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4677 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4678 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4679 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4680 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4684 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4685 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4686 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4687 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4691 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4692 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4693 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4694 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4698 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4699 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4700 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4701 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4705 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4706 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4707 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4708 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4712 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4713 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4714 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4715 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4719 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4720 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4721 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4722 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4726 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4727 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4728 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4729 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4733 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4734 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4735 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4736 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4740 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4741 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4742 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4743 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4747 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4748 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4749 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4750 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4754 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4755 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4756 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4757 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4761 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4762 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4763 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4764 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4768 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4769 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4770 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4771 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4775 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4776 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4777 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4778 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4782 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4783 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4784 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4785 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4789 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4790 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4791 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4792 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4796 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4797 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4798 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4799 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4803 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4804 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4805 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4806 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4810 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4811 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4812 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4813 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4817 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4818 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4819 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4820 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4822 r
= MsiDoAction( hpkg
, "CostInitialize");
4823 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4827 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4828 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4829 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4830 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4834 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4835 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4836 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4837 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4841 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4842 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4843 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4844 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4848 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4849 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4850 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4851 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4855 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4856 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4857 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4858 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4862 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4863 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4864 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4865 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4869 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4870 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4871 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4872 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4876 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4877 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4878 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4879 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4883 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4884 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4885 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4886 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4890 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4891 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4892 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4893 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4897 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4898 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4899 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4900 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4904 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4905 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4906 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4907 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4911 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4912 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4913 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4914 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4918 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4919 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4920 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4921 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4925 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4926 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4927 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4928 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4932 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4933 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4934 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4935 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4939 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4940 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4941 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4942 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4946 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4947 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4948 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4949 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4953 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4954 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4955 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4956 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4960 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4961 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4962 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4963 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4967 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4968 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4969 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4970 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4974 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4975 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4976 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4977 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4981 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4982 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4983 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4984 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4988 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4989 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4990 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4991 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4995 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4996 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4997 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4998 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5000 r
= MsiDoAction( hpkg
, "FileCost");
5001 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5005 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5006 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5007 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5008 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5012 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5013 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5014 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5015 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5019 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5020 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5021 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5022 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5026 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5027 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5028 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5029 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5033 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5034 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5035 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5036 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5040 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5041 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5042 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5043 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5047 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5048 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5049 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5050 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5054 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5055 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5056 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5057 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5061 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5062 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5063 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5064 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5068 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5069 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5070 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5071 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5075 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5076 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5077 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5078 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5082 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5083 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5084 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5085 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5089 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5090 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5091 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5092 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5096 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5097 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5098 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5099 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5103 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5104 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5105 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5106 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5110 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5111 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5112 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5113 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5117 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5118 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5119 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5120 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5124 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5125 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5126 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5127 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5131 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5132 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5133 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5134 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5138 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5139 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5140 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5141 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5145 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5146 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5147 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5148 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5152 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5153 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5154 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5155 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5159 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5160 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5161 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5162 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5166 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5167 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5168 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5169 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5173 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5174 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5175 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5176 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5178 r
= MsiDoAction( hpkg
, "CostFinalize");
5179 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5183 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5184 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5185 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5186 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5190 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5191 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5192 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5193 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5197 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5198 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5199 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5200 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5204 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5205 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5206 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5207 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5211 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5212 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5213 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5214 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5218 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5219 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5220 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5221 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5225 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5226 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5227 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5228 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5232 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5233 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5234 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5235 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5239 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5240 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5241 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5242 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5246 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5247 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5248 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5249 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5253 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5254 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5255 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5256 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5260 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5261 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5262 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5263 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5267 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5268 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5269 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5270 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5274 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5275 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5276 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5277 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5281 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5282 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5283 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5284 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5288 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5289 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5290 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5291 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5295 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5296 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5297 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5298 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5302 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5303 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5304 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5305 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5309 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5310 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5311 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5312 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5316 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5317 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5318 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5319 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5323 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5324 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5325 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5326 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5330 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5331 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5332 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5333 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5337 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5338 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5339 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5340 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5344 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5345 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5346 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5347 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5351 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5352 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5353 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5354 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5356 MsiCloseHandle(hpkg
);
5358 /* uninstall the product */
5359 r
= MsiInstallProduct(msifile3
, "REMOVE=ALL");
5360 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5362 DeleteFileA(msifile
);
5363 DeleteFileA(msifile2
);
5364 DeleteFileA(msifile3
);
5367 static void test_getproperty(void)
5369 MSIHANDLE hPackage
= 0;
5371 static CHAR empty
[] = "";
5375 hPackage
= package_from_db(create_package_db());
5376 ok( hPackage
!= 0, " Failed to create package\n");
5378 /* set the property */
5379 r
= MsiSetProperty(hPackage
, "Name", "Value");
5380 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5382 /* retrieve the size, NULL pointer */
5384 r
= MsiGetProperty(hPackage
, "Name", NULL
, &size
);
5385 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5386 ok( size
== 5, "Expected 5, got %d\n", size
);
5388 /* retrieve the size, empty string */
5390 r
= MsiGetProperty(hPackage
, "Name", empty
, &size
);
5391 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
5392 ok( size
== 5, "Expected 5, got %d\n", size
);
5394 /* don't change size */
5395 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
5396 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
5397 ok( size
== 5, "Expected 5, got %d\n", size
);
5398 ok( !lstrcmp(prop
, "Valu"), "Expected Valu, got %s\n", prop
);
5400 /* increase the size by 1 */
5402 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
5403 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5404 ok( size
== 5, "Expected 5, got %d\n", size
);
5405 ok( !lstrcmp(prop
, "Value"), "Expected Value, got %s\n", prop
);
5407 r
= MsiCloseHandle( hPackage
);
5408 ok( r
== ERROR_SUCCESS
, "Failed to close package\n" );
5409 DeleteFile(msifile
);
5412 static void test_removefiles(void)
5418 hdb
= create_package_db();
5419 ok ( hdb
, "failed to create package database\n" );
5421 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
5422 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
5424 r
= create_feature_table( hdb
);
5425 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
5427 r
= create_component_table( hdb
);
5428 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
5430 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
5431 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5433 r
= add_component_entry( hdb
, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
5434 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5436 r
= add_component_entry( hdb
, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
5437 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5439 r
= add_component_entry( hdb
, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
5440 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5442 r
= add_component_entry( hdb
, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
5443 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5445 r
= add_component_entry( hdb
, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
5446 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5448 r
= add_component_entry( hdb
, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
5449 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5451 r
= create_feature_components_table( hdb
);
5452 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
5454 r
= add_feature_components_entry( hdb
, "'one', 'hydrogen'" );
5455 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5457 r
= add_feature_components_entry( hdb
, "'one', 'helium'" );
5458 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5460 r
= add_feature_components_entry( hdb
, "'one', 'lithium'" );
5461 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5463 r
= add_feature_components_entry( hdb
, "'one', 'beryllium'" );
5464 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5466 r
= add_feature_components_entry( hdb
, "'one', 'boron'" );
5467 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5469 r
= add_feature_components_entry( hdb
, "'one', 'carbon'" );
5470 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5472 r
= create_file_table( hdb
);
5473 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
5475 r
= add_file_entry( hdb
, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
5476 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5478 r
= add_file_entry( hdb
, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
5479 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5481 r
= add_file_entry( hdb
, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
5482 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5484 r
= add_file_entry( hdb
, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
5485 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5487 r
= add_file_entry( hdb
, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
5488 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5490 r
= add_file_entry( hdb
, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
5491 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5493 r
= create_remove_file_table( hdb
);
5494 ok( r
== ERROR_SUCCESS
, "cannot create Remove File table: %d\n", r
);
5496 hpkg
= package_from_db( hdb
);
5497 ok( hpkg
, "failed to create package\n");
5499 MsiCloseHandle( hdb
);
5501 create_test_file( "hydrogen.txt" );
5502 create_test_file( "helium.txt" );
5503 create_test_file( "lithium.txt" );
5504 create_test_file( "beryllium.txt" );
5505 create_test_file( "boron.txt" );
5506 create_test_file( "carbon.txt" );
5508 r
= MsiSetProperty( hpkg
, "TARGETDIR", CURR_DIR
);
5509 ok( r
== ERROR_SUCCESS
, "set property failed\n");
5511 r
= MsiDoAction( hpkg
, "CostInitialize");
5512 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5514 r
= MsiDoAction( hpkg
, "FileCost");
5515 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5517 r
= MsiDoAction( hpkg
, "CostFinalize");
5518 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5520 r
= MsiDoAction( hpkg
, "InstallValidate");
5521 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5523 r
= MsiSetComponentState( hpkg
, "hydrogen", INSTALLSTATE_ABSENT
);
5524 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5526 r
= MsiSetComponentState( hpkg
, "helium", INSTALLSTATE_LOCAL
);
5527 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5529 r
= MsiSetComponentState( hpkg
, "lithium", INSTALLSTATE_SOURCE
);
5530 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5532 r
= MsiSetComponentState( hpkg
, "beryllium", INSTALLSTATE_ABSENT
);
5533 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5535 r
= MsiSetComponentState( hpkg
, "boron", INSTALLSTATE_LOCAL
);
5536 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5538 r
= MsiSetComponentState( hpkg
, "carbon", INSTALLSTATE_SOURCE
);
5539 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5541 r
= MsiDoAction( hpkg
, "RemoveFiles");
5542 ok( r
== ERROR_SUCCESS
, "remove files failed\n");
5544 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
5545 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
5546 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
5547 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
5548 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
5549 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
5551 MsiCloseHandle( hpkg
);
5552 DeleteFileA(msifile
);
5555 static void test_appsearch(void)
5560 CHAR prop
[MAX_PATH
];
5561 DWORD size
= MAX_PATH
;
5563 hdb
= create_package_db();
5564 ok ( hdb
, "failed to create package database\n" );
5566 r
= create_appsearch_table( hdb
);
5567 ok( r
== ERROR_SUCCESS
, "cannot create AppSearch table: %d\n", r
);
5569 r
= add_appsearch_entry( hdb
, "'WEBBROWSERPROG', 'NewSignature1'" );
5570 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
5572 r
= create_reglocator_table( hdb
);
5573 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
5575 r
= add_reglocator_entry( hdb
, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
5576 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
5578 r
= create_signature_table( hdb
);
5579 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
5581 r
= add_signature_entry( hdb
, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
5582 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
5584 hpkg
= package_from_db( hdb
);
5585 ok( hpkg
, "failed to create package\n");
5587 MsiCloseHandle( hdb
);
5589 r
= MsiDoAction( hpkg
, "AppSearch" );
5590 ok( r
== ERROR_SUCCESS
, "AppSearch failed: %d\n", r
);
5592 r
= MsiGetPropertyA( hpkg
, "WEBBROWSERPROG", prop
, &size
);
5593 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
5594 ok( lstrlenA(prop
) != 0, "Expected non-zero length\n");
5596 MsiCloseHandle( hpkg
);
5597 DeleteFileA(msifile
);
5600 static void test_featureparents(void)
5605 INSTALLSTATE state
, action
;
5607 hdb
= create_package_db();
5608 ok ( hdb
, "failed to create package database\n" );
5610 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
5611 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
5613 r
= create_feature_table( hdb
);
5614 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
5616 r
= create_component_table( hdb
);
5617 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
5619 r
= create_feature_components_table( hdb
);
5620 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
5622 r
= create_file_table( hdb
);
5623 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
5625 /* msidbFeatureAttributesFavorLocal */
5626 r
= add_feature_entry( hdb
, "'zodiac', '', '', '', 2, 1, '', 0" );
5627 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5629 /* msidbFeatureAttributesFavorSource */
5630 r
= add_feature_entry( hdb
, "'perseus', '', '', '', 2, 1, '', 1" );
5631 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5633 /* msidbFeatureAttributesFavorLocal */
5634 r
= add_feature_entry( hdb
, "'orion', '', '', '', 2, 1, '', 0" );
5635 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5637 /* disabled because of install level */
5638 r
= add_feature_entry( hdb
, "'waters', '', '', '', 15, 101, '', 9" );
5639 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5641 /* child feature of disabled feature */
5642 r
= add_feature_entry( hdb
, "'bayer', 'waters', '', '', 14, 1, '', 9" );
5643 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5645 /* component of disabled feature (install level) */
5646 r
= add_component_entry( hdb
, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
5647 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5649 /* component of disabled child feature (install level) */
5650 r
= add_component_entry( hdb
, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
5651 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5653 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5654 r
= add_component_entry( hdb
, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
5655 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5657 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5658 r
= add_component_entry( hdb
, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
5659 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5661 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5662 r
= add_component_entry( hdb
, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
5663 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5665 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
5666 r
= add_component_entry( hdb
, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
5667 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5669 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
5670 r
= add_component_entry( hdb
, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
5671 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5673 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
5674 r
= add_component_entry( hdb
, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
5675 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5677 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5678 r
= add_component_entry( hdb
, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
5679 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5681 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5682 r
= add_component_entry( hdb
, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
5683 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5685 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5686 r
= add_component_entry( hdb
, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
5688 r
= add_feature_components_entry( hdb
, "'zodiac', 'leo'" );
5689 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5691 r
= add_feature_components_entry( hdb
, "'zodiac', 'virgo'" );
5692 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5694 r
= add_feature_components_entry( hdb
, "'zodiac', 'libra'" );
5695 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5697 r
= add_feature_components_entry( hdb
, "'perseus', 'cassiopeia'" );
5698 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5700 r
= add_feature_components_entry( hdb
, "'perseus', 'cepheus'" );
5701 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5703 r
= add_feature_components_entry( hdb
, "'perseus', 'andromeda'" );
5704 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5706 r
= add_feature_components_entry( hdb
, "'orion', 'leo'" );
5707 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5709 r
= add_feature_components_entry( hdb
, "'orion', 'virgo'" );
5710 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5712 r
= add_feature_components_entry( hdb
, "'orion', 'libra'" );
5713 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5715 r
= add_feature_components_entry( hdb
, "'orion', 'cassiopeia'" );
5716 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5718 r
= add_feature_components_entry( hdb
, "'orion', 'cepheus'" );
5719 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5721 r
= add_feature_components_entry( hdb
, "'orion', 'andromeda'" );
5722 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5724 r
= add_feature_components_entry( hdb
, "'orion', 'canis'" );
5725 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5727 r
= add_feature_components_entry( hdb
, "'orion', 'monoceros'" );
5728 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5730 r
= add_feature_components_entry( hdb
, "'orion', 'lepus'" );
5731 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5733 r
= add_feature_components_entry( hdb
, "'waters', 'delphinus'" );
5734 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5736 r
= add_feature_components_entry( hdb
, "'bayer', 'hydrus'" );
5737 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5739 r
= add_file_entry( hdb
, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
5740 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5742 r
= add_file_entry( hdb
, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
5743 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5745 r
= add_file_entry( hdb
, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
5746 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5748 r
= add_file_entry( hdb
, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
5749 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5751 r
= add_file_entry( hdb
, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
5752 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5754 r
= add_file_entry( hdb
, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
5755 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5757 r
= add_file_entry( hdb
, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
5758 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5760 r
= add_file_entry( hdb
, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
5761 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5763 r
= add_file_entry( hdb
, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
5764 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5766 r
= add_file_entry( hdb
, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
5767 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5769 r
= add_file_entry( hdb
, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
5770 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5772 hpkg
= package_from_db( hdb
);
5773 ok( hpkg
, "failed to create package\n");
5775 MsiCloseHandle( hdb
);
5777 r
= MsiDoAction( hpkg
, "CostInitialize");
5778 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5780 r
= MsiDoAction( hpkg
, "FileCost");
5781 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5783 r
= MsiDoAction( hpkg
, "CostFinalize");
5784 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5788 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
5789 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5790 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5791 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5795 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
5796 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5797 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5798 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5802 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
5803 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5804 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5805 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5809 r
= MsiGetFeatureState(hpkg
, "waters", &state
, &action
);
5810 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5811 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5812 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5816 r
= MsiGetFeatureState(hpkg
, "bayer", &state
, &action
);
5817 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5818 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5819 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5823 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
5824 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5825 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5826 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5830 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
5831 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5832 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
5833 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
5837 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
5838 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5839 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
5840 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
5844 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
5845 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5846 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
5847 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
5851 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
5852 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5853 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5854 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
5858 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
5859 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5860 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
5861 ok( action
== INSTALLSTATE_LOCAL
, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action
);
5865 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
5866 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5867 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
5868 ok( action
== INSTALLSTATE_LOCAL
, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action
);
5872 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
5873 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5874 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
5875 ok( action
== INSTALLSTATE_SOURCE
, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action
);
5879 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
5880 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5881 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5882 ok( action
== INSTALLSTATE_LOCAL
, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action
);
5886 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
5887 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5888 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5889 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
5893 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
5894 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5895 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5896 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
5898 r
= MsiSetFeatureState(hpkg
, "orion", INSTALLSTATE_ABSENT
);
5899 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
5903 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
5904 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5905 ok( state
== INSTALLSTATE_ABSENT
, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state
);
5906 ok( action
== INSTALLSTATE_LOCAL
, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action
);
5910 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
5911 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5912 ok( state
== INSTALLSTATE_ABSENT
, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state
);
5913 ok( action
== INSTALLSTATE_SOURCE
, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action
);
5917 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
5918 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5919 ok( state
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state
);
5920 ok( action
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action
);
5924 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
5925 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5926 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state
);
5927 ok( action
== INSTALLSTATE_LOCAL
, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action
);
5931 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
5932 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5933 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
5934 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
5938 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
5939 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5940 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
5941 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
5945 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
5946 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5947 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
5948 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
5952 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
5953 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5954 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5955 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
5959 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
5960 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5961 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
5962 ok( action
== INSTALLSTATE_SOURCE
, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action
);
5966 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
5967 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5968 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
5969 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action
);
5973 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
5974 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5975 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
5976 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action
);
5980 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
5981 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5982 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5983 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action
);
5987 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
5988 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5989 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5990 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
5994 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
5995 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5996 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
5997 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
5999 MsiCloseHandle(hpkg
);
6000 DeleteFileA(msifile
);
6003 static void test_installprops(void)
6005 MSIHANDLE hpkg
, hdb
;
6006 CHAR path
[MAX_PATH
];
6014 GetCurrentDirectory(MAX_PATH
, path
);
6015 lstrcat(path
, "\\");
6016 lstrcat(path
, msifile
);
6018 hdb
= create_package_db();
6019 ok( hdb
, "failed to create database\n");
6021 hpkg
= package_from_db(hdb
);
6022 ok( hpkg
, "failed to create package\n");
6024 MsiCloseHandle(hdb
);
6027 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
6028 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6029 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
6031 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
6033 RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2
);
6038 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
6042 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
6045 /* win9x doesn't set this */
6049 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
6050 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6051 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
6057 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
6061 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
6067 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
6068 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6069 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
6073 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
6074 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6075 trace("VersionDatabase = %s\n", buf
);
6078 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
6079 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6080 trace("VersionMsi = %s\n", buf
);
6083 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
6084 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6085 trace("Date = %s\n", buf
);
6088 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
6089 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6090 trace("Time = %s\n", buf
);
6093 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
6094 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6095 trace("PackageCode = %s\n", buf
);
6097 langid
= GetUserDefaultLangID();
6098 sprintf(path
, "%d", langid
);
6101 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
6102 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS< got %d\n", r
);
6103 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
6105 res
= GetSystemMetrics(SM_CXSCREEN
);
6107 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
6108 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
6110 res
= GetSystemMetrics(SM_CYSCREEN
);
6112 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
6113 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
6117 MsiCloseHandle(hpkg
);
6118 DeleteFile(msifile
);
6121 static void test_launchconditions(void)
6127 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6129 hdb
= create_package_db();
6130 ok( hdb
, "failed to create package database\n" );
6132 r
= create_launchcondition_table( hdb
);
6133 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
6135 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
6136 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
6138 /* invalid condition */
6139 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
6140 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
6142 hpkg
= package_from_db( hdb
);
6143 ok( hpkg
, "failed to create package\n");
6145 MsiCloseHandle( hdb
);
6147 r
= MsiSetProperty( hpkg
, "X", "1" );
6148 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
6150 /* invalid conditions are ignored */
6151 r
= MsiDoAction( hpkg
, "LaunchConditions" );
6152 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
6154 /* verify LaunchConditions still does some verification */
6155 r
= MsiSetProperty( hpkg
, "X", "2" );
6156 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
6158 r
= MsiDoAction( hpkg
, "LaunchConditions" );
6159 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
6161 MsiCloseHandle( hpkg
);
6162 DeleteFile( msifile
);
6165 static void test_ccpsearch(void)
6167 MSIHANDLE hdb
, hpkg
;
6168 CHAR prop
[MAX_PATH
];
6169 DWORD size
= MAX_PATH
;
6172 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6174 hdb
= create_package_db();
6175 ok(hdb
, "failed to create package database\n");
6177 r
= create_ccpsearch_table(hdb
);
6178 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6180 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
6181 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6183 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
6184 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6186 r
= create_reglocator_table(hdb
);
6187 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6189 r
= add_reglocator_entry(hdb
, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
6190 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6192 r
= create_drlocator_table(hdb
);
6193 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6195 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
6196 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6198 r
= create_signature_table(hdb
);
6199 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6201 hpkg
= package_from_db(hdb
);
6202 ok(hpkg
, "failed to create package\n");
6204 MsiCloseHandle(hdb
);
6206 r
= MsiDoAction(hpkg
, "CCPSearch");
6207 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6209 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
6210 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6211 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
6213 MsiCloseHandle(hpkg
);
6214 DeleteFileA(msifile
);
6217 static BOOL
squash_guid(LPCWSTR in
, LPWSTR out
)
6222 if (FAILED(CLSIDFromString((LPOLESTR
)in
, &guid
)))
6229 out
[11-i
] = in
[n
++];
6232 out
[15-i
] = in
[n
++];
6236 out
[17+i
*2] = in
[n
++];
6237 out
[16+i
*2] = in
[n
++];
6242 out
[17+i
*2] = in
[n
++];
6243 out
[16+i
*2] = in
[n
++];
6249 static void set_component_path(LPCSTR filename
, LPCSTR guid
)
6251 WCHAR guidW
[MAX_PATH
];
6252 WCHAR squashedW
[MAX_PATH
];
6253 CHAR squashed
[MAX_PATH
];
6254 CHAR substr
[MAX_PATH
];
6255 CHAR path
[MAX_PATH
];
6258 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
6259 squash_guid(guidW
, squashedW
);
6260 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
6262 lstrcpyA(substr
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6263 "Installer\\UserData\\S-1-5-18\\Components\\");
6264 lstrcatA(substr
, squashed
);
6266 RegCreateKeyA(HKEY_LOCAL_MACHINE
, substr
, &hkey
);
6268 lstrcpyA(path
, CURR_DIR
);
6269 lstrcatA(path
, "\\");
6270 lstrcatA(path
, filename
);
6272 /* just using a random squashed product code */
6273 RegSetValueExA(hkey
, "7D2F387510109040002000060BECB6AB", 0,
6274 REG_SZ
, (LPBYTE
)path
, lstrlenA(path
));
6278 lstrcpyA(substr
, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6279 RegCreateKeyA(HKEY_LOCAL_MACHINE
, substr
, &hkey
);
6282 static void delete_component_path(LPCSTR guid
)
6284 WCHAR guidW
[MAX_PATH
];
6285 WCHAR squashedW
[MAX_PATH
];
6286 WCHAR substrW
[MAX_PATH
];
6287 CHAR squashed
[MAX_PATH
];
6288 CHAR substr
[MAX_PATH
];
6290 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
6291 squash_guid(guidW
, squashedW
);
6292 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
6294 lstrcpyA(substr
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6295 "Installer\\UserData\\S-1-5-18\\Components\\");
6296 lstrcatA(substr
, squashed
);
6298 MultiByteToWideChar(CP_ACP
, 0, substr
, -1, substrW
, MAX_PATH
);
6299 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
6301 lstrcpyA(substr
, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6302 MultiByteToWideChar(CP_ACP
, 0, substr
, -1, substrW
, MAX_PATH
);
6303 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
6306 static void test_complocator(void)
6308 MSIHANDLE hdb
, hpkg
;
6310 CHAR prop
[MAX_PATH
];
6311 CHAR expected
[MAX_PATH
];
6312 DWORD size
= MAX_PATH
;
6314 hdb
= create_package_db();
6315 ok(hdb
, "failed to create package database\n");
6317 r
= create_appsearch_table(hdb
);
6318 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6320 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
6321 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6323 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
6324 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6326 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
6327 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6329 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
6330 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6332 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
6333 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6335 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
6336 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6338 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
6339 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6341 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
6342 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6344 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
6345 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6347 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
6348 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6350 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
6351 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6353 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
6354 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6356 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
6357 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6359 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
6360 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6362 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
6363 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6365 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
6366 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6368 r
= create_complocator_table(hdb
);
6369 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6371 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
6372 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6374 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
6375 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6377 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
6378 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6380 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
6381 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6383 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
6384 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6386 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
6387 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6389 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
6390 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6392 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
6393 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6395 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
6396 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6398 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
6399 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6401 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
6402 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6404 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
6405 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6407 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
6408 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6410 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
6411 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6413 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
6414 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6416 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
6417 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6419 r
= create_signature_table(hdb
);
6420 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6422 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
6423 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6425 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
6426 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6428 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
6429 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6431 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
6432 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6434 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
6435 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6437 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
6438 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6440 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
6441 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6443 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
6444 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6446 hpkg
= package_from_db(hdb
);
6447 ok(hpkg
, "failed to create package\n");
6449 MsiCloseHandle(hdb
);
6451 create_test_file("abelisaurus");
6452 create_test_file("bactrosaurus");
6453 create_test_file("camelotia");
6454 create_test_file("diclonius");
6455 create_test_file("echinodon");
6456 create_test_file("falcarius");
6457 create_test_file("gallimimus");
6458 create_test_file("hagryphus");
6459 CreateDirectoryA("iguanodon", NULL
);
6460 CreateDirectoryA("jobaria", NULL
);
6461 CreateDirectoryA("kakuru", NULL
);
6462 CreateDirectoryA("labocania", NULL
);
6463 CreateDirectoryA("megaraptor", NULL
);
6464 CreateDirectoryA("neosodon", NULL
);
6465 CreateDirectoryA("olorotitan", NULL
);
6466 CreateDirectoryA("pantydraco", NULL
);
6468 set_component_path("abelisaurus", "{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6469 set_component_path("bactrosaurus", "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6470 set_component_path("echinodon", "{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6471 set_component_path("falcarius", "{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6472 set_component_path("iguanodon", "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6473 set_component_path("jobaria", "{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6474 set_component_path("megaraptor", "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6475 set_component_path("neosodon", "{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6477 r
= MsiDoAction(hpkg
, "AppSearch");
6478 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6481 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
6482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6484 lstrcpyA(expected
, CURR_DIR
);
6485 lstrcatA(expected
, "\\abelisaurus");
6486 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6487 "Expected %s or empty string, got %s\n", expected
, prop
);
6490 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", prop
, &size
);
6491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6492 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6495 r
= MsiGetPropertyA(hpkg
, "CAMELOTIA", prop
, &size
);
6496 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6497 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6500 r
= MsiGetPropertyA(hpkg
, "DICLONIUS", prop
, &size
);
6501 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6502 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6505 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
6506 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6508 lstrcpyA(expected
, CURR_DIR
);
6509 lstrcatA(expected
, "\\");
6510 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6511 "Expected %s or empty string, got %s\n", expected
, prop
);
6514 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
6515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6516 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6519 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
6520 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6521 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6524 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
6525 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6526 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6529 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
6530 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6531 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6534 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
6535 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6536 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6539 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
6540 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6541 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6544 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
6545 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6546 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6549 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
6550 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6552 lstrcpyA(expected
, CURR_DIR
);
6553 lstrcatA(expected
, "\\");
6554 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6555 "Expected %s or empty string, got %s\n", expected
, prop
);
6558 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
6559 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6561 lstrcpyA(expected
, CURR_DIR
);
6562 lstrcatA(expected
, "\\neosodon\\");
6563 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6564 "Expected %s or empty string, got %s\n", expected
, prop
);
6567 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
6568 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6569 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6572 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
6573 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6574 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6576 MsiCloseHandle(hpkg
);
6577 DeleteFileA("abelisaurus");
6578 DeleteFileA("bactrosaurus");
6579 DeleteFileA("camelotia");
6580 DeleteFileA("diclonius");
6581 DeleteFileA("echinodon");
6582 DeleteFileA("falcarius");
6583 DeleteFileA("gallimimus");
6584 DeleteFileA("hagryphus");
6585 RemoveDirectoryA("iguanodon");
6586 RemoveDirectoryA("jobaria");
6587 RemoveDirectoryA("kakuru");
6588 RemoveDirectoryA("labocania");
6589 RemoveDirectoryA("megaraptor");
6590 RemoveDirectoryA("neosodon");
6591 RemoveDirectoryA("olorotitan");
6592 RemoveDirectoryA("pantydraco");
6593 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6594 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6595 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6596 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6597 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6598 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6599 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6600 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6601 DeleteFileA(msifile
);
6604 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
6609 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
6610 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6612 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
6613 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6615 r
= MsiSummaryInfoPersist(summary
);
6616 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6618 MsiCloseHandle(summary
);
6621 static void test_MsiGetSourcePath(void)
6623 MSIHANDLE hdb
, hpkg
;
6624 CHAR path
[MAX_PATH
];
6626 CHAR subsrc
[MAX_PATH
];
6627 CHAR sub2
[MAX_PATH
];
6631 lstrcpyA(cwd
, CURR_DIR
);
6632 lstrcatA(cwd
, "\\");
6634 lstrcpyA(subsrc
, cwd
);
6635 lstrcatA(subsrc
, "subsource");
6636 lstrcatA(subsrc
, "\\");
6638 lstrcpyA(sub2
, subsrc
);
6639 lstrcatA(sub2
, "sub2");
6640 lstrcatA(sub2
, "\\");
6642 /* uncompressed source */
6644 hdb
= create_package_db();
6645 ok( hdb
, "failed to create database\n");
6647 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
6649 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
6650 ok(r
== S_OK
, "failed\n");
6652 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
6653 ok(r
== S_OK
, "failed\n");
6655 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
6656 ok(r
== S_OK
, "failed\n");
6658 r
= MsiDatabaseCommit(hdb
);
6659 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
6661 hpkg
= package_from_db(hdb
);
6662 ok(hpkg
, "failed to create package\n");
6664 MsiCloseHandle(hdb
);
6666 /* invalid database handle */
6668 lstrcpyA(path
, "kiwi");
6669 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
6670 ok(r
== ERROR_INVALID_HANDLE
,
6671 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
6672 ok(!lstrcmpA(path
, "kiwi"),
6673 "Expected path to be unchanged, got \"%s\"\n", path
);
6674 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6678 lstrcpyA(path
, "kiwi");
6679 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
6680 ok(r
== ERROR_INVALID_PARAMETER
,
6681 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
6682 ok(!lstrcmpA(path
, "kiwi"),
6683 "Expected path to be unchanged, got \"%s\"\n", path
);
6684 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6686 /* empty szFolder */
6688 lstrcpyA(path
, "kiwi");
6689 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
6690 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6691 ok(!lstrcmpA(path
, "kiwi"),
6692 "Expected path to be unchanged, got \"%s\"\n", path
);
6693 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6697 lstrcpyA(path
, "kiwi");
6698 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
6699 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6700 ok(!lstrcmpA(path
, "kiwi"),
6701 "Expected path to be unchanged, got \"%s\"\n", path
);
6702 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6706 lstrcpyA(path
, "kiwi");
6707 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6708 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6709 ok(!lstrcmpA(path
, "kiwi"),
6710 "Expected path to be unchanged, got \"%s\"\n", path
);
6711 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6715 lstrcpyA(path
, "kiwi");
6716 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
6717 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6718 ok(!lstrcmpA(path
, "kiwi"),
6719 "Expected path to be unchanged, got \"%s\"\n", path
);
6720 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6722 /* source path does not exist, but the property exists */
6724 lstrcpyA(path
, "kiwi");
6725 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
6726 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6727 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
6728 ok(size
== 0, "Expected 0, got %d\n", size
);
6732 lstrcpyA(path
, "kiwi");
6733 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
6734 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6735 ok(!lstrcmpA(path
, "kiwi"),
6736 "Expected path to be unchanged, got \"%s\"\n", path
);
6737 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6741 lstrcpyA(path
, "kiwi");
6742 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
6743 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6744 ok(!lstrcmpA(path
, "kiwi"),
6745 "Expected path to be unchanged, got \"%s\"\n", path
);
6746 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6748 r
= MsiDoAction(hpkg
, "CostInitialize");
6749 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
6751 /* try TARGETDIR after CostInitialize */
6753 lstrcpyA(path
, "kiwi");
6754 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
6755 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6756 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6757 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6759 /* try SourceDir after CostInitialize */
6761 lstrcpyA(path
, "kiwi");
6762 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6763 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6764 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6765 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6767 /* try SOURCEDIR after CostInitialize */
6769 lstrcpyA(path
, "kiwi");
6770 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
6771 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6772 ok(!lstrcmpA(path
, "kiwi"),
6773 "Expected path to be unchanged, got \"%s\"\n", path
);
6774 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6776 /* source path does not exist, but the property exists */
6778 lstrcpyA(path
, "kiwi");
6779 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
6780 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6783 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6784 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6787 /* try SubDir after CostInitialize */
6789 lstrcpyA(path
, "kiwi");
6790 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
6791 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6792 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
6793 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
6795 /* try SubDir2 after CostInitialize */
6797 lstrcpyA(path
, "kiwi");
6798 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
6799 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6800 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
6801 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
6803 r
= MsiDoAction(hpkg
, "ResolveSource");
6804 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
6806 /* try TARGETDIR after ResolveSource */
6808 lstrcpyA(path
, "kiwi");
6809 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
6810 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6811 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6812 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6814 /* try SourceDir after ResolveSource */
6816 lstrcpyA(path
, "kiwi");
6817 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6818 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6819 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6820 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6822 /* try SOURCEDIR after ResolveSource */
6824 lstrcpyA(path
, "kiwi");
6825 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
6826 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6827 ok(!lstrcmpA(path
, "kiwi"),
6828 "Expected path to be unchanged, got \"%s\"\n", path
);
6829 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6831 /* source path does not exist, but the property exists */
6833 lstrcpyA(path
, "kiwi");
6834 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
6835 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6836 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6837 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6839 /* try SubDir after ResolveSource */
6841 lstrcpyA(path
, "kiwi");
6842 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
6843 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6844 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
6845 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
6847 /* try SubDir2 after ResolveSource */
6849 lstrcpyA(path
, "kiwi");
6850 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
6851 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6852 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
6853 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
6855 r
= MsiDoAction(hpkg
, "FileCost");
6856 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
6858 /* try TARGETDIR after FileCost */
6860 lstrcpyA(path
, "kiwi");
6861 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
6862 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6863 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6864 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6866 /* try SourceDir after FileCost */
6868 lstrcpyA(path
, "kiwi");
6869 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6870 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6871 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6872 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6874 /* try SOURCEDIR after FileCost */
6876 lstrcpyA(path
, "kiwi");
6877 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
6878 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6879 ok(!lstrcmpA(path
, "kiwi"),
6880 "Expected path to be unchanged, got \"%s\"\n", path
);
6881 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6883 /* try SubDir after FileCost */
6885 lstrcpyA(path
, "kiwi");
6886 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
6887 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6888 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
6889 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
6891 /* try SubDir2 after FileCost */
6893 lstrcpyA(path
, "kiwi");
6894 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
6895 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6896 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
6897 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
6899 r
= MsiDoAction(hpkg
, "CostFinalize");
6900 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
6902 /* try TARGETDIR after CostFinalize */
6904 lstrcpyA(path
, "kiwi");
6905 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
6906 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6907 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6908 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6910 /* try SourceDir after CostFinalize */
6912 lstrcpyA(path
, "kiwi");
6913 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6914 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6915 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6916 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6918 /* try SOURCEDIR after CostFinalize */
6920 lstrcpyA(path
, "kiwi");
6921 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
6922 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6923 ok(!lstrcmpA(path
, "kiwi"),
6924 "Expected path to be unchanged, got \"%s\"\n", path
);
6925 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6927 /* try SubDir after CostFinalize */
6929 lstrcpyA(path
, "kiwi");
6930 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
6931 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6932 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
6933 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
6935 /* try SubDir2 after CostFinalize */
6937 lstrcpyA(path
, "kiwi");
6938 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
6939 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6940 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
6941 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
6943 /* nonexistent directory */
6945 lstrcpyA(path
, "kiwi");
6946 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
6947 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6948 ok(!lstrcmpA(path
, "kiwi"),
6949 "Expected path to be unchanged, got \"%s\"\n", path
);
6950 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6952 /* NULL szPathBuf */
6954 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
6955 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6956 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6958 /* NULL pcchPathBuf */
6959 lstrcpyA(path
, "kiwi");
6960 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
6961 ok(r
== ERROR_INVALID_PARAMETER
,
6962 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
6963 ok(!lstrcmpA(path
, "kiwi"),
6964 "Expected path to be unchanged, got \"%s\"\n", path
);
6966 /* pcchPathBuf is 0 */
6968 lstrcpyA(path
, "kiwi");
6969 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6970 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
6971 ok(!lstrcmpA(path
, "kiwi"),
6972 "Expected path to be unchanged, got \"%s\"\n", path
);
6973 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6975 /* pcchPathBuf does not have room for NULL terminator */
6976 size
= lstrlenA(cwd
);
6977 lstrcpyA(path
, "kiwi");
6978 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6979 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
6980 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
6981 "Expected path with no backslash, got \"%s\"\n", path
);
6982 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6984 /* pcchPathBuf has room for NULL terminator */
6985 size
= lstrlenA(cwd
) + 1;
6986 lstrcpyA(path
, "kiwi");
6987 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6988 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6989 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6990 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6992 MsiCloseHandle(hpkg
);
6994 /* compressed source */
6996 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
6997 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6999 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
7001 hpkg
= package_from_db(hdb
);
7002 ok(hpkg
, "failed to create package\n");
7004 r
= MsiDoAction(hpkg
, "CostInitialize");
7005 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7006 r
= MsiDoAction(hpkg
, "FileCost");
7007 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7008 r
= MsiDoAction(hpkg
, "CostFinalize");
7009 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7011 /* try TARGETDIR after CostFinalize */
7013 lstrcpyA(path
, "kiwi");
7014 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
7015 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7016 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7017 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7019 /* try SourceDir after CostFinalize */
7021 lstrcpyA(path
, "kiwi");
7022 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7023 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7024 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7025 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7027 /* try SOURCEDIR after CostFinalize */
7029 lstrcpyA(path
, "kiwi");
7030 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7033 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7034 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7035 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7038 /* try SubDir after CostFinalize */
7040 lstrcpyA(path
, "kiwi");
7041 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7042 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7043 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7044 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7046 /* try SubDir2 after CostFinalize */
7048 lstrcpyA(path
, "kiwi");
7049 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7050 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7051 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7052 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7054 MsiCloseHandle(hpkg
);
7055 DeleteFile(msifile
);
7058 static void test_shortlongsource(void)
7060 MSIHANDLE hdb
, hpkg
;
7061 CHAR path
[MAX_PATH
];
7063 CHAR subsrc
[MAX_PATH
];
7067 lstrcpyA(cwd
, CURR_DIR
);
7068 lstrcatA(cwd
, "\\");
7070 lstrcpyA(subsrc
, cwd
);
7071 lstrcatA(subsrc
, "long");
7072 lstrcatA(subsrc
, "\\");
7074 /* long file names */
7076 hdb
= create_package_db();
7077 ok( hdb
, "failed to create database\n");
7079 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
7081 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
7082 ok(r
== S_OK
, "failed\n");
7084 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
7085 ok(r
== S_OK
, "failed\n");
7087 /* CostInitialize:short */
7088 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
7089 ok(r
== S_OK
, "failed\n");
7091 /* CostInitialize:long */
7092 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
7093 ok(r
== S_OK
, "failed\n");
7095 /* FileCost:short */
7096 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
7097 ok(r
== S_OK
, "failed\n");
7100 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
7101 ok(r
== S_OK
, "failed\n");
7103 /* CostFinalize:short */
7104 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
7105 ok(r
== S_OK
, "failed\n");
7107 /* CostFinalize:long */
7108 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
7109 ok(r
== S_OK
, "failed\n");
7111 MsiDatabaseCommit(hdb
);
7113 hpkg
= package_from_db(hdb
);
7114 ok(hpkg
, "failed to create package\n");
7116 MsiCloseHandle(hdb
);
7118 CreateDirectoryA("one", NULL
);
7119 CreateDirectoryA("four", NULL
);
7121 r
= MsiDoAction(hpkg
, "CostInitialize");
7122 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7124 CreateDirectory("five", NULL
);
7125 CreateDirectory("eight", NULL
);
7127 r
= MsiDoAction(hpkg
, "FileCost");
7128 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7130 CreateDirectory("nine", NULL
);
7131 CreateDirectory("twelve", NULL
);
7133 r
= MsiDoAction(hpkg
, "CostFinalize");
7134 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7136 /* neither short nor long source directories exist */
7138 lstrcpyA(path
, "kiwi");
7139 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7140 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7141 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7142 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7144 CreateDirectoryA("short", NULL
);
7146 /* short source directory exists */
7148 lstrcpyA(path
, "kiwi");
7149 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7150 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7151 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7152 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7154 CreateDirectoryA("long", NULL
);
7156 /* both short and long source directories exist */
7158 lstrcpyA(path
, "kiwi");
7159 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7160 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7161 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7162 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7164 lstrcpyA(subsrc
, cwd
);
7165 lstrcatA(subsrc
, "two");
7166 lstrcatA(subsrc
, "\\");
7168 /* short dir exists before CostInitialize */
7170 lstrcpyA(path
, "kiwi");
7171 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7172 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7173 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7174 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7176 lstrcpyA(subsrc
, cwd
);
7177 lstrcatA(subsrc
, "four");
7178 lstrcatA(subsrc
, "\\");
7180 /* long dir exists before CostInitialize */
7182 lstrcpyA(path
, "kiwi");
7183 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
7184 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7185 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7186 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7188 lstrcpyA(subsrc
, cwd
);
7189 lstrcatA(subsrc
, "six");
7190 lstrcatA(subsrc
, "\\");
7192 /* short dir exists before FileCost */
7194 lstrcpyA(path
, "kiwi");
7195 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
7196 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7197 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7198 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7200 lstrcpyA(subsrc
, cwd
);
7201 lstrcatA(subsrc
, "eight");
7202 lstrcatA(subsrc
, "\\");
7204 /* long dir exists before FileCost */
7206 lstrcpyA(path
, "kiwi");
7207 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
7208 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7209 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7210 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7212 lstrcpyA(subsrc
, cwd
);
7213 lstrcatA(subsrc
, "ten");
7214 lstrcatA(subsrc
, "\\");
7216 /* short dir exists before CostFinalize */
7218 lstrcpyA(path
, "kiwi");
7219 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
7220 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7221 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7222 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7224 lstrcpyA(subsrc
, cwd
);
7225 lstrcatA(subsrc
, "twelve");
7226 lstrcatA(subsrc
, "\\");
7228 /* long dir exists before CostFinalize */
7230 lstrcpyA(path
, "kiwi");
7231 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
7232 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7233 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7234 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7236 MsiCloseHandle(hpkg
);
7237 RemoveDirectoryA("short");
7238 RemoveDirectoryA("long");
7239 RemoveDirectoryA("one");
7240 RemoveDirectoryA("four");
7241 RemoveDirectoryA("five");
7242 RemoveDirectoryA("eight");
7243 RemoveDirectoryA("nine");
7244 RemoveDirectoryA("twelve");
7246 /* short file names */
7248 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
7249 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7251 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
7253 hpkg
= package_from_db(hdb
);
7254 ok(hpkg
, "failed to create package\n");
7256 MsiCloseHandle(hdb
);
7258 CreateDirectoryA("one", NULL
);
7259 CreateDirectoryA("four", NULL
);
7261 r
= MsiDoAction(hpkg
, "CostInitialize");
7262 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7264 CreateDirectory("five", NULL
);
7265 CreateDirectory("eight", NULL
);
7267 r
= MsiDoAction(hpkg
, "FileCost");
7268 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7270 CreateDirectory("nine", NULL
);
7271 CreateDirectory("twelve", NULL
);
7273 r
= MsiDoAction(hpkg
, "CostFinalize");
7274 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7276 lstrcpyA(subsrc
, cwd
);
7277 lstrcatA(subsrc
, "short");
7278 lstrcatA(subsrc
, "\\");
7280 /* neither short nor long source directories exist */
7282 lstrcpyA(path
, "kiwi");
7283 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7284 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7285 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7286 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7288 CreateDirectoryA("short", NULL
);
7290 /* short source directory exists */
7292 lstrcpyA(path
, "kiwi");
7293 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7294 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7295 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7296 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7298 CreateDirectoryA("long", NULL
);
7300 /* both short and long source directories exist */
7302 lstrcpyA(path
, "kiwi");
7303 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7304 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7305 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7306 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7308 lstrcpyA(subsrc
, cwd
);
7309 lstrcatA(subsrc
, "one");
7310 lstrcatA(subsrc
, "\\");
7312 /* short dir exists before CostInitialize */
7314 lstrcpyA(path
, "kiwi");
7315 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7316 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7317 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7318 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7320 lstrcpyA(subsrc
, cwd
);
7321 lstrcatA(subsrc
, "three");
7322 lstrcatA(subsrc
, "\\");
7324 /* long dir exists before CostInitialize */
7326 lstrcpyA(path
, "kiwi");
7327 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
7328 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7329 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7330 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7332 lstrcpyA(subsrc
, cwd
);
7333 lstrcatA(subsrc
, "five");
7334 lstrcatA(subsrc
, "\\");
7336 /* short dir exists before FileCost */
7338 lstrcpyA(path
, "kiwi");
7339 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
7340 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7341 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7342 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7344 lstrcpyA(subsrc
, cwd
);
7345 lstrcatA(subsrc
, "seven");
7346 lstrcatA(subsrc
, "\\");
7348 /* long dir exists before FileCost */
7350 lstrcpyA(path
, "kiwi");
7351 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
7352 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7353 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7354 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7356 lstrcpyA(subsrc
, cwd
);
7357 lstrcatA(subsrc
, "nine");
7358 lstrcatA(subsrc
, "\\");
7360 /* short dir exists before CostFinalize */
7362 lstrcpyA(path
, "kiwi");
7363 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
7364 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7365 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7366 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7368 lstrcpyA(subsrc
, cwd
);
7369 lstrcatA(subsrc
, "eleven");
7370 lstrcatA(subsrc
, "\\");
7372 /* long dir exists before CostFinalize */
7374 lstrcpyA(path
, "kiwi");
7375 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
7376 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7377 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7378 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7380 MsiCloseHandle(hpkg
);
7381 RemoveDirectoryA("short");
7382 RemoveDirectoryA("long");
7383 RemoveDirectoryA("one");
7384 RemoveDirectoryA("four");
7385 RemoveDirectoryA("five");
7386 RemoveDirectoryA("eight");
7387 RemoveDirectoryA("nine");
7388 RemoveDirectoryA("twelve");
7389 DeleteFileA(msifile
);
7392 static void test_sourcedir(void)
7394 MSIHANDLE hdb
, hpkg
;
7396 CHAR path
[MAX_PATH
];
7398 CHAR subsrc
[MAX_PATH
];
7402 lstrcpyA(cwd
, CURR_DIR
);
7403 lstrcatA(cwd
, "\\");
7405 lstrcpyA(subsrc
, cwd
);
7406 lstrcatA(subsrc
, "long");
7407 lstrcatA(subsrc
, "\\");
7409 hdb
= create_package_db();
7410 ok( hdb
, "failed to create database\n");
7412 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
7413 ok(r
== S_OK
, "failed\n");
7415 sprintf(package
, "#%li", hdb
);
7416 r
= MsiOpenPackage(package
, &hpkg
);
7417 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7419 /* properties only */
7421 /* SourceDir prop */
7423 lstrcpyA(path
, "kiwi");
7424 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7425 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7426 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7427 ok(size
== 0, "Expected 0, got %d\n", size
);
7429 /* SOURCEDIR prop */
7431 lstrcpyA(path
, "kiwi");
7432 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7433 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7434 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7435 ok(size
== 0, "Expected 0, got %d\n", size
);
7437 r
= MsiDoAction(hpkg
, "CostInitialize");
7438 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7440 /* SourceDir after CostInitialize */
7442 lstrcpyA(path
, "kiwi");
7443 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7444 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7445 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7446 ok(size
== 0, "Expected 0, got %d\n", size
);
7448 /* SOURCEDIR after CostInitialize */
7450 lstrcpyA(path
, "kiwi");
7451 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7452 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7453 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7454 ok(size
== 0, "Expected 0, got %d\n", size
);
7456 r
= MsiDoAction(hpkg
, "FileCost");
7457 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7459 /* SourceDir after FileCost */
7461 lstrcpyA(path
, "kiwi");
7462 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7463 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7464 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7465 ok(size
== 0, "Expected 0, got %d\n", size
);
7467 /* SOURCEDIR after FileCost */
7469 lstrcpyA(path
, "kiwi");
7470 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7472 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7473 ok(size
== 0, "Expected 0, got %d\n", size
);
7475 r
= MsiDoAction(hpkg
, "CostFinalize");
7476 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7478 /* SourceDir after CostFinalize */
7480 lstrcpyA(path
, "kiwi");
7481 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7483 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7484 ok(size
== 0, "Expected 0, got %d\n", size
);
7486 /* SOURCEDIR after CostFinalize */
7488 lstrcpyA(path
, "kiwi");
7489 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7490 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7491 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7492 ok(size
== 0, "Expected 0, got %d\n", size
);
7494 r
= MsiDoAction(hpkg
, "ResolveSource");
7495 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7497 /* SourceDir after ResolveSource */
7499 lstrcpyA(path
, "kiwi");
7500 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7501 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7502 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7503 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7505 /* SOURCEDIR after ResolveSource */
7507 lstrcpyA(path
, "kiwi");
7508 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7510 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7511 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7515 lstrcpyA(path
, "kiwi");
7516 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
7517 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7518 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7519 ok(size
== 0, "Expected 0, got %d\n", size
);
7521 MsiCloseHandle(hpkg
);
7523 /* reset the package state */
7524 sprintf(package
, "#%li", hdb
);
7525 r
= MsiOpenPackage(package
, &hpkg
);
7526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7528 /* test how MsiGetSourcePath affects the properties */
7530 /* SourceDir prop */
7532 lstrcpyA(path
, "kiwi");
7533 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7534 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7537 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7538 ok(size
== 0, "Expected 0, got %d\n", size
);
7542 lstrcpyA(path
, "kiwi");
7543 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7544 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7545 ok(!lstrcmpA(path
, "kiwi"),
7546 "Expected path to be unchanged, got \"%s\"\n", path
);
7547 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7549 /* SourceDir after MsiGetSourcePath */
7551 lstrcpyA(path
, "kiwi");
7552 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7553 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7556 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7557 ok(size
== 0, "Expected 0, got %d\n", size
);
7560 /* SOURCEDIR prop */
7562 lstrcpyA(path
, "kiwi");
7563 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7567 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7568 ok(size
== 0, "Expected 0, got %d\n", size
);
7572 lstrcpyA(path
, "kiwi");
7573 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7574 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7575 ok(!lstrcmpA(path
, "kiwi"),
7576 "Expected path to be unchanged, got \"%s\"\n", path
);
7577 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7579 /* SOURCEDIR prop after MsiGetSourcePath */
7581 lstrcpyA(path
, "kiwi");
7582 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7583 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7586 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7587 ok(size
== 0, "Expected 0, got %d\n", size
);
7590 r
= MsiDoAction(hpkg
, "CostInitialize");
7591 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7593 /* SourceDir after CostInitialize */
7595 lstrcpyA(path
, "kiwi");
7596 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7597 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7600 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7601 ok(size
== 0, "Expected 0, got %d\n", size
);
7605 lstrcpyA(path
, "kiwi");
7606 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7607 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7608 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7609 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7611 /* SourceDir after MsiGetSourcePath */
7613 lstrcpyA(path
, "kiwi");
7614 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7615 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7616 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7617 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7619 /* SOURCEDIR after CostInitialize */
7621 lstrcpyA(path
, "kiwi");
7622 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7623 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7624 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7625 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7627 /* SOURCEDIR source path still does not exist */
7629 lstrcpyA(path
, "kiwi");
7630 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7631 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7632 ok(!lstrcmpA(path
, "kiwi"),
7633 "Expected path to be unchanged, got \"%s\"\n", path
);
7634 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7636 r
= MsiDoAction(hpkg
, "FileCost");
7637 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7639 /* SourceDir after FileCost */
7641 lstrcpyA(path
, "kiwi");
7642 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7643 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7644 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7645 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7647 /* SOURCEDIR after FileCost */
7649 lstrcpyA(path
, "kiwi");
7650 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7651 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7652 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7653 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7655 /* SOURCEDIR source path still does not exist */
7657 lstrcpyA(path
, "kiwi");
7658 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7659 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7660 ok(!lstrcmpA(path
, "kiwi"),
7661 "Expected path to be unchanged, got \"%s\"\n", path
);
7662 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7664 r
= MsiDoAction(hpkg
, "CostFinalize");
7665 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7667 /* SourceDir after CostFinalize */
7669 lstrcpyA(path
, "kiwi");
7670 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7671 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7672 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7673 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7675 /* SOURCEDIR after CostFinalize */
7677 lstrcpyA(path
, "kiwi");
7678 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7679 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7680 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7681 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7683 /* SOURCEDIR source path still does not exist */
7685 lstrcpyA(path
, "kiwi");
7686 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7687 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7688 ok(!lstrcmpA(path
, "kiwi"),
7689 "Expected path to be unchanged, got \"%s\"\n", path
);
7690 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7692 r
= MsiDoAction(hpkg
, "ResolveSource");
7693 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7695 /* SourceDir after ResolveSource */
7697 lstrcpyA(path
, "kiwi");
7698 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7699 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7700 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7701 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7703 /* SOURCEDIR after ResolveSource */
7705 lstrcpyA(path
, "kiwi");
7706 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7708 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7709 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7711 /* SOURCEDIR source path still does not exist */
7713 lstrcpyA(path
, "kiwi");
7714 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7715 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7716 ok(!lstrcmpA(path
, "kiwi"),
7717 "Expected path to be unchanged, got \"%s\"\n", path
);
7718 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7720 MsiCloseHandle(hdb
);
7721 MsiCloseHandle(hpkg
);
7722 DeleteFileA(msifile
);
7731 static const struct access_res create
[16] =
7733 { TRUE
, ERROR_SUCCESS
},
7734 { TRUE
, ERROR_SUCCESS
},
7735 { TRUE
, ERROR_SUCCESS
},
7736 { TRUE
, ERROR_SUCCESS
},
7737 { FALSE
, ERROR_SHARING_VIOLATION
},
7738 { FALSE
, ERROR_SHARING_VIOLATION
},
7739 { FALSE
, ERROR_SHARING_VIOLATION
},
7740 { TRUE
, ERROR_SUCCESS
},
7741 { FALSE
, ERROR_SHARING_VIOLATION
},
7742 { FALSE
, ERROR_SHARING_VIOLATION
},
7743 { FALSE
, ERROR_SHARING_VIOLATION
},
7744 { TRUE
, ERROR_SUCCESS
},
7745 { FALSE
, ERROR_SHARING_VIOLATION
},
7746 { FALSE
, ERROR_SHARING_VIOLATION
},
7747 { FALSE
, ERROR_SHARING_VIOLATION
},
7748 { TRUE
, ERROR_SUCCESS
}
7751 static const struct access_res create_commit
[16] =
7753 { TRUE
, ERROR_SUCCESS
},
7754 { TRUE
, ERROR_SUCCESS
},
7755 { TRUE
, ERROR_SUCCESS
},
7756 { TRUE
, ERROR_SUCCESS
},
7757 { FALSE
, ERROR_SHARING_VIOLATION
},
7758 { FALSE
, ERROR_SHARING_VIOLATION
},
7759 { FALSE
, ERROR_SHARING_VIOLATION
},
7760 { TRUE
, ERROR_SUCCESS
},
7761 { FALSE
, ERROR_SHARING_VIOLATION
},
7762 { FALSE
, ERROR_SHARING_VIOLATION
},
7763 { FALSE
, ERROR_SHARING_VIOLATION
},
7764 { TRUE
, ERROR_SUCCESS
},
7765 { FALSE
, ERROR_SHARING_VIOLATION
},
7766 { FALSE
, ERROR_SHARING_VIOLATION
},
7767 { FALSE
, ERROR_SHARING_VIOLATION
},
7768 { TRUE
, ERROR_SUCCESS
}
7771 static const struct access_res create_close
[16] =
7773 { TRUE
, ERROR_SUCCESS
},
7774 { TRUE
, ERROR_SUCCESS
},
7775 { TRUE
, ERROR_SUCCESS
},
7776 { TRUE
, ERROR_SUCCESS
},
7777 { TRUE
, ERROR_SUCCESS
},
7778 { TRUE
, ERROR_SUCCESS
},
7779 { TRUE
, ERROR_SUCCESS
},
7780 { TRUE
, ERROR_SUCCESS
},
7781 { TRUE
, ERROR_SUCCESS
},
7782 { TRUE
, ERROR_SUCCESS
},
7783 { TRUE
, ERROR_SUCCESS
},
7784 { TRUE
, ERROR_SUCCESS
},
7785 { TRUE
, ERROR_SUCCESS
},
7786 { TRUE
, ERROR_SUCCESS
},
7787 { TRUE
, ERROR_SUCCESS
},
7788 { TRUE
, ERROR_SUCCESS
}
7791 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
7793 DWORD access
= 0, share
= 0;
7798 for (i
= 0; i
< 4; i
++)
7800 if (i
== 0) access
= 0;
7801 if (i
== 1) access
= GENERIC_READ
;
7802 if (i
== 2) access
= GENERIC_WRITE
;
7803 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
7805 for (j
= 0; j
< 4; j
++)
7807 if (j
== 0) share
= 0;
7808 if (j
== 1) share
= FILE_SHARE_READ
;
7809 if (j
== 2) share
= FILE_SHARE_WRITE
;
7810 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
7812 SetLastError(0xdeadbeef);
7813 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
7814 FILE_ATTRIBUTE_NORMAL
, 0);
7815 lasterr
= GetLastError();
7817 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
7818 "(%d, handle, %d): Expected %d, got %d\n",
7819 line
, idx
, ares
[idx
].gothandle
,
7820 (hfile
!= INVALID_HANDLE_VALUE
));
7822 ok(lasterr
== ares
[idx
].lasterr
,
7823 "(%d, lasterr, %d): Expected %d, got %d\n",
7824 line
, idx
, ares
[idx
].lasterr
, lasterr
);
7832 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
7834 static void test_access(void)
7839 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
7840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7842 test_file_access(msifile
, create
);
7844 r
= MsiDatabaseCommit(hdb
);
7845 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7847 test_file_access(msifile
, create_commit
);
7849 MsiCloseHandle(hdb
);
7851 test_file_access(msifile
, create_close
);
7853 DeleteFileA(msifile
);
7855 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
7856 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7858 test_file_access(msifile
, create
);
7860 r
= MsiDatabaseCommit(hdb
);
7861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7863 test_file_access(msifile
, create_commit
);
7865 MsiCloseHandle(hdb
);
7867 test_file_access(msifile
, create_close
);
7869 DeleteFileA(msifile
);
7874 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
7876 test_createpackage();
7878 test_gettargetpath_bad();
7879 test_settargetpath();
7881 test_property_table();
7884 test_formatrecord2();
7889 test_featureparents();
7890 test_installprops();
7891 test_launchconditions();
7894 test_MsiGetSourcePath();
7895 test_shortlongsource();