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
);
3032 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3037 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3038 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3039 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3042 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3047 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3048 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3049 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3050 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3054 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3055 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3056 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3057 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3061 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3062 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3063 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3064 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3068 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3069 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3070 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3071 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3075 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3076 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3077 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3078 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3082 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3083 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3084 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3085 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3089 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3090 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3091 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3092 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3096 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3097 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3098 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3099 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3103 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3104 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3105 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3106 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3110 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3111 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3112 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3113 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3117 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3118 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3119 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3122 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3127 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3128 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3129 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3132 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3137 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3138 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3139 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3142 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3147 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3148 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3149 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3152 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3157 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3158 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3159 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3162 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3167 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3168 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3169 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3172 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3177 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3178 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3179 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3182 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3187 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3188 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3189 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3192 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3195 MsiCloseHandle( hpkg
);
3197 /* publish the features and components */
3198 r
= MsiInstallProduct(msifile
, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3199 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3201 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
3202 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3204 /* these properties must not be in the saved msi file */
3205 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
3206 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3208 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
3209 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3211 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
3212 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3214 hpkg
= package_from_db( hdb
);
3215 ok( hpkg
, "failed to create package\n");
3217 MsiCloseHandle(hdb
);
3221 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3222 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3223 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3224 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3228 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3229 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3230 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3231 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3235 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3236 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3237 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3238 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3242 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3243 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3244 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3245 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3249 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3250 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3251 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3252 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3256 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3257 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3258 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3259 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3263 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3264 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3265 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3266 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3270 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3271 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3272 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3273 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3277 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3278 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3279 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3280 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3284 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3285 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3286 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3287 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3291 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3292 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3293 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3294 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3298 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3299 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3300 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3301 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3305 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3306 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3307 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3308 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3312 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3313 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3314 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3315 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3319 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3320 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3321 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3322 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3326 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3327 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3328 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3329 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3333 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3334 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3335 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3336 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3340 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3341 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3342 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3343 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3347 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3348 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3349 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3350 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3354 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3355 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3356 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3357 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3361 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3362 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3363 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3364 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3368 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3369 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3370 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3371 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3375 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3376 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3377 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3378 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3382 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3383 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3384 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3385 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3389 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3390 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3391 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3392 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3394 r
= MsiDoAction( hpkg
, "CostInitialize");
3395 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3399 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3400 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3401 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3402 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3406 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3407 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3408 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3409 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3413 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3414 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3415 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3416 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3420 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3421 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3422 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3423 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3427 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3428 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3429 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3430 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3434 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3435 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3436 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3437 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3441 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3442 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3443 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3444 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3448 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3449 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3450 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3451 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3455 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3456 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3457 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3458 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3462 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3463 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3464 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3465 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3469 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3470 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3471 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3472 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3476 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3477 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3478 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3479 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3483 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3484 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3485 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3486 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3490 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3491 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3492 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3493 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3497 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3498 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3499 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3500 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3504 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3505 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3506 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3507 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3511 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3512 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3513 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3514 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3518 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3519 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3520 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3521 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3525 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3526 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3527 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3528 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3532 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3533 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3534 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3535 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3539 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3540 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3541 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3542 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3546 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3547 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3548 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3549 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3553 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3554 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3555 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3556 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3560 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3561 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3562 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3563 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3567 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3568 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3569 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3570 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3572 r
= MsiDoAction( hpkg
, "FileCost");
3573 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3577 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3578 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3579 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3580 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3584 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3585 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3586 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3587 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3591 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3592 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3593 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3594 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3598 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3599 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3600 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3601 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3605 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3606 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3607 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3608 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3612 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3613 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3614 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3615 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3619 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3620 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3621 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3622 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3626 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3627 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3628 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3629 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3633 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3634 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3635 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3636 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3640 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3641 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3642 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3643 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3647 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3648 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3649 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3650 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3654 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3655 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3656 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3657 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3661 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3662 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3663 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3664 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3668 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3669 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3670 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3671 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3675 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3676 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3677 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3678 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3682 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3683 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3684 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3685 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3689 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3690 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3691 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3692 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3696 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3697 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3698 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3699 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3703 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3704 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3705 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3706 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3710 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3711 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3712 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3713 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3717 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3718 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3719 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3720 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3724 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3725 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3726 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3727 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3731 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3732 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3733 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3734 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3738 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3739 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3740 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3741 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3745 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3746 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3747 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3748 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3750 r
= MsiDoAction( hpkg
, "CostFinalize");
3751 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3755 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3756 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3759 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3761 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3765 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3766 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3769 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3771 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3775 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3776 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3777 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3778 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3782 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3783 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3784 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3785 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3789 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3790 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3791 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3792 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3796 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3797 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3798 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3801 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3806 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3807 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3808 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3811 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3816 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3817 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3820 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3822 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3826 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3827 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3830 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3832 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3836 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3837 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3840 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3842 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3846 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3847 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3850 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3852 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3856 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3857 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3860 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3862 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3866 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3867 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3870 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3871 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3876 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3877 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3880 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3881 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3886 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3887 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3890 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3892 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3896 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3897 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3900 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3902 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3906 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3907 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3908 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3909 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3913 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3914 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3915 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3918 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3923 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3924 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3925 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3928 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3933 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3934 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3935 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3938 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3943 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3944 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3945 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3948 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3953 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3954 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3955 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3958 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3963 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3964 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3965 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3968 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3973 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3974 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3975 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3978 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3983 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3984 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3985 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3988 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3991 MsiCloseHandle(hpkg
);
3993 /* uninstall the product */
3994 r
= MsiInstallProduct(msifile
, "REMOVE=ALL");
3995 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3997 /* all features installed locally */
3998 r
= MsiInstallProduct(msifile2
, "ADDLOCAL=ALL");
3999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4001 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_DIRECT
, &hdb
);
4002 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4004 /* these properties must not be in the saved msi file */
4005 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,two,three,four,five,six,seven'");
4006 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4008 hpkg
= package_from_db( hdb
);
4009 ok( hpkg
, "failed to create package\n");
4013 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4014 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4015 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4016 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4020 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4021 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4022 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4023 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4027 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4028 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4029 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4030 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4034 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4035 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4036 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4037 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4041 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4042 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4043 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4044 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4048 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4049 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4050 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4051 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4055 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4056 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4057 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4058 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4062 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4063 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4064 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4065 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4069 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4070 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4071 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4072 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4076 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4077 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4078 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4079 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4083 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4084 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4085 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4086 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4090 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4091 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4092 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4093 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4097 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4098 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4099 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4100 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4104 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4105 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4106 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4107 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4111 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4112 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4113 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4114 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4118 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4119 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4120 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4121 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4125 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4126 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4127 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4128 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4132 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4133 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4134 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4135 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4139 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4140 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4141 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4142 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4146 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4147 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4148 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4149 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4153 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4154 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4155 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4156 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4160 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4161 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4162 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4163 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4167 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4168 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4169 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4170 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4174 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4175 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4176 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4177 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4181 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4182 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4183 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4184 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4186 r
= MsiDoAction( hpkg
, "CostInitialize");
4187 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4191 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4192 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4193 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4194 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4198 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4199 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4200 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4201 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4205 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4206 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4207 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4208 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4212 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4213 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4214 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4215 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4219 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4220 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4221 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4222 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4226 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4227 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4228 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4229 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4233 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4234 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4235 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4236 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4240 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4241 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4242 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4243 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4247 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4248 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4249 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4250 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4254 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4255 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4256 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4257 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4261 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4262 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4263 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4264 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4268 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4269 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4270 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4271 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4275 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4276 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4277 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4278 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4282 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4283 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4284 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4285 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4289 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4290 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4291 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4292 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4296 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4297 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4298 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4299 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4303 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4304 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4305 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4306 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4310 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4311 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4312 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4313 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4317 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4318 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4319 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4320 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4324 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4325 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4326 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4327 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4331 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4332 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4333 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4334 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4338 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4339 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4340 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4341 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4345 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4346 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4347 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4348 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4352 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4353 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4354 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4355 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4359 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4360 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4361 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4362 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4364 r
= MsiDoAction( hpkg
, "FileCost");
4365 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
4369 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4370 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4371 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4372 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4376 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4377 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4378 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4379 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4383 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4384 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4385 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4386 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4390 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4391 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4392 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4393 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4397 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4398 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4399 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4400 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4404 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4405 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4406 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4407 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4411 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4412 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4413 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4414 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4418 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4419 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4420 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4421 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4425 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4426 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4427 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4428 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4432 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4433 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4434 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4435 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4439 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4440 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4441 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4442 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4446 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4447 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4448 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4449 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4453 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4454 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4455 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4456 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4460 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4461 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4462 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4463 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4467 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4468 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4469 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4470 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4474 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4475 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4476 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4477 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4481 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4482 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4483 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4484 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4488 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4489 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4490 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4491 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4495 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4496 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4497 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4498 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4502 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4503 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4504 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4505 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4509 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4510 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4511 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4512 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4516 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4517 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4518 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4519 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4523 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4524 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4525 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4526 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4530 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4531 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4532 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4533 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4537 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4538 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4539 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4540 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4542 r
= MsiDoAction( hpkg
, "CostFinalize");
4543 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4547 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4548 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4551 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4553 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4557 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4558 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4561 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4563 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4567 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4568 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4569 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4570 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4574 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4575 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4576 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4577 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4581 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4582 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4585 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4586 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4591 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4592 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4595 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4597 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4601 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4602 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4605 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4607 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4611 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4612 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4615 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4617 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4621 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4622 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4625 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4626 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4631 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4632 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4635 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4637 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4641 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4642 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4645 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4647 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4651 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4652 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4655 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4657 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4661 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4662 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4665 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4667 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4671 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4672 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4675 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4677 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4681 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4682 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4685 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4687 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4691 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4692 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4695 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4697 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4701 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4702 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4703 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4704 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4708 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4709 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4712 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4713 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4718 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4719 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4722 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4723 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4728 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4729 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4732 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4733 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4738 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4739 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4742 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4743 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4748 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4749 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4752 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4753 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4758 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4759 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4762 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4764 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4768 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4769 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4772 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4773 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4778 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4779 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4782 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4783 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4786 MsiCloseHandle(hpkg
);
4788 /* uninstall the product */
4789 r
= MsiInstallProduct(msifile2
, "REMOVE=ALL");
4790 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4792 /* all features installed from source */
4793 r
= MsiInstallProduct(msifile3
, "ADDSOURCE=ALL");
4794 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4796 r
= MsiOpenDatabase(msifile3
, MSIDBOPEN_DIRECT
, &hdb
);
4797 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4799 /* this property must not be in the saved msi file */
4800 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven'");
4801 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4803 hpkg
= package_from_db( hdb
);
4804 ok( hpkg
, "failed to create package\n");
4808 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4809 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4810 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4811 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4815 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4816 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4817 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4818 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4822 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4823 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4824 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4825 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4829 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4830 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4831 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4832 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4836 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4837 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4838 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4839 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4843 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4844 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4845 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4846 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4850 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4851 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4852 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4853 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4857 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4858 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4859 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4860 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4864 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4865 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4866 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4867 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4871 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4872 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4873 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4874 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4878 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4879 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4880 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4881 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4885 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4886 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4887 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4888 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4892 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4893 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4894 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4895 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4899 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4900 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4901 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4902 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4906 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4907 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4908 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4909 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4913 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4914 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4915 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4916 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4920 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4921 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4922 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4923 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4927 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4928 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4929 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4930 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4934 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4935 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4936 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4937 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4941 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4942 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4943 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4944 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4948 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4949 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4950 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4951 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4955 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4956 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4957 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4958 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4962 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4963 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4964 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4965 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4969 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4970 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4971 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4972 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4976 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4977 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4978 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4979 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4981 r
= MsiDoAction( hpkg
, "CostInitialize");
4982 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4986 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4987 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4988 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4989 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4993 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4994 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4995 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4996 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5000 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5001 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5002 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5003 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5007 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5008 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5009 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5010 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5014 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5015 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5016 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5017 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5021 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5022 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5023 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5024 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5028 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5029 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5030 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5031 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5035 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5036 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5037 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5038 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5042 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5043 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5044 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5045 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5049 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5050 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5051 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5052 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5056 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5057 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5058 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5059 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5063 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5064 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5065 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5066 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5070 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5071 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5072 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5073 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5077 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5078 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5079 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5080 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5084 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5085 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5086 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5087 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5091 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5092 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5093 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5094 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5098 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5099 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5100 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5101 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5105 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5106 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5107 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5108 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5112 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5113 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5114 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5115 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5119 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5120 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5121 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5122 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5126 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5127 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5128 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5129 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5133 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5134 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5135 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5136 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5140 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5141 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5142 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5143 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5147 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5148 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5149 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5150 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5154 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5155 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5156 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5157 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5159 r
= MsiDoAction( hpkg
, "FileCost");
5160 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5164 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5165 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5166 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5167 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5171 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5172 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5173 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5174 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5178 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5179 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5180 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5181 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5185 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5186 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5187 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5188 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5192 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5193 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5194 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5195 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5199 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5200 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5201 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5202 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5206 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5207 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5208 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5209 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5213 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5214 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5215 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5216 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5220 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5221 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5222 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5223 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5227 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5228 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5229 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5230 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5234 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5235 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5236 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5237 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5241 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5242 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5243 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5244 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5248 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5249 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5250 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5251 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5255 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5256 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5257 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5258 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5262 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5263 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5264 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5265 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5269 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5270 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5271 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5272 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5276 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5277 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5278 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5279 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5283 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5284 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5285 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5286 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5290 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5291 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5292 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5293 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5297 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5298 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5299 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5300 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5304 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5305 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5306 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5307 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5311 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5312 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5313 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5314 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5318 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5319 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5320 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5321 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5325 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5326 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5327 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5328 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5332 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5333 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5334 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5335 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5337 r
= MsiDoAction( hpkg
, "CostFinalize");
5338 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5342 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5343 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( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5352 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5353 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5356 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5357 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5362 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5363 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5364 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5365 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5369 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5370 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5371 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5372 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5376 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5377 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5380 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5381 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5386 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5387 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5390 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5391 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5396 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5397 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5400 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5401 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5406 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5407 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5410 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5411 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5416 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5417 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5420 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5421 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5426 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5427 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5430 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5431 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5436 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5437 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5440 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5441 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5446 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5447 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5450 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5452 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5456 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5457 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5460 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5461 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5466 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5467 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5470 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5471 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5476 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5477 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5480 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5482 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5486 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5487 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5490 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5492 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5496 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5497 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5498 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5499 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5503 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5504 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5507 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5508 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5513 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5514 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5517 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5518 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5523 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5524 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5527 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5528 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5533 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5534 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5537 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5538 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5543 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5544 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5547 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5548 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5553 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5554 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5557 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5558 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5563 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5564 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5567 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5568 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5573 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5574 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5577 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5578 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5581 MsiCloseHandle(hpkg
);
5583 /* uninstall the product */
5584 r
= MsiInstallProduct(msifile3
, "REMOVE=ALL");
5585 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5587 DeleteFileA(msifile
);
5588 DeleteFileA(msifile2
);
5589 DeleteFileA(msifile3
);
5592 static void test_getproperty(void)
5594 MSIHANDLE hPackage
= 0;
5596 static CHAR empty
[] = "";
5600 hPackage
= package_from_db(create_package_db());
5601 ok( hPackage
!= 0, " Failed to create package\n");
5603 /* set the property */
5604 r
= MsiSetProperty(hPackage
, "Name", "Value");
5605 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5607 /* retrieve the size, NULL pointer */
5609 r
= MsiGetProperty(hPackage
, "Name", NULL
, &size
);
5610 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5611 ok( size
== 5, "Expected 5, got %d\n", size
);
5613 /* retrieve the size, empty string */
5615 r
= MsiGetProperty(hPackage
, "Name", empty
, &size
);
5616 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
5617 ok( size
== 5, "Expected 5, got %d\n", size
);
5619 /* don't change size */
5620 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
5621 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
5622 ok( size
== 5, "Expected 5, got %d\n", size
);
5623 ok( !lstrcmp(prop
, "Valu"), "Expected Valu, got %s\n", prop
);
5625 /* increase the size by 1 */
5627 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
5628 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5629 ok( size
== 5, "Expected 5, got %d\n", size
);
5630 ok( !lstrcmp(prop
, "Value"), "Expected Value, got %s\n", prop
);
5632 r
= MsiCloseHandle( hPackage
);
5633 ok( r
== ERROR_SUCCESS
, "Failed to close package\n" );
5634 DeleteFile(msifile
);
5637 static void test_removefiles(void)
5643 hdb
= create_package_db();
5644 ok ( hdb
, "failed to create package database\n" );
5646 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
5647 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
5649 r
= create_feature_table( hdb
);
5650 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
5652 r
= create_component_table( hdb
);
5653 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
5655 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
5656 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5658 r
= add_component_entry( hdb
, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
5659 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5661 r
= add_component_entry( hdb
, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
5662 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5664 r
= add_component_entry( hdb
, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
5665 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5667 r
= add_component_entry( hdb
, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
5668 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5670 r
= add_component_entry( hdb
, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
5671 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5673 r
= add_component_entry( hdb
, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
5674 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5676 r
= create_feature_components_table( hdb
);
5677 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
5679 r
= add_feature_components_entry( hdb
, "'one', 'hydrogen'" );
5680 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5682 r
= add_feature_components_entry( hdb
, "'one', 'helium'" );
5683 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5685 r
= add_feature_components_entry( hdb
, "'one', 'lithium'" );
5686 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5688 r
= add_feature_components_entry( hdb
, "'one', 'beryllium'" );
5689 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5691 r
= add_feature_components_entry( hdb
, "'one', 'boron'" );
5692 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5694 r
= add_feature_components_entry( hdb
, "'one', 'carbon'" );
5695 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5697 r
= create_file_table( hdb
);
5698 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
5700 r
= add_file_entry( hdb
, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
5701 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5703 r
= add_file_entry( hdb
, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
5704 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5706 r
= add_file_entry( hdb
, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
5707 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5709 r
= add_file_entry( hdb
, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
5710 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5712 r
= add_file_entry( hdb
, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
5713 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5715 r
= add_file_entry( hdb
, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
5716 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5718 r
= create_remove_file_table( hdb
);
5719 ok( r
== ERROR_SUCCESS
, "cannot create Remove File table: %d\n", r
);
5721 hpkg
= package_from_db( hdb
);
5722 ok( hpkg
, "failed to create package\n");
5724 MsiCloseHandle( hdb
);
5726 create_test_file( "hydrogen.txt" );
5727 create_test_file( "helium.txt" );
5728 create_test_file( "lithium.txt" );
5729 create_test_file( "beryllium.txt" );
5730 create_test_file( "boron.txt" );
5731 create_test_file( "carbon.txt" );
5733 r
= MsiSetProperty( hpkg
, "TARGETDIR", CURR_DIR
);
5734 ok( r
== ERROR_SUCCESS
, "set property failed\n");
5736 r
= MsiDoAction( hpkg
, "CostInitialize");
5737 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5739 r
= MsiDoAction( hpkg
, "FileCost");
5740 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5742 r
= MsiDoAction( hpkg
, "CostFinalize");
5743 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5745 r
= MsiDoAction( hpkg
, "InstallValidate");
5746 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5748 r
= MsiSetComponentState( hpkg
, "hydrogen", INSTALLSTATE_ABSENT
);
5749 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5751 r
= MsiSetComponentState( hpkg
, "helium", INSTALLSTATE_LOCAL
);
5752 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5754 r
= MsiSetComponentState( hpkg
, "lithium", INSTALLSTATE_SOURCE
);
5755 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5757 r
= MsiSetComponentState( hpkg
, "beryllium", INSTALLSTATE_ABSENT
);
5758 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5760 r
= MsiSetComponentState( hpkg
, "boron", INSTALLSTATE_LOCAL
);
5761 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5763 r
= MsiSetComponentState( hpkg
, "carbon", INSTALLSTATE_SOURCE
);
5764 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5766 r
= MsiDoAction( hpkg
, "RemoveFiles");
5767 ok( r
== ERROR_SUCCESS
, "remove files failed\n");
5769 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
5770 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
5771 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
5772 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
5773 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
5774 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
5776 MsiCloseHandle( hpkg
);
5777 DeleteFileA(msifile
);
5780 static void test_appsearch(void)
5785 CHAR prop
[MAX_PATH
];
5786 DWORD size
= MAX_PATH
;
5788 hdb
= create_package_db();
5789 ok ( hdb
, "failed to create package database\n" );
5791 r
= create_appsearch_table( hdb
);
5792 ok( r
== ERROR_SUCCESS
, "cannot create AppSearch table: %d\n", r
);
5794 r
= add_appsearch_entry( hdb
, "'WEBBROWSERPROG', 'NewSignature1'" );
5795 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
5797 r
= create_reglocator_table( hdb
);
5798 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
5800 r
= add_reglocator_entry( hdb
, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
5801 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
5803 r
= create_signature_table( hdb
);
5804 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
5806 r
= add_signature_entry( hdb
, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
5807 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
5809 hpkg
= package_from_db( hdb
);
5810 ok( hpkg
, "failed to create package\n");
5812 MsiCloseHandle( hdb
);
5814 r
= MsiDoAction( hpkg
, "AppSearch" );
5815 ok( r
== ERROR_SUCCESS
, "AppSearch failed: %d\n", r
);
5817 r
= MsiGetPropertyA( hpkg
, "WEBBROWSERPROG", prop
, &size
);
5818 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
5819 ok( lstrlenA(prop
) != 0, "Expected non-zero length\n");
5821 MsiCloseHandle( hpkg
);
5822 DeleteFileA(msifile
);
5825 static void test_featureparents(void)
5830 INSTALLSTATE state
, action
;
5832 hdb
= create_package_db();
5833 ok ( hdb
, "failed to create package database\n" );
5835 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
5836 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
5838 r
= create_feature_table( hdb
);
5839 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
5841 r
= create_component_table( hdb
);
5842 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
5844 r
= create_feature_components_table( hdb
);
5845 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
5847 r
= create_file_table( hdb
);
5848 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
5850 /* msidbFeatureAttributesFavorLocal */
5851 r
= add_feature_entry( hdb
, "'zodiac', '', '', '', 2, 1, '', 0" );
5852 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5854 /* msidbFeatureAttributesFavorSource */
5855 r
= add_feature_entry( hdb
, "'perseus', '', '', '', 2, 1, '', 1" );
5856 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5858 /* msidbFeatureAttributesFavorLocal */
5859 r
= add_feature_entry( hdb
, "'orion', '', '', '', 2, 1, '', 0" );
5860 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5862 /* disabled because of install level */
5863 r
= add_feature_entry( hdb
, "'waters', '', '', '', 15, 101, '', 9" );
5864 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5866 /* child feature of disabled feature */
5867 r
= add_feature_entry( hdb
, "'bayer', 'waters', '', '', 14, 1, '', 9" );
5868 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5870 /* component of disabled feature (install level) */
5871 r
= add_component_entry( hdb
, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
5872 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5874 /* component of disabled child feature (install level) */
5875 r
= add_component_entry( hdb
, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
5876 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5878 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5879 r
= add_component_entry( hdb
, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
5880 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5882 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5883 r
= add_component_entry( hdb
, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
5884 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5886 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5887 r
= add_component_entry( hdb
, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
5888 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5890 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
5891 r
= add_component_entry( hdb
, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
5892 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5894 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
5895 r
= add_component_entry( hdb
, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
5896 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5898 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
5899 r
= add_component_entry( hdb
, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
5900 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5902 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
5903 r
= add_component_entry( hdb
, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
5904 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5906 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
5907 r
= add_component_entry( hdb
, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
5908 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5910 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
5911 r
= add_component_entry( hdb
, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
5913 r
= add_feature_components_entry( hdb
, "'zodiac', 'leo'" );
5914 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5916 r
= add_feature_components_entry( hdb
, "'zodiac', 'virgo'" );
5917 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5919 r
= add_feature_components_entry( hdb
, "'zodiac', 'libra'" );
5920 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5922 r
= add_feature_components_entry( hdb
, "'perseus', 'cassiopeia'" );
5923 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5925 r
= add_feature_components_entry( hdb
, "'perseus', 'cepheus'" );
5926 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5928 r
= add_feature_components_entry( hdb
, "'perseus', 'andromeda'" );
5929 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5931 r
= add_feature_components_entry( hdb
, "'orion', 'leo'" );
5932 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5934 r
= add_feature_components_entry( hdb
, "'orion', 'virgo'" );
5935 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5937 r
= add_feature_components_entry( hdb
, "'orion', 'libra'" );
5938 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5940 r
= add_feature_components_entry( hdb
, "'orion', 'cassiopeia'" );
5941 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5943 r
= add_feature_components_entry( hdb
, "'orion', 'cepheus'" );
5944 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5946 r
= add_feature_components_entry( hdb
, "'orion', 'andromeda'" );
5947 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5949 r
= add_feature_components_entry( hdb
, "'orion', 'canis'" );
5950 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5952 r
= add_feature_components_entry( hdb
, "'orion', 'monoceros'" );
5953 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5955 r
= add_feature_components_entry( hdb
, "'orion', 'lepus'" );
5956 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5958 r
= add_feature_components_entry( hdb
, "'waters', 'delphinus'" );
5959 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5961 r
= add_feature_components_entry( hdb
, "'bayer', 'hydrus'" );
5962 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5964 r
= add_file_entry( hdb
, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
5965 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5967 r
= add_file_entry( hdb
, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
5968 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5970 r
= add_file_entry( hdb
, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
5971 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5973 r
= add_file_entry( hdb
, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
5974 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5976 r
= add_file_entry( hdb
, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
5977 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5979 r
= add_file_entry( hdb
, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
5980 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5982 r
= add_file_entry( hdb
, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
5983 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5985 r
= add_file_entry( hdb
, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
5986 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5988 r
= add_file_entry( hdb
, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
5989 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5991 r
= add_file_entry( hdb
, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
5992 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5994 r
= add_file_entry( hdb
, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
5995 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5997 hpkg
= package_from_db( hdb
);
5998 ok( hpkg
, "failed to create package\n");
6000 MsiCloseHandle( hdb
);
6002 r
= MsiDoAction( hpkg
, "CostInitialize");
6003 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
6005 r
= MsiDoAction( hpkg
, "FileCost");
6006 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
6008 r
= MsiDoAction( hpkg
, "CostFinalize");
6009 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
6013 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
6014 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6015 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6016 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6020 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
6021 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6022 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6023 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6027 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
6028 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6029 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6030 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6034 r
= MsiGetFeatureState(hpkg
, "waters", &state
, &action
);
6035 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6036 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6037 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6041 r
= MsiGetFeatureState(hpkg
, "bayer", &state
, &action
);
6042 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6043 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6044 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6048 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
6049 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6050 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6051 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6055 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
6056 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6057 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
6058 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
6062 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
6063 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6064 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
6065 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
6069 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
6070 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6071 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
6072 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
6076 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
6077 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6078 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6079 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
6083 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
6084 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6085 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
6086 ok( action
== INSTALLSTATE_LOCAL
, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action
);
6090 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
6091 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6092 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
6093 ok( action
== INSTALLSTATE_LOCAL
, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action
);
6097 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
6098 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6099 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
6100 ok( action
== INSTALLSTATE_SOURCE
, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action
);
6104 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
6105 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6106 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6107 ok( action
== INSTALLSTATE_LOCAL
, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action
);
6111 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
6112 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6113 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6114 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
6118 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
6119 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6120 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6121 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
6123 r
= MsiSetFeatureState(hpkg
, "orion", INSTALLSTATE_ABSENT
);
6124 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
6128 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
6129 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6130 ok( state
== INSTALLSTATE_ABSENT
, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state
);
6131 ok( action
== INSTALLSTATE_LOCAL
, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action
);
6135 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
6136 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6137 ok( state
== INSTALLSTATE_ABSENT
, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state
);
6138 ok( action
== INSTALLSTATE_SOURCE
, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action
);
6142 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
6143 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6144 ok( state
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state
);
6145 ok( action
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action
);
6149 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
6150 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6151 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state
);
6152 ok( action
== INSTALLSTATE_LOCAL
, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action
);
6156 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
6157 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6158 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
6159 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
6163 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
6164 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6165 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
6166 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
6170 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
6171 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6172 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
6173 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
6177 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
6178 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6179 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6180 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
6184 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
6185 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6186 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
6187 ok( action
== INSTALLSTATE_SOURCE
, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action
);
6191 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
6192 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6193 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
6194 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action
);
6198 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
6199 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6200 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
6201 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action
);
6205 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
6206 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6207 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6208 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action
);
6212 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
6213 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6214 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6215 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
6219 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
6220 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6221 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
6222 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
6224 MsiCloseHandle(hpkg
);
6225 DeleteFileA(msifile
);
6228 static void test_installprops(void)
6230 MSIHANDLE hpkg
, hdb
;
6231 CHAR path
[MAX_PATH
];
6239 GetCurrentDirectory(MAX_PATH
, path
);
6240 lstrcat(path
, "\\");
6241 lstrcat(path
, msifile
);
6243 hdb
= create_package_db();
6244 ok( hdb
, "failed to create database\n");
6246 hpkg
= package_from_db(hdb
);
6247 ok( hpkg
, "failed to create package\n");
6249 MsiCloseHandle(hdb
);
6252 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
6253 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6254 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
6256 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
6258 RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2
);
6263 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
6267 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
6270 /* win9x doesn't set this */
6274 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
6275 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6276 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
6282 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
6286 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
6292 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
6293 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6294 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
6298 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
6299 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6300 trace("VersionDatabase = %s\n", buf
);
6303 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
6304 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6305 trace("VersionMsi = %s\n", buf
);
6308 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
6309 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6310 trace("Date = %s\n", buf
);
6313 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
6314 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6315 trace("Time = %s\n", buf
);
6318 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
6319 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
6320 trace("PackageCode = %s\n", buf
);
6322 langid
= GetUserDefaultLangID();
6323 sprintf(path
, "%d", langid
);
6326 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
6327 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS< got %d\n", r
);
6328 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
6330 res
= GetSystemMetrics(SM_CXSCREEN
);
6332 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
6333 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
6335 res
= GetSystemMetrics(SM_CYSCREEN
);
6337 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
6338 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
6342 MsiCloseHandle(hpkg
);
6343 DeleteFile(msifile
);
6346 static void test_launchconditions(void)
6352 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6354 hdb
= create_package_db();
6355 ok( hdb
, "failed to create package database\n" );
6357 r
= create_launchcondition_table( hdb
);
6358 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
6360 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
6361 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
6363 /* invalid condition */
6364 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
6365 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
6367 hpkg
= package_from_db( hdb
);
6368 ok( hpkg
, "failed to create package\n");
6370 MsiCloseHandle( hdb
);
6372 r
= MsiSetProperty( hpkg
, "X", "1" );
6373 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
6375 /* invalid conditions are ignored */
6376 r
= MsiDoAction( hpkg
, "LaunchConditions" );
6377 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
6379 /* verify LaunchConditions still does some verification */
6380 r
= MsiSetProperty( hpkg
, "X", "2" );
6381 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
6383 r
= MsiDoAction( hpkg
, "LaunchConditions" );
6384 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
6386 MsiCloseHandle( hpkg
);
6387 DeleteFile( msifile
);
6390 static void test_ccpsearch(void)
6392 MSIHANDLE hdb
, hpkg
;
6393 CHAR prop
[MAX_PATH
];
6394 DWORD size
= MAX_PATH
;
6397 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6399 hdb
= create_package_db();
6400 ok(hdb
, "failed to create package database\n");
6402 r
= create_ccpsearch_table(hdb
);
6403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6405 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
6406 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6408 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
6409 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6411 r
= create_reglocator_table(hdb
);
6412 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6414 r
= add_reglocator_entry(hdb
, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
6415 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6417 r
= create_drlocator_table(hdb
);
6418 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6420 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
6421 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6423 r
= create_signature_table(hdb
);
6424 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6426 hpkg
= package_from_db(hdb
);
6427 ok(hpkg
, "failed to create package\n");
6429 MsiCloseHandle(hdb
);
6431 r
= MsiDoAction(hpkg
, "CCPSearch");
6432 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6434 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
6435 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6436 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
6438 MsiCloseHandle(hpkg
);
6439 DeleteFileA(msifile
);
6442 static BOOL
squash_guid(LPCWSTR in
, LPWSTR out
)
6447 if (FAILED(CLSIDFromString((LPOLESTR
)in
, &guid
)))
6454 out
[11-i
] = in
[n
++];
6457 out
[15-i
] = in
[n
++];
6461 out
[17+i
*2] = in
[n
++];
6462 out
[16+i
*2] = in
[n
++];
6467 out
[17+i
*2] = in
[n
++];
6468 out
[16+i
*2] = in
[n
++];
6474 static void set_component_path(LPCSTR filename
, LPCSTR guid
)
6476 WCHAR guidW
[MAX_PATH
];
6477 WCHAR squashedW
[MAX_PATH
];
6478 CHAR squashed
[MAX_PATH
];
6479 CHAR substr
[MAX_PATH
];
6480 CHAR path
[MAX_PATH
];
6483 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
6484 squash_guid(guidW
, squashedW
);
6485 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
6487 lstrcpyA(substr
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6488 "Installer\\UserData\\S-1-5-18\\Components\\");
6489 lstrcatA(substr
, squashed
);
6491 RegCreateKeyA(HKEY_LOCAL_MACHINE
, substr
, &hkey
);
6493 lstrcpyA(path
, CURR_DIR
);
6494 lstrcatA(path
, "\\");
6495 lstrcatA(path
, filename
);
6497 /* just using a random squashed product code */
6498 RegSetValueExA(hkey
, "7D2F387510109040002000060BECB6AB", 0,
6499 REG_SZ
, (LPBYTE
)path
, lstrlenA(path
));
6503 lstrcpyA(substr
, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6504 RegCreateKeyA(HKEY_LOCAL_MACHINE
, substr
, &hkey
);
6507 static void delete_component_path(LPCSTR guid
)
6509 WCHAR guidW
[MAX_PATH
];
6510 WCHAR squashedW
[MAX_PATH
];
6511 WCHAR substrW
[MAX_PATH
];
6512 CHAR squashed
[MAX_PATH
];
6513 CHAR substr
[MAX_PATH
];
6515 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
6516 squash_guid(guidW
, squashedW
);
6517 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
6519 lstrcpyA(substr
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
6520 "Installer\\UserData\\S-1-5-18\\Components\\");
6521 lstrcatA(substr
, squashed
);
6523 MultiByteToWideChar(CP_ACP
, 0, substr
, -1, substrW
, MAX_PATH
);
6524 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
6526 lstrcpyA(substr
, "SOFTWARE\\Classes\\Installer\\Products\\7D2F387510109040002000060BECB6AB");
6527 MultiByteToWideChar(CP_ACP
, 0, substr
, -1, substrW
, MAX_PATH
);
6528 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
6531 static void test_complocator(void)
6533 MSIHANDLE hdb
, hpkg
;
6535 CHAR prop
[MAX_PATH
];
6536 CHAR expected
[MAX_PATH
];
6537 DWORD size
= MAX_PATH
;
6539 hdb
= create_package_db();
6540 ok(hdb
, "failed to create package database\n");
6542 r
= create_appsearch_table(hdb
);
6543 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6545 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
6546 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6548 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
6549 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6551 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
6552 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6554 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
6555 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6557 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
6558 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6560 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
6561 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6563 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
6564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6566 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
6567 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6569 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
6570 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6572 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
6573 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6575 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
6576 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6578 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
6579 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6581 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
6582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6584 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
6585 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6587 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
6588 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6590 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
6591 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6593 r
= create_complocator_table(hdb
);
6594 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6596 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
6597 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6599 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
6600 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6602 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
6603 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6605 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
6606 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6608 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
6609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6611 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
6612 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6614 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
6615 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6617 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
6618 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6620 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
6621 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6623 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
6624 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6626 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
6627 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6629 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
6630 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6632 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
6633 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6635 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
6636 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6638 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
6639 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6641 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
6642 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6644 r
= create_signature_table(hdb
);
6645 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6647 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
6648 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6650 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
6651 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6653 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
6654 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6656 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
6657 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6659 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
6660 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6662 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
6663 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6665 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
6666 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6668 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
6669 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6671 hpkg
= package_from_db(hdb
);
6672 ok(hpkg
, "failed to create package\n");
6674 MsiCloseHandle(hdb
);
6676 create_test_file("abelisaurus");
6677 create_test_file("bactrosaurus");
6678 create_test_file("camelotia");
6679 create_test_file("diclonius");
6680 create_test_file("echinodon");
6681 create_test_file("falcarius");
6682 create_test_file("gallimimus");
6683 create_test_file("hagryphus");
6684 CreateDirectoryA("iguanodon", NULL
);
6685 CreateDirectoryA("jobaria", NULL
);
6686 CreateDirectoryA("kakuru", NULL
);
6687 CreateDirectoryA("labocania", NULL
);
6688 CreateDirectoryA("megaraptor", NULL
);
6689 CreateDirectoryA("neosodon", NULL
);
6690 CreateDirectoryA("olorotitan", NULL
);
6691 CreateDirectoryA("pantydraco", NULL
);
6693 set_component_path("abelisaurus", "{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6694 set_component_path("bactrosaurus", "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6695 set_component_path("echinodon", "{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6696 set_component_path("falcarius", "{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6697 set_component_path("iguanodon", "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6698 set_component_path("jobaria", "{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6699 set_component_path("megaraptor", "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6700 set_component_path("neosodon", "{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6702 r
= MsiDoAction(hpkg
, "AppSearch");
6703 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6706 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
6707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6709 lstrcpyA(expected
, CURR_DIR
);
6710 lstrcatA(expected
, "\\abelisaurus");
6711 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6712 "Expected %s or empty string, got %s\n", expected
, prop
);
6715 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", prop
, &size
);
6716 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6717 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6720 r
= MsiGetPropertyA(hpkg
, "CAMELOTIA", prop
, &size
);
6721 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6722 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6725 r
= MsiGetPropertyA(hpkg
, "DICLONIUS", prop
, &size
);
6726 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6727 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6730 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
6731 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6733 lstrcpyA(expected
, CURR_DIR
);
6734 lstrcatA(expected
, "\\");
6735 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6736 "Expected %s or empty string, got %s\n", expected
, prop
);
6739 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
6740 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6741 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6744 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
6745 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6746 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6749 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
6750 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6751 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6754 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
6755 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6756 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6759 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
6760 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6761 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6764 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
6765 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6766 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6769 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
6770 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6771 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6774 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
6775 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6777 lstrcpyA(expected
, CURR_DIR
);
6778 lstrcatA(expected
, "\\");
6779 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6780 "Expected %s or empty string, got %s\n", expected
, prop
);
6783 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
6784 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6786 lstrcpyA(expected
, CURR_DIR
);
6787 lstrcatA(expected
, "\\neosodon\\");
6788 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
6789 "Expected %s or empty string, got %s\n", expected
, prop
);
6792 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
6793 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6794 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6797 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
6798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6799 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
6801 MsiCloseHandle(hpkg
);
6802 DeleteFileA("abelisaurus");
6803 DeleteFileA("bactrosaurus");
6804 DeleteFileA("camelotia");
6805 DeleteFileA("diclonius");
6806 DeleteFileA("echinodon");
6807 DeleteFileA("falcarius");
6808 DeleteFileA("gallimimus");
6809 DeleteFileA("hagryphus");
6810 RemoveDirectoryA("iguanodon");
6811 RemoveDirectoryA("jobaria");
6812 RemoveDirectoryA("kakuru");
6813 RemoveDirectoryA("labocania");
6814 RemoveDirectoryA("megaraptor");
6815 RemoveDirectoryA("neosodon");
6816 RemoveDirectoryA("olorotitan");
6817 RemoveDirectoryA("pantydraco");
6818 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}");
6819 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}");
6820 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}");
6821 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}");
6822 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}");
6823 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}");
6824 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}");
6825 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}");
6826 DeleteFileA(msifile
);
6829 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
6834 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
6835 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6837 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
6838 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6840 r
= MsiSummaryInfoPersist(summary
);
6841 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6843 MsiCloseHandle(summary
);
6846 static void test_MsiGetSourcePath(void)
6848 MSIHANDLE hdb
, hpkg
;
6849 CHAR path
[MAX_PATH
];
6851 CHAR subsrc
[MAX_PATH
];
6852 CHAR sub2
[MAX_PATH
];
6856 lstrcpyA(cwd
, CURR_DIR
);
6857 lstrcatA(cwd
, "\\");
6859 lstrcpyA(subsrc
, cwd
);
6860 lstrcatA(subsrc
, "subsource");
6861 lstrcatA(subsrc
, "\\");
6863 lstrcpyA(sub2
, subsrc
);
6864 lstrcatA(sub2
, "sub2");
6865 lstrcatA(sub2
, "\\");
6867 /* uncompressed source */
6869 hdb
= create_package_db();
6870 ok( hdb
, "failed to create database\n");
6872 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
6874 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
6875 ok(r
== S_OK
, "failed\n");
6877 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
6878 ok(r
== S_OK
, "failed\n");
6880 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
6881 ok(r
== S_OK
, "failed\n");
6883 r
= MsiDatabaseCommit(hdb
);
6884 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
6886 hpkg
= package_from_db(hdb
);
6887 ok(hpkg
, "failed to create package\n");
6889 MsiCloseHandle(hdb
);
6891 /* invalid database handle */
6893 lstrcpyA(path
, "kiwi");
6894 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
6895 ok(r
== ERROR_INVALID_HANDLE
,
6896 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
6897 ok(!lstrcmpA(path
, "kiwi"),
6898 "Expected path to be unchanged, got \"%s\"\n", path
);
6899 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6903 lstrcpyA(path
, "kiwi");
6904 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
6905 ok(r
== ERROR_INVALID_PARAMETER
,
6906 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
6907 ok(!lstrcmpA(path
, "kiwi"),
6908 "Expected path to be unchanged, got \"%s\"\n", path
);
6909 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6911 /* empty szFolder */
6913 lstrcpyA(path
, "kiwi");
6914 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
6915 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6916 ok(!lstrcmpA(path
, "kiwi"),
6917 "Expected path to be unchanged, got \"%s\"\n", path
);
6918 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6922 lstrcpyA(path
, "kiwi");
6923 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
6924 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6925 ok(!lstrcmpA(path
, "kiwi"),
6926 "Expected path to be unchanged, got \"%s\"\n", path
);
6927 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6931 lstrcpyA(path
, "kiwi");
6932 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6933 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6934 ok(!lstrcmpA(path
, "kiwi"),
6935 "Expected path to be unchanged, got \"%s\"\n", path
);
6936 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6940 lstrcpyA(path
, "kiwi");
6941 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
6942 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6943 ok(!lstrcmpA(path
, "kiwi"),
6944 "Expected path to be unchanged, got \"%s\"\n", path
);
6945 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6947 /* source path does not exist, but the property exists */
6949 lstrcpyA(path
, "kiwi");
6950 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
6951 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6952 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
6953 ok(size
== 0, "Expected 0, got %d\n", size
);
6957 lstrcpyA(path
, "kiwi");
6958 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
6959 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6960 ok(!lstrcmpA(path
, "kiwi"),
6961 "Expected path to be unchanged, got \"%s\"\n", path
);
6962 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6966 lstrcpyA(path
, "kiwi");
6967 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
6968 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6969 ok(!lstrcmpA(path
, "kiwi"),
6970 "Expected path to be unchanged, got \"%s\"\n", path
);
6971 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
6973 r
= MsiDoAction(hpkg
, "CostInitialize");
6974 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
6976 /* try TARGETDIR after CostInitialize */
6978 lstrcpyA(path
, "kiwi");
6979 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
6980 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6981 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6982 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6984 /* try SourceDir after CostInitialize */
6986 lstrcpyA(path
, "kiwi");
6987 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
6988 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6989 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
6990 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
6992 /* try SOURCEDIR after CostInitialize */
6994 lstrcpyA(path
, "kiwi");
6995 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
6996 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
6997 ok(!lstrcmpA(path
, "kiwi"),
6998 "Expected path to be unchanged, got \"%s\"\n", path
);
6999 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7001 /* source path does not exist, but the property exists */
7003 lstrcpyA(path
, "kiwi");
7004 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7005 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7008 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7009 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7012 /* try SubDir after CostInitialize */
7014 lstrcpyA(path
, "kiwi");
7015 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7016 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7017 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7018 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7020 /* try SubDir2 after CostInitialize */
7022 lstrcpyA(path
, "kiwi");
7023 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7024 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7025 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
7026 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
7028 r
= MsiDoAction(hpkg
, "ResolveSource");
7029 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7031 /* try TARGETDIR after ResolveSource */
7033 lstrcpyA(path
, "kiwi");
7034 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
7035 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7036 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7037 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7039 /* try SourceDir after ResolveSource */
7041 lstrcpyA(path
, "kiwi");
7042 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7043 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7044 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7045 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7047 /* try SOURCEDIR after ResolveSource */
7049 lstrcpyA(path
, "kiwi");
7050 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7051 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7052 ok(!lstrcmpA(path
, "kiwi"),
7053 "Expected path to be unchanged, got \"%s\"\n", path
);
7054 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7056 /* source path does not exist, but the property exists */
7058 lstrcpyA(path
, "kiwi");
7059 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7060 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7061 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7062 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7064 /* try SubDir after ResolveSource */
7066 lstrcpyA(path
, "kiwi");
7067 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7068 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7069 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7070 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7072 /* try SubDir2 after ResolveSource */
7074 lstrcpyA(path
, "kiwi");
7075 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7076 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7077 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
7078 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
7080 r
= MsiDoAction(hpkg
, "FileCost");
7081 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7083 /* try TARGETDIR after FileCost */
7085 lstrcpyA(path
, "kiwi");
7086 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
7087 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7088 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7089 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7091 /* try SourceDir after FileCost */
7093 lstrcpyA(path
, "kiwi");
7094 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7095 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7096 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7097 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7099 /* try SOURCEDIR after FileCost */
7101 lstrcpyA(path
, "kiwi");
7102 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7103 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7104 ok(!lstrcmpA(path
, "kiwi"),
7105 "Expected path to be unchanged, got \"%s\"\n", path
);
7106 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7108 /* try SubDir after FileCost */
7110 lstrcpyA(path
, "kiwi");
7111 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7112 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7113 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7114 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7116 /* try SubDir2 after FileCost */
7118 lstrcpyA(path
, "kiwi");
7119 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7120 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7121 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
7122 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
7124 r
= MsiDoAction(hpkg
, "CostFinalize");
7125 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7127 /* try TARGETDIR after CostFinalize */
7129 lstrcpyA(path
, "kiwi");
7130 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
7131 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7132 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7133 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7135 /* try SourceDir after CostFinalize */
7137 lstrcpyA(path
, "kiwi");
7138 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7139 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7140 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7141 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7143 /* try SOURCEDIR after CostFinalize */
7145 lstrcpyA(path
, "kiwi");
7146 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7147 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7148 ok(!lstrcmpA(path
, "kiwi"),
7149 "Expected path to be unchanged, got \"%s\"\n", path
);
7150 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7152 /* try SubDir after CostFinalize */
7154 lstrcpyA(path
, "kiwi");
7155 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7156 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7157 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7158 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7160 /* try SubDir2 after CostFinalize */
7162 lstrcpyA(path
, "kiwi");
7163 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7164 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7165 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
7166 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
7168 /* nonexistent directory */
7170 lstrcpyA(path
, "kiwi");
7171 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
7172 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7173 ok(!lstrcmpA(path
, "kiwi"),
7174 "Expected path to be unchanged, got \"%s\"\n", path
);
7175 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7177 /* NULL szPathBuf */
7179 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
7180 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7181 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7183 /* NULL pcchPathBuf */
7184 lstrcpyA(path
, "kiwi");
7185 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
7186 ok(r
== ERROR_INVALID_PARAMETER
,
7187 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
7188 ok(!lstrcmpA(path
, "kiwi"),
7189 "Expected path to be unchanged, got \"%s\"\n", path
);
7191 /* pcchPathBuf is 0 */
7193 lstrcpyA(path
, "kiwi");
7194 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7195 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7196 ok(!lstrcmpA(path
, "kiwi"),
7197 "Expected path to be unchanged, got \"%s\"\n", path
);
7198 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7200 /* pcchPathBuf does not have room for NULL terminator */
7201 size
= lstrlenA(cwd
);
7202 lstrcpyA(path
, "kiwi");
7203 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7204 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7205 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
7206 "Expected path with no backslash, got \"%s\"\n", path
);
7207 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7209 /* pcchPathBuf has room for NULL terminator */
7210 size
= lstrlenA(cwd
) + 1;
7211 lstrcpyA(path
, "kiwi");
7212 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7213 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7214 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7215 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7217 MsiCloseHandle(hpkg
);
7219 /* compressed source */
7221 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
7222 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7224 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
7226 hpkg
= package_from_db(hdb
);
7227 ok(hpkg
, "failed to create package\n");
7229 r
= MsiDoAction(hpkg
, "CostInitialize");
7230 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7231 r
= MsiDoAction(hpkg
, "FileCost");
7232 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7233 r
= MsiDoAction(hpkg
, "CostFinalize");
7234 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7236 /* try TARGETDIR after CostFinalize */
7238 lstrcpyA(path
, "kiwi");
7239 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
7240 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7241 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7242 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7244 /* try SourceDir after CostFinalize */
7246 lstrcpyA(path
, "kiwi");
7247 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7248 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7249 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7250 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7252 /* try SOURCEDIR after CostFinalize */
7254 lstrcpyA(path
, "kiwi");
7255 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7258 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7259 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7260 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7263 /* try SubDir after CostFinalize */
7265 lstrcpyA(path
, "kiwi");
7266 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7267 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7268 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7269 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7271 /* try SubDir2 after CostFinalize */
7273 lstrcpyA(path
, "kiwi");
7274 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7275 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7276 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7277 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7279 MsiCloseHandle(hpkg
);
7280 DeleteFile(msifile
);
7283 static void test_shortlongsource(void)
7285 MSIHANDLE hdb
, hpkg
;
7286 CHAR path
[MAX_PATH
];
7288 CHAR subsrc
[MAX_PATH
];
7292 lstrcpyA(cwd
, CURR_DIR
);
7293 lstrcatA(cwd
, "\\");
7295 lstrcpyA(subsrc
, cwd
);
7296 lstrcatA(subsrc
, "long");
7297 lstrcatA(subsrc
, "\\");
7299 /* long file names */
7301 hdb
= create_package_db();
7302 ok( hdb
, "failed to create database\n");
7304 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
7306 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
7307 ok(r
== S_OK
, "failed\n");
7309 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
7310 ok(r
== S_OK
, "failed\n");
7312 /* CostInitialize:short */
7313 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
7314 ok(r
== S_OK
, "failed\n");
7316 /* CostInitialize:long */
7317 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
7318 ok(r
== S_OK
, "failed\n");
7320 /* FileCost:short */
7321 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
7322 ok(r
== S_OK
, "failed\n");
7325 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
7326 ok(r
== S_OK
, "failed\n");
7328 /* CostFinalize:short */
7329 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
7330 ok(r
== S_OK
, "failed\n");
7332 /* CostFinalize:long */
7333 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
7334 ok(r
== S_OK
, "failed\n");
7336 MsiDatabaseCommit(hdb
);
7338 hpkg
= package_from_db(hdb
);
7339 ok(hpkg
, "failed to create package\n");
7341 MsiCloseHandle(hdb
);
7343 CreateDirectoryA("one", NULL
);
7344 CreateDirectoryA("four", NULL
);
7346 r
= MsiDoAction(hpkg
, "CostInitialize");
7347 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7349 CreateDirectory("five", NULL
);
7350 CreateDirectory("eight", NULL
);
7352 r
= MsiDoAction(hpkg
, "FileCost");
7353 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7355 CreateDirectory("nine", NULL
);
7356 CreateDirectory("twelve", NULL
);
7358 r
= MsiDoAction(hpkg
, "CostFinalize");
7359 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7361 /* neither short nor long source directories exist */
7363 lstrcpyA(path
, "kiwi");
7364 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7365 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7366 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7367 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7369 CreateDirectoryA("short", NULL
);
7371 /* short source directory exists */
7373 lstrcpyA(path
, "kiwi");
7374 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7375 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7376 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7377 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7379 CreateDirectoryA("long", NULL
);
7381 /* both short and long source directories exist */
7383 lstrcpyA(path
, "kiwi");
7384 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7385 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7386 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7387 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7389 lstrcpyA(subsrc
, cwd
);
7390 lstrcatA(subsrc
, "two");
7391 lstrcatA(subsrc
, "\\");
7393 /* short dir exists before CostInitialize */
7395 lstrcpyA(path
, "kiwi");
7396 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7398 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7399 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7401 lstrcpyA(subsrc
, cwd
);
7402 lstrcatA(subsrc
, "four");
7403 lstrcatA(subsrc
, "\\");
7405 /* long dir exists before CostInitialize */
7407 lstrcpyA(path
, "kiwi");
7408 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
7409 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7410 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7411 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7413 lstrcpyA(subsrc
, cwd
);
7414 lstrcatA(subsrc
, "six");
7415 lstrcatA(subsrc
, "\\");
7417 /* short dir exists before FileCost */
7419 lstrcpyA(path
, "kiwi");
7420 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
7421 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7422 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7423 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7425 lstrcpyA(subsrc
, cwd
);
7426 lstrcatA(subsrc
, "eight");
7427 lstrcatA(subsrc
, "\\");
7429 /* long dir exists before FileCost */
7431 lstrcpyA(path
, "kiwi");
7432 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
7433 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7434 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7435 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7437 lstrcpyA(subsrc
, cwd
);
7438 lstrcatA(subsrc
, "ten");
7439 lstrcatA(subsrc
, "\\");
7441 /* short dir exists before CostFinalize */
7443 lstrcpyA(path
, "kiwi");
7444 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
7445 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7446 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7447 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7449 lstrcpyA(subsrc
, cwd
);
7450 lstrcatA(subsrc
, "twelve");
7451 lstrcatA(subsrc
, "\\");
7453 /* long dir exists before CostFinalize */
7455 lstrcpyA(path
, "kiwi");
7456 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
7457 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7458 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7459 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7461 MsiCloseHandle(hpkg
);
7462 RemoveDirectoryA("short");
7463 RemoveDirectoryA("long");
7464 RemoveDirectoryA("one");
7465 RemoveDirectoryA("four");
7466 RemoveDirectoryA("five");
7467 RemoveDirectoryA("eight");
7468 RemoveDirectoryA("nine");
7469 RemoveDirectoryA("twelve");
7471 /* short file names */
7473 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
7474 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7476 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
7478 hpkg
= package_from_db(hdb
);
7479 ok(hpkg
, "failed to create package\n");
7481 MsiCloseHandle(hdb
);
7483 CreateDirectoryA("one", NULL
);
7484 CreateDirectoryA("four", NULL
);
7486 r
= MsiDoAction(hpkg
, "CostInitialize");
7487 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7489 CreateDirectory("five", NULL
);
7490 CreateDirectory("eight", NULL
);
7492 r
= MsiDoAction(hpkg
, "FileCost");
7493 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7495 CreateDirectory("nine", NULL
);
7496 CreateDirectory("twelve", NULL
);
7498 r
= MsiDoAction(hpkg
, "CostFinalize");
7499 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7501 lstrcpyA(subsrc
, cwd
);
7502 lstrcatA(subsrc
, "short");
7503 lstrcatA(subsrc
, "\\");
7505 /* neither short nor long source directories exist */
7507 lstrcpyA(path
, "kiwi");
7508 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7510 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7511 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7513 CreateDirectoryA("short", NULL
);
7515 /* short source directory exists */
7517 lstrcpyA(path
, "kiwi");
7518 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7519 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7520 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7521 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7523 CreateDirectoryA("long", NULL
);
7525 /* both short and long source directories exist */
7527 lstrcpyA(path
, "kiwi");
7528 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
7529 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7530 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7531 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7533 lstrcpyA(subsrc
, cwd
);
7534 lstrcatA(subsrc
, "one");
7535 lstrcatA(subsrc
, "\\");
7537 /* short dir exists before CostInitialize */
7539 lstrcpyA(path
, "kiwi");
7540 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
7541 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7542 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7543 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7545 lstrcpyA(subsrc
, cwd
);
7546 lstrcatA(subsrc
, "three");
7547 lstrcatA(subsrc
, "\\");
7549 /* long dir exists before CostInitialize */
7551 lstrcpyA(path
, "kiwi");
7552 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
7553 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7554 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7555 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7557 lstrcpyA(subsrc
, cwd
);
7558 lstrcatA(subsrc
, "five");
7559 lstrcatA(subsrc
, "\\");
7561 /* short dir exists before FileCost */
7563 lstrcpyA(path
, "kiwi");
7564 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
7565 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7566 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7567 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7569 lstrcpyA(subsrc
, cwd
);
7570 lstrcatA(subsrc
, "seven");
7571 lstrcatA(subsrc
, "\\");
7573 /* long dir exists before FileCost */
7575 lstrcpyA(path
, "kiwi");
7576 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
7577 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7578 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7579 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7581 lstrcpyA(subsrc
, cwd
);
7582 lstrcatA(subsrc
, "nine");
7583 lstrcatA(subsrc
, "\\");
7585 /* short dir exists before CostFinalize */
7587 lstrcpyA(path
, "kiwi");
7588 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
7589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7590 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7591 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7593 lstrcpyA(subsrc
, cwd
);
7594 lstrcatA(subsrc
, "eleven");
7595 lstrcatA(subsrc
, "\\");
7597 /* long dir exists before CostFinalize */
7599 lstrcpyA(path
, "kiwi");
7600 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
7601 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7602 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
7603 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
7605 MsiCloseHandle(hpkg
);
7606 RemoveDirectoryA("short");
7607 RemoveDirectoryA("long");
7608 RemoveDirectoryA("one");
7609 RemoveDirectoryA("four");
7610 RemoveDirectoryA("five");
7611 RemoveDirectoryA("eight");
7612 RemoveDirectoryA("nine");
7613 RemoveDirectoryA("twelve");
7614 DeleteFileA(msifile
);
7617 static void test_sourcedir(void)
7619 MSIHANDLE hdb
, hpkg
;
7621 CHAR path
[MAX_PATH
];
7623 CHAR subsrc
[MAX_PATH
];
7627 lstrcpyA(cwd
, CURR_DIR
);
7628 lstrcatA(cwd
, "\\");
7630 lstrcpyA(subsrc
, cwd
);
7631 lstrcatA(subsrc
, "long");
7632 lstrcatA(subsrc
, "\\");
7634 hdb
= create_package_db();
7635 ok( hdb
, "failed to create database\n");
7637 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
7638 ok(r
== S_OK
, "failed\n");
7640 sprintf(package
, "#%li", hdb
);
7641 r
= MsiOpenPackage(package
, &hpkg
);
7642 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7644 /* properties only */
7646 /* SourceDir prop */
7648 lstrcpyA(path
, "kiwi");
7649 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7650 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7651 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7652 ok(size
== 0, "Expected 0, got %d\n", size
);
7654 /* SOURCEDIR prop */
7656 lstrcpyA(path
, "kiwi");
7657 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7659 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7660 ok(size
== 0, "Expected 0, got %d\n", size
);
7662 r
= MsiDoAction(hpkg
, "CostInitialize");
7663 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7665 /* SourceDir after CostInitialize */
7667 lstrcpyA(path
, "kiwi");
7668 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7669 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7670 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7671 ok(size
== 0, "Expected 0, got %d\n", size
);
7673 /* SOURCEDIR after CostInitialize */
7675 lstrcpyA(path
, "kiwi");
7676 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7677 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7678 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7679 ok(size
== 0, "Expected 0, got %d\n", size
);
7681 r
= MsiDoAction(hpkg
, "FileCost");
7682 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7684 /* SourceDir after FileCost */
7686 lstrcpyA(path
, "kiwi");
7687 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7688 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7689 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7690 ok(size
== 0, "Expected 0, got %d\n", size
);
7692 /* SOURCEDIR after FileCost */
7694 lstrcpyA(path
, "kiwi");
7695 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7696 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7697 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7698 ok(size
== 0, "Expected 0, got %d\n", size
);
7700 r
= MsiDoAction(hpkg
, "CostFinalize");
7701 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7703 /* SourceDir after CostFinalize */
7705 lstrcpyA(path
, "kiwi");
7706 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7708 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7709 ok(size
== 0, "Expected 0, got %d\n", size
);
7711 /* SOURCEDIR after CostFinalize */
7713 lstrcpyA(path
, "kiwi");
7714 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7715 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7716 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7717 ok(size
== 0, "Expected 0, got %d\n", size
);
7719 r
= MsiDoAction(hpkg
, "ResolveSource");
7720 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7722 /* SourceDir after ResolveSource */
7724 lstrcpyA(path
, "kiwi");
7725 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7726 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7727 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7728 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7730 /* SOURCEDIR after ResolveSource */
7732 lstrcpyA(path
, "kiwi");
7733 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7734 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7735 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7736 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7740 lstrcpyA(path
, "kiwi");
7741 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
7742 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7743 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7744 ok(size
== 0, "Expected 0, got %d\n", size
);
7746 MsiCloseHandle(hpkg
);
7748 /* reset the package state */
7749 sprintf(package
, "#%li", hdb
);
7750 r
= MsiOpenPackage(package
, &hpkg
);
7751 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7753 /* test how MsiGetSourcePath affects the properties */
7755 /* SourceDir prop */
7757 lstrcpyA(path
, "kiwi");
7758 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7759 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7762 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7763 ok(size
== 0, "Expected 0, got %d\n", size
);
7767 lstrcpyA(path
, "kiwi");
7768 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7769 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7770 ok(!lstrcmpA(path
, "kiwi"),
7771 "Expected path to be unchanged, got \"%s\"\n", path
);
7772 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7774 /* SourceDir after MsiGetSourcePath */
7776 lstrcpyA(path
, "kiwi");
7777 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7778 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7781 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7782 ok(size
== 0, "Expected 0, got %d\n", size
);
7785 /* SOURCEDIR prop */
7787 lstrcpyA(path
, "kiwi");
7788 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7792 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7793 ok(size
== 0, "Expected 0, got %d\n", size
);
7797 lstrcpyA(path
, "kiwi");
7798 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7799 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7800 ok(!lstrcmpA(path
, "kiwi"),
7801 "Expected path to be unchanged, got \"%s\"\n", path
);
7802 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7804 /* SOURCEDIR prop after MsiGetSourcePath */
7806 lstrcpyA(path
, "kiwi");
7807 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7808 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7811 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7812 ok(size
== 0, "Expected 0, got %d\n", size
);
7815 r
= MsiDoAction(hpkg
, "CostInitialize");
7816 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7818 /* SourceDir after CostInitialize */
7820 lstrcpyA(path
, "kiwi");
7821 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7822 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7825 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
7826 ok(size
== 0, "Expected 0, got %d\n", size
);
7830 lstrcpyA(path
, "kiwi");
7831 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
7832 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7833 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7834 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7836 /* SourceDir after MsiGetSourcePath */
7838 lstrcpyA(path
, "kiwi");
7839 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7841 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7842 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7844 /* SOURCEDIR after CostInitialize */
7846 lstrcpyA(path
, "kiwi");
7847 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7848 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7849 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7850 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7852 /* SOURCEDIR source path still does not exist */
7854 lstrcpyA(path
, "kiwi");
7855 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7856 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7857 ok(!lstrcmpA(path
, "kiwi"),
7858 "Expected path to be unchanged, got \"%s\"\n", path
);
7859 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7861 r
= MsiDoAction(hpkg
, "FileCost");
7862 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7864 /* SourceDir after FileCost */
7866 lstrcpyA(path
, "kiwi");
7867 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7868 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7869 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7870 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7872 /* SOURCEDIR after FileCost */
7874 lstrcpyA(path
, "kiwi");
7875 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7876 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7877 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7878 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7880 /* SOURCEDIR source path still does not exist */
7882 lstrcpyA(path
, "kiwi");
7883 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7884 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7885 ok(!lstrcmpA(path
, "kiwi"),
7886 "Expected path to be unchanged, got \"%s\"\n", path
);
7887 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7889 r
= MsiDoAction(hpkg
, "CostFinalize");
7890 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7892 /* SourceDir after CostFinalize */
7894 lstrcpyA(path
, "kiwi");
7895 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7896 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7897 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7898 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7900 /* SOURCEDIR after CostFinalize */
7902 lstrcpyA(path
, "kiwi");
7903 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7904 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7905 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7906 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7908 /* SOURCEDIR source path still does not exist */
7910 lstrcpyA(path
, "kiwi");
7911 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7912 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7913 ok(!lstrcmpA(path
, "kiwi"),
7914 "Expected path to be unchanged, got \"%s\"\n", path
);
7915 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7917 r
= MsiDoAction(hpkg
, "ResolveSource");
7918 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
7920 /* SourceDir after ResolveSource */
7922 lstrcpyA(path
, "kiwi");
7923 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
7924 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7925 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7926 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7928 /* SOURCEDIR after ResolveSource */
7930 lstrcpyA(path
, "kiwi");
7931 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
7932 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7933 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
7934 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
7936 /* SOURCEDIR source path still does not exist */
7938 lstrcpyA(path
, "kiwi");
7939 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
7940 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
7941 ok(!lstrcmpA(path
, "kiwi"),
7942 "Expected path to be unchanged, got \"%s\"\n", path
);
7943 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
7945 MsiCloseHandle(hdb
);
7946 MsiCloseHandle(hpkg
);
7947 DeleteFileA(msifile
);
7956 static const struct access_res create
[16] =
7958 { TRUE
, ERROR_SUCCESS
},
7959 { TRUE
, ERROR_SUCCESS
},
7960 { TRUE
, ERROR_SUCCESS
},
7961 { TRUE
, ERROR_SUCCESS
},
7962 { FALSE
, ERROR_SHARING_VIOLATION
},
7963 { FALSE
, ERROR_SHARING_VIOLATION
},
7964 { FALSE
, ERROR_SHARING_VIOLATION
},
7965 { TRUE
, ERROR_SUCCESS
},
7966 { FALSE
, ERROR_SHARING_VIOLATION
},
7967 { FALSE
, ERROR_SHARING_VIOLATION
},
7968 { FALSE
, ERROR_SHARING_VIOLATION
},
7969 { TRUE
, ERROR_SUCCESS
},
7970 { FALSE
, ERROR_SHARING_VIOLATION
},
7971 { FALSE
, ERROR_SHARING_VIOLATION
},
7972 { FALSE
, ERROR_SHARING_VIOLATION
},
7973 { TRUE
, ERROR_SUCCESS
}
7976 static const struct access_res create_commit
[16] =
7978 { TRUE
, ERROR_SUCCESS
},
7979 { TRUE
, ERROR_SUCCESS
},
7980 { TRUE
, ERROR_SUCCESS
},
7981 { TRUE
, ERROR_SUCCESS
},
7982 { FALSE
, ERROR_SHARING_VIOLATION
},
7983 { FALSE
, ERROR_SHARING_VIOLATION
},
7984 { FALSE
, ERROR_SHARING_VIOLATION
},
7985 { TRUE
, ERROR_SUCCESS
},
7986 { FALSE
, ERROR_SHARING_VIOLATION
},
7987 { FALSE
, ERROR_SHARING_VIOLATION
},
7988 { FALSE
, ERROR_SHARING_VIOLATION
},
7989 { TRUE
, ERROR_SUCCESS
},
7990 { FALSE
, ERROR_SHARING_VIOLATION
},
7991 { FALSE
, ERROR_SHARING_VIOLATION
},
7992 { FALSE
, ERROR_SHARING_VIOLATION
},
7993 { TRUE
, ERROR_SUCCESS
}
7996 static const struct access_res create_close
[16] =
7998 { TRUE
, ERROR_SUCCESS
},
7999 { TRUE
, ERROR_SUCCESS
},
8000 { TRUE
, ERROR_SUCCESS
},
8001 { TRUE
, ERROR_SUCCESS
},
8002 { TRUE
, ERROR_SUCCESS
},
8003 { TRUE
, ERROR_SUCCESS
},
8004 { TRUE
, ERROR_SUCCESS
},
8005 { TRUE
, ERROR_SUCCESS
},
8006 { TRUE
, ERROR_SUCCESS
},
8007 { TRUE
, ERROR_SUCCESS
},
8008 { TRUE
, ERROR_SUCCESS
},
8009 { TRUE
, ERROR_SUCCESS
},
8010 { TRUE
, ERROR_SUCCESS
},
8011 { TRUE
, ERROR_SUCCESS
},
8012 { TRUE
, ERROR_SUCCESS
},
8013 { TRUE
, ERROR_SUCCESS
}
8016 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
8018 DWORD access
= 0, share
= 0;
8023 for (i
= 0; i
< 4; i
++)
8025 if (i
== 0) access
= 0;
8026 if (i
== 1) access
= GENERIC_READ
;
8027 if (i
== 2) access
= GENERIC_WRITE
;
8028 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
8030 for (j
= 0; j
< 4; j
++)
8032 if (j
== 0) share
= 0;
8033 if (j
== 1) share
= FILE_SHARE_READ
;
8034 if (j
== 2) share
= FILE_SHARE_WRITE
;
8035 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
8037 SetLastError(0xdeadbeef);
8038 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
8039 FILE_ATTRIBUTE_NORMAL
, 0);
8040 lasterr
= GetLastError();
8042 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
8043 "(%d, handle, %d): Expected %d, got %d\n",
8044 line
, idx
, ares
[idx
].gothandle
,
8045 (hfile
!= INVALID_HANDLE_VALUE
));
8047 ok(lasterr
== ares
[idx
].lasterr
,
8048 "(%d, lasterr, %d): Expected %d, got %d\n",
8049 line
, idx
, ares
[idx
].lasterr
, lasterr
);
8057 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
8059 static void test_access(void)
8064 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
8065 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8067 test_file_access(msifile
, create
);
8069 r
= MsiDatabaseCommit(hdb
);
8070 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8072 test_file_access(msifile
, create_commit
);
8074 MsiCloseHandle(hdb
);
8076 test_file_access(msifile
, create_close
);
8078 DeleteFileA(msifile
);
8080 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
8081 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8083 test_file_access(msifile
, create
);
8085 r
= MsiDatabaseCommit(hdb
);
8086 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8088 test_file_access(msifile
, create_commit
);
8090 MsiCloseHandle(hdb
);
8092 test_file_access(msifile
, create_close
);
8094 DeleteFileA(msifile
);
8099 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
8101 test_createpackage();
8103 test_gettargetpath_bad();
8104 test_settargetpath();
8106 test_property_table();
8109 test_formatrecord2();
8114 test_featureparents();
8115 test_installprops();
8116 test_launchconditions();
8119 test_MsiGetSourcePath();
8120 test_shortlongsource();