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 static void get_user_sid(LPSTR
*usersid
)
41 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
42 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
45 pConvertSidToStringSidA
= (void *)GetProcAddress(hadvapi32
, "ConvertSidToStringSidA");
46 if (!pConvertSidToStringSidA
)
49 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
51 GetTokenInformation(token
, TokenUser
, (void *)buf
, size
, &size
);
52 user
= (PTOKEN_USER
)buf
;
53 pConvertSidToStringSidA(user
->User
.Sid
, usersid
);
56 /* RegDeleteTreeW from dlls/advapi32/registry.c */
57 LSTATUS WINAPI
package_RegDeleteTreeW(HKEY hKey
, LPCWSTR lpszSubKey
)
60 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
61 DWORD dwMaxLen
, dwSize
;
62 WCHAR szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
67 ret
= RegOpenKeyExW(hKey
, lpszSubKey
, 0, KEY_READ
, &hSubKey
);
71 ret
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, NULL
,
72 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
73 if (ret
) goto cleanup
;
77 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
78 if (dwMaxLen
> sizeof(szNameBuf
)/sizeof(WCHAR
))
80 /* Name too big: alloc a buffer for it */
81 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
*sizeof(WCHAR
))))
83 ret
= ERROR_NOT_ENOUGH_MEMORY
;
88 /* Recursively delete all the subkeys */
92 if (RegEnumKeyExW(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
93 NULL
, NULL
, NULL
)) break;
95 ret
= package_RegDeleteTreeW(hSubKey
, lpszName
);
96 if (ret
) goto cleanup
;
100 ret
= RegDeleteKeyW(hKey
, lpszSubKey
);
105 if (RegEnumValueW(hKey
, 0, lpszName
, &dwSize
,
106 NULL
, NULL
, NULL
, NULL
)) break;
108 ret
= RegDeleteValueW(hKey
, lpszName
);
109 if (ret
) goto cleanup
;
113 if (lpszName
!= szNameBuf
)
114 HeapFree(GetProcessHeap(), 0, lpszName
);
116 RegCloseKey(hSubKey
);
120 static BOOL
squash_guid(LPCWSTR in
, LPWSTR out
)
125 if (FAILED(CLSIDFromString((LPOLESTR
)in
, &guid
)))
139 out
[17+i
*2] = in
[n
++];
140 out
[16+i
*2] = in
[n
++];
145 out
[17+i
*2] = in
[n
++];
146 out
[16+i
*2] = in
[n
++];
152 static void set_component_path(LPCSTR filename
, MSIINSTALLCONTEXT context
,
153 LPCSTR guid
, LPSTR usersid
, BOOL dir
)
155 WCHAR guidW
[MAX_PATH
];
156 WCHAR squashedW
[MAX_PATH
];
157 CHAR squashed
[MAX_PATH
];
158 CHAR comppath
[MAX_PATH
];
159 CHAR prodpath
[MAX_PATH
];
164 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
165 squash_guid(guidW
, squashedW
);
166 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
168 if (context
== MSIINSTALLCONTEXT_MACHINE
)
170 prod
= "3D0DAE300FACA1300AD792060BCDAA92";
172 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
173 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
175 "SOFTWARE\\Classes\\Installer\\"
176 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
178 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
180 prod
= "7D2F387510109040002000060BECB6AB";
182 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
183 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
185 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
186 "Installer\\%s\\Installer\\Products\\"
187 "7D2F387510109040002000060BECB6AB", usersid
);
189 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
191 prod
= "7D2F387510109040002000060BECB6AB";
193 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
194 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
196 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
197 "Installer\\Managed\\%s\\Installer\\Products\\"
198 "7D2F387510109040002000060BECB6AB", usersid
);
201 RegCreateKeyA(HKEY_LOCAL_MACHINE
, comppath
, &hkey
);
203 lstrcpyA(path
, CURR_DIR
);
204 lstrcatA(path
, "\\");
205 if (!dir
) lstrcatA(path
, filename
);
207 RegSetValueExA(hkey
, prod
, 0, REG_SZ
, (LPBYTE
)path
, lstrlenA(path
));
210 RegCreateKeyA(HKEY_LOCAL_MACHINE
, prodpath
, &hkey
);
214 static void delete_component_path(LPCSTR guid
, MSIINSTALLCONTEXT context
, LPSTR usersid
)
216 WCHAR guidW
[MAX_PATH
];
217 WCHAR squashedW
[MAX_PATH
];
218 WCHAR substrW
[MAX_PATH
];
219 CHAR squashed
[MAX_PATH
];
220 CHAR comppath
[MAX_PATH
];
221 CHAR prodpath
[MAX_PATH
];
223 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
224 squash_guid(guidW
, squashedW
);
225 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
227 if (context
== MSIINSTALLCONTEXT_MACHINE
)
230 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
231 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
233 "SOFTWARE\\Classes\\Installer\\"
234 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
236 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
239 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
240 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
242 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
243 "Installer\\%s\\Installer\\Products\\"
244 "7D2F387510109040002000060BECB6AB", usersid
);
246 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
249 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
250 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
252 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
253 "Installer\\Managed\\%s\\Installer\\Products\\"
254 "7D2F387510109040002000060BECB6AB", usersid
);
257 MultiByteToWideChar(CP_ACP
, 0, comppath
, -1, substrW
, MAX_PATH
);
258 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
260 MultiByteToWideChar(CP_ACP
, 0, prodpath
, -1, substrW
, MAX_PATH
);
261 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
264 static UINT
do_query(MSIHANDLE hdb
, const char *query
, MSIHANDLE
*phrec
)
269 /* open a select query */
270 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
271 if (r
!= ERROR_SUCCESS
)
273 r
= MsiViewExecute(hview
, 0);
274 if (r
!= ERROR_SUCCESS
)
276 ret
= MsiViewFetch(hview
, phrec
);
277 r
= MsiViewClose(hview
);
278 if (r
!= ERROR_SUCCESS
)
280 r
= MsiCloseHandle(hview
);
281 if (r
!= ERROR_SUCCESS
)
286 static UINT
run_query( MSIHANDLE hdb
, const char *query
)
291 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
292 if( r
!= ERROR_SUCCESS
)
295 r
= MsiViewExecute(hview
, 0);
296 if( r
== ERROR_SUCCESS
)
297 r
= MsiViewClose(hview
);
298 MsiCloseHandle(hview
);
302 static UINT
create_component_table( MSIHANDLE hdb
)
304 return run_query( hdb
,
305 "CREATE TABLE `Component` ( "
306 "`Component` CHAR(72) NOT NULL, "
307 "`ComponentId` CHAR(38), "
308 "`Directory_` CHAR(72) NOT NULL, "
309 "`Attributes` SHORT NOT NULL, "
310 "`Condition` CHAR(255), "
311 "`KeyPath` CHAR(72) "
312 "PRIMARY KEY `Component`)" );
315 static UINT
create_feature_table( MSIHANDLE hdb
)
317 return run_query( hdb
,
318 "CREATE TABLE `Feature` ( "
319 "`Feature` CHAR(38) NOT NULL, "
320 "`Feature_Parent` CHAR(38), "
322 "`Description` CHAR(255), "
323 "`Display` SHORT NOT NULL, "
324 "`Level` SHORT NOT NULL, "
325 "`Directory_` CHAR(72), "
326 "`Attributes` SHORT NOT NULL "
327 "PRIMARY KEY `Feature`)" );
330 static UINT
create_feature_components_table( MSIHANDLE hdb
)
332 return run_query( hdb
,
333 "CREATE TABLE `FeatureComponents` ( "
334 "`Feature_` CHAR(38) NOT NULL, "
335 "`Component_` CHAR(72) NOT NULL "
336 "PRIMARY KEY `Feature_`, `Component_` )" );
339 static UINT
create_file_table( MSIHANDLE hdb
)
341 return run_query( hdb
,
342 "CREATE TABLE `File` ("
343 "`File` CHAR(72) NOT NULL, "
344 "`Component_` CHAR(72) NOT NULL, "
345 "`FileName` CHAR(255) NOT NULL, "
346 "`FileSize` LONG NOT NULL, "
347 "`Version` CHAR(72), "
348 "`Language` CHAR(20), "
349 "`Attributes` SHORT, "
350 "`Sequence` SHORT NOT NULL "
351 "PRIMARY KEY `File`)" );
354 static UINT
create_remove_file_table( MSIHANDLE hdb
)
356 return run_query( hdb
,
357 "CREATE TABLE `RemoveFile` ("
358 "`FileKey` CHAR(72) NOT NULL, "
359 "`Component_` CHAR(72) NOT NULL, "
360 "`FileName` CHAR(255) LOCALIZABLE, "
361 "`DirProperty` CHAR(72) NOT NULL, "
362 "`InstallMode` SHORT NOT NULL "
363 "PRIMARY KEY `FileKey`)" );
366 static UINT
create_appsearch_table( MSIHANDLE hdb
)
368 return run_query( hdb
,
369 "CREATE TABLE `AppSearch` ("
370 "`Property` CHAR(72) NOT NULL, "
371 "`Signature_` CHAR(72) NOT NULL "
372 "PRIMARY KEY `Property`, `Signature_`)" );
375 static UINT
create_reglocator_table( MSIHANDLE hdb
)
377 return run_query( hdb
,
378 "CREATE TABLE `RegLocator` ("
379 "`Signature_` CHAR(72) NOT NULL, "
380 "`Root` SHORT NOT NULL, "
381 "`Key` CHAR(255) NOT NULL, "
384 "PRIMARY KEY `Signature_`)" );
387 static UINT
create_signature_table( MSIHANDLE hdb
)
389 return run_query( hdb
,
390 "CREATE TABLE `Signature` ("
391 "`Signature` CHAR(72) NOT NULL, "
392 "`FileName` CHAR(255) NOT NULL, "
393 "`MinVersion` CHAR(20), "
394 "`MaxVersion` CHAR(20), "
399 "`Languages` CHAR(255) "
400 "PRIMARY KEY `Signature`)" );
403 static UINT
create_launchcondition_table( MSIHANDLE hdb
)
405 return run_query( hdb
,
406 "CREATE TABLE `LaunchCondition` ("
407 "`Condition` CHAR(255) NOT NULL, "
408 "`Description` CHAR(255) NOT NULL "
409 "PRIMARY KEY `Condition`)" );
412 static UINT
create_property_table( MSIHANDLE hdb
)
414 return run_query( hdb
,
415 "CREATE TABLE `Property` ("
416 "`Property` CHAR(72) NOT NULL, "
418 "PRIMARY KEY `Property`)" );
421 static UINT
create_install_execute_sequence_table( MSIHANDLE hdb
)
423 return run_query( hdb
,
424 "CREATE TABLE `InstallExecuteSequence` ("
425 "`Action` CHAR(72) NOT NULL, "
426 "`Condition` CHAR(255), "
428 "PRIMARY KEY `Action`)" );
431 static UINT
create_media_table( MSIHANDLE hdb
)
433 return run_query( hdb
,
434 "CREATE TABLE `Media` ("
435 "`DiskId` SHORT NOT NULL, "
436 "`LastSequence` SHORT NOT NULL, "
437 "`DiskPrompt` CHAR(64), "
438 "`Cabinet` CHAR(255), "
439 "`VolumeLabel` CHAR(32), "
441 "PRIMARY KEY `DiskId`)" );
444 static UINT
create_ccpsearch_table( MSIHANDLE hdb
)
446 return run_query( hdb
,
447 "CREATE TABLE `CCPSearch` ("
448 "`Signature_` CHAR(72) NOT NULL "
449 "PRIMARY KEY `Signature_`)" );
452 static UINT
create_drlocator_table( MSIHANDLE hdb
)
454 return run_query( hdb
,
455 "CREATE TABLE `DrLocator` ("
456 "`Signature_` CHAR(72) NOT NULL, "
457 "`Parent` CHAR(72), "
460 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
463 static UINT
create_complocator_table( MSIHANDLE hdb
)
465 return run_query( hdb
,
466 "CREATE TABLE `CompLocator` ("
467 "`Signature_` CHAR(72) NOT NULL, "
468 "`ComponentId` CHAR(38) NOT NULL, "
470 "PRIMARY KEY `Signature_`)" );
473 static UINT
create_inilocator_table( MSIHANDLE hdb
)
475 return run_query( hdb
,
476 "CREATE TABLE `IniLocator` ("
477 "`Signature_` CHAR(72) NOT NULL, "
478 "`FileName` CHAR(255) NOT NULL, "
479 "`Section` CHAR(96)NOT NULL, "
480 "`Key` CHAR(128)NOT NULL, "
483 "PRIMARY KEY `Signature_`)" );
486 static UINT
add_component_entry( MSIHANDLE hdb
, const char *values
)
488 char insert
[] = "INSERT INTO `Component` "
489 "(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
494 sz
= strlen(values
) + sizeof insert
;
495 query
= HeapAlloc(GetProcessHeap(),0,sz
);
496 sprintf(query
,insert
,values
);
497 r
= run_query( hdb
, query
);
498 HeapFree(GetProcessHeap(), 0, query
);
502 static UINT
add_directory_entry( MSIHANDLE hdb
, const char *values
)
504 char insert
[] = "INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )";
508 sz
= strlen(values
) + sizeof insert
;
509 query
= HeapAlloc(GetProcessHeap(),0,sz
);
510 sprintf(query
,insert
,values
);
511 r
= run_query( hdb
, query
);
512 HeapFree(GetProcessHeap(), 0, query
);
516 static UINT
add_feature_entry( MSIHANDLE hdb
, const char *values
)
518 char insert
[] = "INSERT INTO `Feature` (`Feature`, `Feature_Parent`, "
519 "`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )";
523 sz
= strlen(values
) + sizeof insert
;
524 query
= HeapAlloc(GetProcessHeap(),0,sz
);
525 sprintf(query
,insert
,values
);
526 r
= run_query( hdb
, query
);
527 HeapFree(GetProcessHeap(), 0, query
);
531 static UINT
add_feature_components_entry( MSIHANDLE hdb
, const char *values
)
533 char insert
[] = "INSERT INTO `FeatureComponents` "
534 "(`Feature_`, `Component_`) "
539 sz
= strlen(values
) + sizeof insert
;
540 query
= HeapAlloc(GetProcessHeap(),0,sz
);
541 sprintf(query
,insert
,values
);
542 r
= run_query( hdb
, query
);
543 HeapFree(GetProcessHeap(), 0, query
);
547 static UINT
add_file_entry( MSIHANDLE hdb
, const char *values
)
549 char insert
[] = "INSERT INTO `File` "
550 "(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) "
555 sz
= strlen(values
) + sizeof insert
;
556 query
= HeapAlloc(GetProcessHeap(),0,sz
);
557 sprintf(query
,insert
,values
);
558 r
= run_query( hdb
, query
);
559 HeapFree(GetProcessHeap(), 0, query
);
563 static UINT
add_appsearch_entry( MSIHANDLE hdb
, const char *values
)
565 char insert
[] = "INSERT INTO `AppSearch` "
566 "(`Property`, `Signature_`) "
571 sz
= strlen(values
) + sizeof insert
;
572 query
= HeapAlloc(GetProcessHeap(),0,sz
);
573 sprintf(query
,insert
,values
);
574 r
= run_query( hdb
, query
);
575 HeapFree(GetProcessHeap(), 0, query
);
579 static UINT
add_reglocator_entry( MSIHANDLE hdb
, const char *values
)
581 char insert
[] = "INSERT INTO `RegLocator` "
582 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) "
587 sz
= strlen(values
) + sizeof insert
;
588 query
= HeapAlloc(GetProcessHeap(),0,sz
);
589 sprintf(query
,insert
,values
);
590 r
= run_query( hdb
, query
);
591 HeapFree(GetProcessHeap(), 0, query
);
595 static UINT
add_signature_entry( MSIHANDLE hdb
, const char *values
)
597 char insert
[] = "INSERT INTO `Signature` "
598 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
599 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
604 sz
= strlen(values
) + sizeof insert
;
605 query
= HeapAlloc(GetProcessHeap(),0,sz
);
606 sprintf(query
,insert
,values
);
607 r
= run_query( hdb
, query
);
608 HeapFree(GetProcessHeap(), 0, query
);
612 static UINT
add_launchcondition_entry( MSIHANDLE hdb
, const char *values
)
614 char insert
[] = "INSERT INTO `LaunchCondition` "
615 "(`Condition`, `Description`) "
620 sz
= strlen(values
) + sizeof insert
;
621 query
= HeapAlloc(GetProcessHeap(),0,sz
);
622 sprintf(query
,insert
,values
);
623 r
= run_query( hdb
, query
);
624 HeapFree(GetProcessHeap(), 0, query
);
628 static UINT
add_property_entry( MSIHANDLE hdb
, const char *values
)
630 char insert
[] = "INSERT INTO `Property` "
631 "(`Property`, `Value`) "
636 sz
= strlen(values
) + sizeof insert
;
637 query
= HeapAlloc(GetProcessHeap(),0,sz
);
638 sprintf(query
,insert
,values
);
639 r
= run_query( hdb
, query
);
640 HeapFree(GetProcessHeap(), 0, query
);
644 static UINT
add_install_execute_sequence_entry( MSIHANDLE hdb
, const char *values
)
646 char insert
[] = "INSERT INTO `InstallExecuteSequence` "
647 "(`Action`, `Condition`, `Sequence`) "
652 sz
= strlen(values
) + sizeof insert
;
653 query
= HeapAlloc(GetProcessHeap(),0,sz
);
654 sprintf(query
,insert
,values
);
655 r
= run_query( hdb
, query
);
656 HeapFree(GetProcessHeap(), 0, query
);
660 static UINT
add_media_entry( MSIHANDLE hdb
, const char *values
)
662 char insert
[] = "INSERT INTO `Media` "
663 "(`DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source`) "
668 sz
= strlen(values
) + sizeof insert
;
669 query
= HeapAlloc(GetProcessHeap(),0,sz
);
670 sprintf(query
,insert
,values
);
671 r
= run_query( hdb
, query
);
672 HeapFree(GetProcessHeap(), 0, query
);
676 static UINT
add_ccpsearch_entry( MSIHANDLE hdb
, const char *values
)
678 char insert
[] = "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )";
682 sz
= strlen(values
) + sizeof insert
;
683 query
= HeapAlloc(GetProcessHeap(),0,sz
);
684 sprintf(query
,insert
,values
);
685 r
= run_query( hdb
, query
);
686 HeapFree(GetProcessHeap(), 0, query
);
690 static UINT
add_drlocator_entry( MSIHANDLE hdb
, const char *values
)
692 char insert
[] = "INSERT INTO `DrLocator` "
693 "(`Signature_`, `Parent`, `Path`, `Depth`) "
698 sz
= strlen(values
) + sizeof insert
;
699 query
= HeapAlloc(GetProcessHeap(),0,sz
);
700 sprintf(query
,insert
,values
);
701 r
= run_query( hdb
, query
);
702 HeapFree(GetProcessHeap(), 0, query
);
706 static UINT
add_complocator_entry( MSIHANDLE hdb
, const char *values
)
708 char insert
[] = "INSERT INTO `CompLocator` "
709 "(`Signature_`, `ComponentId`, `Type`) "
714 sz
= strlen(values
) + sizeof insert
;
715 query
= HeapAlloc(GetProcessHeap(),0,sz
);
716 sprintf(query
,insert
,values
);
717 r
= run_query( hdb
, query
);
718 HeapFree(GetProcessHeap(), 0, query
);
722 static UINT
add_inilocator_entry( MSIHANDLE hdb
, const char *values
)
724 char insert
[] = "INSERT INTO `IniLocator` "
725 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
730 sz
= strlen(values
) + sizeof insert
;
731 query
= HeapAlloc(GetProcessHeap(),0,sz
);
732 sprintf(query
,insert
,values
);
733 r
= run_query( hdb
, query
);
734 HeapFree(GetProcessHeap(), 0, query
);
738 static UINT
set_summary_info(MSIHANDLE hdb
)
743 /* build summary info */
744 res
= MsiGetSummaryInformation(hdb
, NULL
, 7, &suminfo
);
745 ok( res
== ERROR_SUCCESS
, "Failed to open summaryinfo\n" );
747 res
= MsiSummaryInfoSetProperty(suminfo
,2, VT_LPSTR
, 0,NULL
,
748 "Installation Database");
749 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
751 res
= MsiSummaryInfoSetProperty(suminfo
,3, VT_LPSTR
, 0,NULL
,
752 "Installation Database");
753 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
755 res
= MsiSummaryInfoSetProperty(suminfo
,4, VT_LPSTR
, 0,NULL
,
757 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
759 res
= MsiSummaryInfoSetProperty(suminfo
,7, VT_LPSTR
, 0,NULL
,
761 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
763 res
= MsiSummaryInfoSetProperty(suminfo
,9, VT_LPSTR
, 0,NULL
,
764 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
765 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
767 res
= MsiSummaryInfoSetProperty(suminfo
, 14, VT_I4
, 100, NULL
, NULL
);
768 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
770 res
= MsiSummaryInfoSetProperty(suminfo
, 15, VT_I4
, 0, NULL
, NULL
);
771 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
773 res
= MsiSummaryInfoPersist(suminfo
);
774 ok( res
== ERROR_SUCCESS
, "Failed to make summary info persist\n" );
776 res
= MsiCloseHandle( suminfo
);
777 ok( res
== ERROR_SUCCESS
, "Failed to close suminfo\n" );
783 static MSIHANDLE
create_package_db(void)
790 /* create an empty database */
791 res
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
792 ok( res
== ERROR_SUCCESS
, "Failed to create database\n" );
793 if( res
!= ERROR_SUCCESS
)
796 res
= MsiDatabaseCommit( hdb
);
797 ok( res
== ERROR_SUCCESS
, "Failed to commit database\n" );
799 res
= set_summary_info(hdb
);
801 res
= run_query( hdb
,
802 "CREATE TABLE `Directory` ( "
803 "`Directory` CHAR(255) NOT NULL, "
804 "`Directory_Parent` CHAR(255), "
805 "`DefaultDir` CHAR(255) NOT NULL "
806 "PRIMARY KEY `Directory`)" );
807 ok( res
== ERROR_SUCCESS
, "Failed to create directory table\n" );
812 static MSIHANDLE
package_from_db(MSIHANDLE hdb
)
818 sprintf(szPackage
,"#%li",hdb
);
819 res
= MsiOpenPackage(szPackage
,&hPackage
);
820 if (res
!= ERROR_SUCCESS
)
823 res
= MsiCloseHandle(hdb
);
824 if (res
!= ERROR_SUCCESS
)
830 static void create_test_file(const CHAR
*name
)
835 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
836 ok(file
!= INVALID_HANDLE_VALUE
, "Failure to open file %s\n", name
);
837 WriteFile(file
, name
, strlen(name
), &written
, NULL
);
838 WriteFile(file
, "\n", strlen("\n"), &written
, NULL
);
842 typedef struct _tagVS_VERSIONINFO
849 VS_FIXEDFILEINFO Value
;
854 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
855 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
857 static void create_file_with_version(const CHAR
*name
, LONG ms
, LONG ls
)
859 VS_VERSIONINFO
*pVerInfo
;
860 VS_FIXEDFILEINFO
*pFixedInfo
;
866 GetSystemDirectory(path
, MAX_PATH
);
867 lstrcatA(path
, "\\kernel32.dll");
869 CopyFileA(path
, name
, FALSE
);
871 size
= GetFileVersionInfoSize(path
, &handle
);
872 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
874 GetFileVersionInfoA(path
, 0, size
, buffer
);
876 pVerInfo
= (VS_VERSIONINFO
*)buffer
;
877 ofs
= (BYTE
*)&pVerInfo
->szKey
[lstrlenW(pVerInfo
->szKey
) + 1];
878 pFixedInfo
= (VS_FIXEDFILEINFO
*)roundpos(pVerInfo
, ofs
, 4);
880 pFixedInfo
->dwFileVersionMS
= ms
;
881 pFixedInfo
->dwFileVersionLS
= ls
;
882 pFixedInfo
->dwProductVersionMS
= ms
;
883 pFixedInfo
->dwProductVersionLS
= ls
;
885 resource
= BeginUpdateResource(name
, FALSE
);
889 UpdateResource(resource
, RT_VERSION
, MAKEINTRESOURCE(VS_VERSION_INFO
),
890 MAKELANGID(LANG_NEUTRAL
, SUBLANG_NEUTRAL
), buffer
, size
);
891 EndUpdateResource(resource
, FALSE
);
894 HeapFree(GetProcessHeap(), 0, buffer
);
897 static void test_createpackage(void)
899 MSIHANDLE hPackage
= 0;
902 hPackage
= package_from_db(create_package_db());
903 ok( hPackage
!= 0, " Failed to create package\n");
905 res
= MsiCloseHandle( hPackage
);
906 ok( res
== ERROR_SUCCESS
, "Failed to close package\n" );
910 static void test_doaction( void )
915 r
= MsiDoAction( -1, NULL
);
916 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
918 hpkg
= package_from_db(create_package_db());
919 ok( hpkg
, "failed to create package\n");
921 r
= MsiDoAction(hpkg
, NULL
);
922 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
924 r
= MsiDoAction(0, "boo");
925 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
927 r
= MsiDoAction(hpkg
, "boo");
928 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "wrong return val\n");
930 MsiCloseHandle( hpkg
);
934 static void test_gettargetpath_bad(void)
941 hpkg
= package_from_db(create_package_db());
942 ok( hpkg
, "failed to create package\n");
944 r
= MsiGetTargetPath( 0, NULL
, NULL
, NULL
);
945 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
947 r
= MsiGetTargetPath( 0, NULL
, NULL
, &sz
);
948 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
950 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
951 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
953 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
954 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
956 r
= MsiGetTargetPath( hpkg
, "boo", NULL
, NULL
);
957 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
959 r
= MsiGetTargetPath( hpkg
, "boo", buffer
, NULL
);
960 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
962 MsiCloseHandle( hpkg
);
966 static void query_file_path(MSIHANDLE hpkg
, LPCSTR file
, LPSTR buff
)
972 rec
= MsiCreateRecord( 1 );
973 ok(rec
, "MsiCreate record failed\n");
975 r
= MsiRecordSetString( rec
, 0, file
);
976 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
979 r
= MsiFormatRecord( hpkg
, rec
, buff
, &size
);
980 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
982 MsiCloseHandle( rec
);
985 static void test_settargetpath(void)
987 char tempdir
[MAX_PATH
+8], buffer
[MAX_PATH
], file
[MAX_PATH
];
993 hdb
= create_package_db();
994 ok ( hdb
, "failed to create package database\n" );
996 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
997 ok( r
== S_OK
, "failed to add directory entry: %d\n" , r
);
999 r
= create_component_table( hdb
);
1000 ok( r
== S_OK
, "cannot create Component table: %d\n", r
);
1002 r
= add_component_entry( hdb
, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1003 ok( r
== S_OK
, "cannot add dummy component: %d\n", r
);
1005 r
= add_component_entry( hdb
, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1006 ok( r
== S_OK
, "cannot add test component: %d\n", r
);
1008 r
= create_feature_table( hdb
);
1009 ok( r
== S_OK
, "cannot create Feature table: %d\n", r
);
1011 r
= add_feature_entry( hdb
, "'TestFeature', '', '', '', 0, 1, '', 0" );
1012 ok( r
== ERROR_SUCCESS
, "cannot add TestFeature to Feature table: %d\n", r
);
1014 r
= create_feature_components_table( hdb
);
1015 ok( r
== S_OK
, "cannot create FeatureComponents table: %d\n", r
);
1017 r
= add_feature_components_entry( hdb
, "'TestFeature', 'RootComp'" );
1018 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
1020 r
= add_feature_components_entry( hdb
, "'TestFeature', 'TestComp'" );
1021 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
1023 add_directory_entry( hdb
, "'TestParent', 'TARGETDIR', 'TestParent'" );
1024 add_directory_entry( hdb
, "'TestDir', 'TestParent', 'TestDir'" );
1026 r
= create_file_table( hdb
);
1027 ok( r
== S_OK
, "cannot create File table: %d\n", r
);
1029 r
= add_file_entry( hdb
, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1030 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
1032 r
= add_file_entry( hdb
, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1033 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
1035 hpkg
= package_from_db( hdb
);
1036 ok( hpkg
, "failed to create package\n");
1038 r
= MsiDoAction( hpkg
, "CostInitialize");
1039 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
1041 r
= MsiDoAction( hpkg
, "FileCost");
1042 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
1044 r
= MsiDoAction( hpkg
, "CostFinalize");
1045 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
1047 r
= MsiSetTargetPath( 0, NULL
, NULL
);
1048 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1050 r
= MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1051 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1053 r
= MsiSetTargetPath( hpkg
, "boo", NULL
);
1054 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1056 r
= MsiSetTargetPath( hpkg
, "boo", "c:\\bogusx" );
1057 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
1059 sz
= sizeof tempdir
- 1;
1060 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", tempdir
, &sz
);
1061 sprintf( file
, "%srootfile.txt", tempdir
);
1062 query_file_path( hpkg
, "[#RootFile]", buffer
);
1063 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1064 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
1066 GetTempFileName( tempdir
, "_wt", 0, buffer
);
1067 sprintf( tempdir
, "%s\\subdir", buffer
);
1069 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
1070 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
1071 "MsiSetTargetPath on file returned %d\n", r
);
1073 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
1074 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
1075 "MsiSetTargetPath on 'subdir' of file returned %d\n", r
);
1077 DeleteFile( buffer
);
1079 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
1080 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1082 r
= GetFileAttributes( buffer
);
1083 ok ( r
== INVALID_FILE_ATTRIBUTES
, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r
);
1085 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
1086 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath on subsubdir returned %d\n", r
);
1088 sz
= sizeof buffer
- 1;
1089 lstrcat( tempdir
, "\\" );
1090 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", buffer
, &sz
);
1091 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1092 ok( !lstrcmp(buffer
, tempdir
), "Expected %s, got %s\n", tempdir
, buffer
);
1094 sprintf( file
, "%srootfile.txt", tempdir
);
1095 query_file_path( hpkg
, "[#RootFile]", buffer
);
1096 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
1098 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two" );
1099 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1101 query_file_path( hpkg
, "[#TestFile]", buffer
);
1102 ok( !lstrcmp(buffer
, "C:\\one\\two\\TestDir\\testfile.txt"),
1103 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer
);
1105 sz
= sizeof buffer
- 1;
1106 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
1107 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1108 ok( !lstrcmp(buffer
, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer
);
1110 MsiCloseHandle( hpkg
);
1113 static void test_condition(void)
1118 hpkg
= package_from_db(create_package_db());
1119 ok( hpkg
, "failed to create package\n");
1121 r
= MsiEvaluateCondition(0, NULL
);
1122 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1124 r
= MsiEvaluateCondition(hpkg
, NULL
);
1125 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1127 r
= MsiEvaluateCondition(hpkg
, "");
1128 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1130 r
= MsiEvaluateCondition(hpkg
, "1");
1131 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1133 r
= MsiEvaluateCondition(hpkg
, "0");
1134 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1136 r
= MsiEvaluateCondition(hpkg
, "-1");
1137 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1139 r
= MsiEvaluateCondition(hpkg
, "0 = 0");
1140 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1142 r
= MsiEvaluateCondition(hpkg
, "0 <> 0");
1143 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1145 r
= MsiEvaluateCondition(hpkg
, "0 = 1");
1146 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1148 r
= MsiEvaluateCondition(hpkg
, "0 > 1");
1149 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1151 r
= MsiEvaluateCondition(hpkg
, "0 ~> 1");
1152 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1154 r
= MsiEvaluateCondition(hpkg
, "1 > 1");
1155 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1157 r
= MsiEvaluateCondition(hpkg
, "1 ~> 1");
1158 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1160 r
= MsiEvaluateCondition(hpkg
, "0 >= 1");
1161 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1163 r
= MsiEvaluateCondition(hpkg
, "0 ~>= 1");
1164 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1166 r
= MsiEvaluateCondition(hpkg
, "1 >= 1");
1167 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1169 r
= MsiEvaluateCondition(hpkg
, "1 ~>= 1");
1170 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1172 r
= MsiEvaluateCondition(hpkg
, "0 < 1");
1173 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1175 r
= MsiEvaluateCondition(hpkg
, "0 ~< 1");
1176 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1178 r
= MsiEvaluateCondition(hpkg
, "1 < 1");
1179 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1181 r
= MsiEvaluateCondition(hpkg
, "1 ~< 1");
1182 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1184 r
= MsiEvaluateCondition(hpkg
, "0 <= 1");
1185 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1187 r
= MsiEvaluateCondition(hpkg
, "0 ~<= 1");
1188 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1190 r
= MsiEvaluateCondition(hpkg
, "1 <= 1");
1191 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1193 r
= MsiEvaluateCondition(hpkg
, "1 ~<= 1");
1194 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1196 r
= MsiEvaluateCondition(hpkg
, "0 >=");
1197 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1199 r
= MsiEvaluateCondition(hpkg
, " ");
1200 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1202 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"1\"");
1203 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1205 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"0\"");
1206 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1208 r
= MsiEvaluateCondition(hpkg
, "LicView <> LicView");
1209 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1211 r
= MsiEvaluateCondition(hpkg
, "not 0");
1212 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1214 r
= MsiEvaluateCondition(hpkg
, "not LicView");
1215 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1217 r
= MsiEvaluateCondition(hpkg
, "not \"A\"");
1218 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1220 r
= MsiEvaluateCondition(hpkg
, "~not \"A\"");
1221 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1223 r
= MsiEvaluateCondition(hpkg
, "\"0\"");
1224 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1226 r
= MsiEvaluateCondition(hpkg
, "1 and 2");
1227 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1229 r
= MsiEvaluateCondition(hpkg
, "not 0 and 3");
1230 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1232 r
= MsiEvaluateCondition(hpkg
, "not 0 and 0");
1233 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1235 r
= MsiEvaluateCondition(hpkg
, "not 0 or 1");
1236 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1238 r
= MsiEvaluateCondition(hpkg
, "(0)");
1239 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1241 r
= MsiEvaluateCondition(hpkg
, "(((((1))))))");
1242 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1244 r
= MsiEvaluateCondition(hpkg
, "(((((1)))))");
1245 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1247 r
= MsiEvaluateCondition(hpkg
, " \"A\" < \"B\" ");
1248 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1250 r
= MsiEvaluateCondition(hpkg
, " \"A\" > \"B\" ");
1251 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1253 r
= MsiEvaluateCondition(hpkg
, " \"1\" > \"12\" ");
1254 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1256 r
= MsiEvaluateCondition(hpkg
, " \"100\" < \"21\" ");
1257 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1259 r
= MsiEvaluateCondition(hpkg
, "0 < > 0");
1260 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1262 r
= MsiEvaluateCondition(hpkg
, "(1<<1) == 2");
1263 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1265 r
= MsiEvaluateCondition(hpkg
, " \"A\" = \"a\" ");
1266 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1268 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~ = \"a\" ");
1269 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1271 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= \"a\" ");
1272 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1274 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= 1 ");
1275 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1277 r
= MsiEvaluateCondition(hpkg
, " \"A\" = 1 ");
1278 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1280 r
= MsiEvaluateCondition(hpkg
, " 1 ~= 1 ");
1281 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1283 r
= MsiEvaluateCondition(hpkg
, " 1 ~= \"1\" ");
1284 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1286 r
= MsiEvaluateCondition(hpkg
, " 1 = \"1\" ");
1287 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1289 r
= MsiEvaluateCondition(hpkg
, " 0 = \"1\" ");
1290 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1292 r
= MsiEvaluateCondition(hpkg
, " 0 < \"100\" ");
1293 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1295 r
= MsiEvaluateCondition(hpkg
, " 100 > \"0\" ");
1296 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1298 r
= MsiEvaluateCondition(hpkg
, "1 XOR 1");
1299 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1301 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1");
1302 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1304 r
= MsiEvaluateCondition(hpkg
, "1 IMP 0");
1305 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1307 r
= MsiEvaluateCondition(hpkg
, "0 IMP 0");
1308 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1310 r
= MsiEvaluateCondition(hpkg
, "0 EQV 0");
1311 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1313 r
= MsiEvaluateCondition(hpkg
, "0 EQV 1");
1314 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1316 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1 OR 0");
1317 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1319 r
= MsiEvaluateCondition(hpkg
, "1 IMPL 1");
1320 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1322 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" >< \"S\" ");
1323 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1325 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"s\" ");
1326 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1328 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"\" ");
1329 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1331 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"sss\" ");
1332 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1334 MsiSetProperty(hpkg
, "mm", "5" );
1336 r
= MsiEvaluateCondition(hpkg
, "mm = 5");
1337 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1339 r
= MsiEvaluateCondition(hpkg
, "mm < 6");
1340 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1342 r
= MsiEvaluateCondition(hpkg
, "mm <= 5");
1343 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1345 r
= MsiEvaluateCondition(hpkg
, "mm > 4");
1346 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1348 r
= MsiEvaluateCondition(hpkg
, "mm < 12");
1349 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1351 r
= MsiEvaluateCondition(hpkg
, "mm = \"5\"");
1352 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1354 r
= MsiEvaluateCondition(hpkg
, "0 = \"\"");
1355 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1357 r
= MsiEvaluateCondition(hpkg
, "0 AND \"\"");
1358 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1360 r
= MsiEvaluateCondition(hpkg
, "1 AND \"\"");
1361 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1363 r
= MsiEvaluateCondition(hpkg
, "1 AND \"1\"");
1364 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1366 r
= MsiEvaluateCondition(hpkg
, "3 >< 1");
1367 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1369 r
= MsiEvaluateCondition(hpkg
, "3 >< 4");
1370 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1372 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 0");
1373 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1375 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1");
1376 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1378 r
= MsiEvaluateCondition(hpkg
, "NOT 1 OR 0");
1379 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1381 r
= MsiEvaluateCondition(hpkg
, "0 AND 1 OR 1");
1382 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1384 r
= MsiEvaluateCondition(hpkg
, "0 AND 0 OR 1");
1385 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1387 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1 OR 0");
1388 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1390 r
= MsiEvaluateCondition(hpkg
, "_1 = _1");
1391 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1393 r
= MsiEvaluateCondition(hpkg
, "( 1 AND 1 ) = 2");
1394 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1396 r
= MsiEvaluateCondition(hpkg
, "NOT ( 1 AND 1 )");
1397 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1399 r
= MsiEvaluateCondition(hpkg
, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1400 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1402 r
= MsiEvaluateCondition(hpkg
, "Installed<>\"\"");
1403 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1405 r
= MsiEvaluateCondition(hpkg
, "NOT 1 AND 0");
1406 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1408 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1409 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1411 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1412 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1414 r
= MsiEvaluateCondition(hpkg
, "bandalmael<0");
1415 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1417 r
= MsiEvaluateCondition(hpkg
, "bandalmael>0");
1418 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1420 r
= MsiEvaluateCondition(hpkg
, "bandalmael>=0");
1421 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1423 r
= MsiEvaluateCondition(hpkg
, "bandalmael<=0");
1424 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1426 r
= MsiEvaluateCondition(hpkg
, "bandalmael~<>0");
1427 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1429 MsiSetProperty(hpkg
, "bandalmael", "0" );
1430 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1431 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1433 MsiSetProperty(hpkg
, "bandalmael", "" );
1434 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1435 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1437 MsiSetProperty(hpkg
, "bandalmael", "asdf" );
1438 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1439 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1441 MsiSetProperty(hpkg
, "bandalmael", "0asdf" );
1442 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1443 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1445 MsiSetProperty(hpkg
, "bandalmael", "0 " );
1446 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1447 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1449 MsiSetProperty(hpkg
, "bandalmael", "-0" );
1450 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1451 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1453 MsiSetProperty(hpkg
, "bandalmael", "0000000000000" );
1454 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1455 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1457 MsiSetProperty(hpkg
, "bandalmael", "--0" );
1458 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1459 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1461 MsiSetProperty(hpkg
, "bandalmael", "0x00" );
1462 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1463 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1465 MsiSetProperty(hpkg
, "bandalmael", "-" );
1466 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1467 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1469 MsiSetProperty(hpkg
, "bandalmael", "+0" );
1470 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1471 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1473 MsiSetProperty(hpkg
, "bandalmael", "0.0" );
1474 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1475 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1476 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1477 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1479 MsiSetProperty(hpkg
, "one", "hi");
1480 MsiSetProperty(hpkg
, "two", "hithere");
1481 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1482 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1484 MsiSetProperty(hpkg
, "one", "hithere");
1485 MsiSetProperty(hpkg
, "two", "hi");
1486 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1487 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1489 MsiSetProperty(hpkg
, "one", "hello");
1490 MsiSetProperty(hpkg
, "two", "hi");
1491 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1492 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1494 MsiSetProperty(hpkg
, "one", "hellohithere");
1495 MsiSetProperty(hpkg
, "two", "hi");
1496 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1497 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1499 MsiSetProperty(hpkg
, "one", "");
1500 MsiSetProperty(hpkg
, "two", "hi");
1501 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1502 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1504 MsiSetProperty(hpkg
, "one", "hi");
1505 MsiSetProperty(hpkg
, "two", "");
1506 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1507 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1509 MsiSetProperty(hpkg
, "one", "");
1510 MsiSetProperty(hpkg
, "two", "");
1511 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1512 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1514 MsiSetProperty(hpkg
, "one", "1234");
1515 MsiSetProperty(hpkg
, "two", "1");
1516 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1517 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1519 MsiSetProperty(hpkg
, "one", "one 1234");
1520 MsiSetProperty(hpkg
, "two", "1");
1521 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1522 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1524 MsiSetProperty(hpkg
, "one", "hithere");
1525 MsiSetProperty(hpkg
, "two", "hi");
1526 r
= MsiEvaluateCondition(hpkg
, "one << two");
1527 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1529 MsiSetProperty(hpkg
, "one", "hi");
1530 MsiSetProperty(hpkg
, "two", "hithere");
1531 r
= MsiEvaluateCondition(hpkg
, "one << two");
1532 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1534 MsiSetProperty(hpkg
, "one", "hi");
1535 MsiSetProperty(hpkg
, "two", "hi");
1536 r
= MsiEvaluateCondition(hpkg
, "one << two");
1537 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1539 MsiSetProperty(hpkg
, "one", "abcdhithere");
1540 MsiSetProperty(hpkg
, "two", "hi");
1541 r
= MsiEvaluateCondition(hpkg
, "one << two");
1542 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1544 MsiSetProperty(hpkg
, "one", "");
1545 MsiSetProperty(hpkg
, "two", "hi");
1546 r
= MsiEvaluateCondition(hpkg
, "one << two");
1547 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1549 MsiSetProperty(hpkg
, "one", "hithere");
1550 MsiSetProperty(hpkg
, "two", "");
1551 r
= MsiEvaluateCondition(hpkg
, "one << two");
1552 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1554 MsiSetProperty(hpkg
, "one", "");
1555 MsiSetProperty(hpkg
, "two", "");
1556 r
= MsiEvaluateCondition(hpkg
, "one << two");
1557 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1559 MsiSetProperty(hpkg
, "one", "1234");
1560 MsiSetProperty(hpkg
, "two", "1");
1561 r
= MsiEvaluateCondition(hpkg
, "one << two");
1562 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1564 MsiSetProperty(hpkg
, "one", "1234 one");
1565 MsiSetProperty(hpkg
, "two", "1");
1566 r
= MsiEvaluateCondition(hpkg
, "one << two");
1567 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1569 MsiSetProperty(hpkg
, "one", "hithere");
1570 MsiSetProperty(hpkg
, "two", "there");
1571 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1572 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1574 MsiSetProperty(hpkg
, "one", "hithere");
1575 MsiSetProperty(hpkg
, "two", "hi");
1576 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1577 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1579 MsiSetProperty(hpkg
, "one", "there");
1580 MsiSetProperty(hpkg
, "two", "hithere");
1581 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1582 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1584 MsiSetProperty(hpkg
, "one", "there");
1585 MsiSetProperty(hpkg
, "two", "there");
1586 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1587 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1589 MsiSetProperty(hpkg
, "one", "abcdhithere");
1590 MsiSetProperty(hpkg
, "two", "hi");
1591 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1592 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1594 MsiSetProperty(hpkg
, "one", "");
1595 MsiSetProperty(hpkg
, "two", "there");
1596 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1597 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1599 MsiSetProperty(hpkg
, "one", "there");
1600 MsiSetProperty(hpkg
, "two", "");
1601 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1602 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1604 MsiSetProperty(hpkg
, "one", "");
1605 MsiSetProperty(hpkg
, "two", "");
1606 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1607 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1609 MsiSetProperty(hpkg
, "one", "1234");
1610 MsiSetProperty(hpkg
, "two", "4");
1611 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1612 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1614 MsiSetProperty(hpkg
, "one", "one 1234");
1615 MsiSetProperty(hpkg
, "two", "4");
1616 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1617 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1619 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", NULL
); /* make sure it's empty */
1621 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1622 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1624 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport > \"1.1.4322\"");
1625 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1627 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport >= \"1.1.4322\"");
1628 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1630 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <= \"1.1.4322\"");
1631 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1633 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <> \"1.1.4322\"");
1634 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1636 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1637 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1639 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"abcd\"");
1640 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1642 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a1.1.4322\"");
1643 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1645 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322a\"");
1646 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1648 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1649 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1651 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1652 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1654 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1655 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1657 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1");
1658 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1660 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1\"");
1661 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1663 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"12.1\"");
1664 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1666 r
= MsiEvaluateCondition(hpkg
, "\"02.1\" < \"2.11\"");
1667 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1669 r
= MsiEvaluateCondition(hpkg
, "\"02.1.1\" < \"2.1\"");
1670 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1672 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1673 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1675 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1676 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1678 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0\"");
1679 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1681 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"-1\"");
1682 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1684 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a\"");
1685 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1687 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1688 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1690 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1691 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1693 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"/\"");
1694 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1696 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \" \"");
1697 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1699 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"azAZ_\"");
1700 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1702 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]\"");
1703 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1705 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]a\"");
1706 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1708 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]\"");
1709 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1711 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]a\"");
1712 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1714 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a}\"");
1715 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1717 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a\"");
1718 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1720 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a\"");
1721 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1723 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a{\"");
1724 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1726 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a]\"");
1727 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1729 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"A\"");
1730 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1732 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", "1.1.4322");
1733 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1734 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1736 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.14322\"");
1737 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1739 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.5\"");
1740 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1742 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1743 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1745 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1746 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1748 MsiSetProperty(hpkg
, "one", "1");
1749 r
= MsiEvaluateCondition(hpkg
, "one < \"1\"");
1750 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1752 MsiSetProperty(hpkg
, "X", "5.0");
1754 r
= MsiEvaluateCondition(hpkg
, "X != \"\"");
1755 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1757 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\"");
1758 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1760 r
= MsiEvaluateCondition(hpkg
, "X =\"5.1\"");
1761 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1763 r
= MsiEvaluateCondition(hpkg
, "X =\"6.0\"");
1764 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1766 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1767 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1769 r
= MsiEvaluateCondition(hpkg
, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1770 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1772 r
= MsiEvaluateCondition(hpkg
, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1773 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1775 /* feature doesn't exist */
1776 r
= MsiEvaluateCondition(hpkg
, "&nofeature");
1777 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1779 MsiSetProperty(hpkg
, "A", "2");
1780 MsiSetProperty(hpkg
, "X", "50");
1782 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1783 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1785 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1786 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1788 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1789 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1791 MsiSetProperty(hpkg
, "X", "50val");
1793 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1794 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1796 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1797 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1799 MsiSetProperty(hpkg
, "A", "7");
1800 MsiSetProperty(hpkg
, "X", "50");
1802 r
= MsiEvaluateCondition(hpkg
, "7 <= X");
1803 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1805 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1806 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1808 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1809 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1811 MsiSetProperty(hpkg
, "X", "50val");
1813 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1814 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1816 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1817 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1819 MsiCloseHandle( hpkg
);
1820 DeleteFile(msifile
);
1823 static BOOL
check_prop_empty( MSIHANDLE hpkg
, const char * prop
)
1831 r
= MsiGetProperty( hpkg
, prop
, buffer
, &sz
);
1832 return r
== ERROR_SUCCESS
&& buffer
[0] == 0 && sz
== 0;
1835 static void test_props(void)
1837 MSIHANDLE hpkg
, hdb
;
1842 hdb
= create_package_db();
1844 "CREATE TABLE `Property` ( "
1845 "`Property` CHAR(255) NOT NULL, "
1846 "`Value` CHAR(255) "
1847 "PRIMARY KEY `Property`)" );
1848 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1851 "INSERT INTO `Property` "
1852 "(`Property`, `Value`) "
1853 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1854 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1856 hpkg
= package_from_db( hdb
);
1857 ok( hpkg
, "failed to create package\n");
1859 /* test invalid values */
1860 r
= MsiGetProperty( 0, NULL
, NULL
, NULL
);
1861 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1863 r
= MsiGetProperty( hpkg
, NULL
, NULL
, NULL
);
1864 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1866 r
= MsiGetProperty( hpkg
, "boo", NULL
, NULL
);
1867 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1869 r
= MsiGetProperty( hpkg
, "boo", buffer
, NULL
);
1870 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1872 /* test retrieving an empty/nonexistent property */
1874 r
= MsiGetProperty( hpkg
, "boo", NULL
, &sz
);
1875 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1876 ok( sz
== 0, "wrong size returned\n");
1878 check_prop_empty( hpkg
, "boo");
1881 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1882 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1883 ok( !strcmp(buffer
,"x"), "buffer was changed\n");
1884 ok( sz
== 0, "wrong size returned\n");
1888 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1889 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1890 ok( buffer
[0] == 0, "buffer was not changed\n");
1891 ok( sz
== 0, "wrong size returned\n");
1893 /* set the property to something */
1894 r
= MsiSetProperty( 0, NULL
, NULL
);
1895 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1897 r
= MsiSetProperty( hpkg
, NULL
, NULL
);
1898 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1900 r
= MsiSetProperty( hpkg
, "", NULL
);
1901 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1903 /* try set and get some illegal property identifiers */
1904 r
= MsiSetProperty( hpkg
, "", "asdf" );
1905 ok( r
== ERROR_FUNCTION_FAILED
, "wrong return val\n");
1907 r
= MsiSetProperty( hpkg
, "=", "asdf" );
1908 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1910 r
= MsiSetProperty( hpkg
, " ", "asdf" );
1911 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1913 r
= MsiSetProperty( hpkg
, "'", "asdf" );
1914 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1918 r
= MsiGetProperty( hpkg
, "'", buffer
, &sz
);
1919 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1920 ok( !strcmp(buffer
,"asdf"), "buffer was not changed\n");
1922 /* set empty values */
1923 r
= MsiSetProperty( hpkg
, "boo", NULL
);
1924 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1925 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1927 r
= MsiSetProperty( hpkg
, "boo", "" );
1928 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1929 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1931 /* set a non-empty value */
1932 r
= MsiSetProperty( hpkg
, "boo", "xyz" );
1933 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1937 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1938 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1939 ok( buffer
[0] == 0, "buffer was not changed\n");
1940 ok( sz
== 3, "wrong size returned\n");
1944 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1945 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1946 ok( !strcmp(buffer
,"xyz"), "buffer was not changed\n");
1947 ok( sz
== 3, "wrong size returned\n");
1951 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1952 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1953 ok( !strcmp(buffer
,"xy"), "buffer was not changed\n");
1954 ok( sz
== 3, "wrong size returned\n");
1956 r
= MsiSetProperty(hpkg
, "SourceDir", "foo");
1957 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1960 r
= MsiGetProperty(hpkg
, "SOURCEDIR", buffer
, &sz
);
1961 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1962 ok( !strcmp(buffer
,""), "buffer wrong\n");
1963 ok( sz
== 0, "wrong size returned\n");
1966 r
= MsiGetProperty(hpkg
, "SOMERANDOMNAME", buffer
, &sz
);
1967 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1968 ok( !strcmp(buffer
,""), "buffer wrong\n");
1969 ok( sz
== 0, "wrong size returned\n");
1972 r
= MsiGetProperty(hpkg
, "SourceDir", buffer
, &sz
);
1973 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1974 ok( !strcmp(buffer
,"foo"), "buffer wrong\n");
1975 ok( sz
== 3, "wrong size returned\n");
1977 r
= MsiSetProperty(hpkg
, "MetadataCompName", "Photoshop.dll");
1978 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1981 r
= MsiGetProperty(hpkg
, "MetadataCompName", NULL
, &sz
);
1982 ok( r
== ERROR_SUCCESS
, "return wrong\n");
1983 ok( sz
== 13, "size wrong (%d)\n", sz
);
1986 r
= MsiGetProperty(hpkg
, "MetadataCompName", buffer
, &sz
);
1987 ok( r
== ERROR_MORE_DATA
, "return wrong\n");
1988 ok( !strcmp(buffer
,"Photoshop.dl"), "buffer wrong\n");
1990 r
= MsiSetProperty(hpkg
, "property", "value");
1991 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1994 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
1995 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1996 ok( !strcmp(buffer
, "value"), "Expected value, got %s\n", buffer
);
1998 r
= MsiSetProperty(hpkg
, "property", NULL
);
1999 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2002 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
2003 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2004 ok( !strlen(buffer
), "Expected empty string, got %s\n", buffer
);
2006 MsiCloseHandle( hpkg
);
2007 DeleteFile(msifile
);
2010 static BOOL
find_prop_in_property(MSIHANDLE hdb
, LPCSTR prop
, LPCSTR val
)
2012 MSIHANDLE hview
, hrec
;
2014 CHAR buffer
[MAX_PATH
];
2018 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
2019 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2020 r
= MsiViewExecute(hview
, 0);
2021 ok(r
== ERROR_SUCCESS
, "MsiViewExecute failed\n");
2024 while (r
== ERROR_SUCCESS
&& !found
)
2026 r
= MsiViewFetch(hview
, &hrec
);
2027 if (r
!= ERROR_SUCCESS
) break;
2030 r
= MsiRecordGetString(hrec
, 1, buffer
, &sz
);
2031 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, prop
))
2034 r
= MsiRecordGetString(hrec
, 2, buffer
, &sz
);
2035 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, val
))
2039 MsiCloseHandle(hrec
);
2042 MsiViewClose(hview
);
2043 MsiCloseHandle(hview
);
2048 static void test_property_table(void)
2052 MSIHANDLE hpkg
, hdb
, hrec
;
2053 char buffer
[MAX_PATH
];
2057 hdb
= create_package_db();
2058 ok( hdb
, "failed to create package\n");
2060 hpkg
= package_from_db(hdb
);
2061 ok( hpkg
, "failed to create package\n");
2063 MsiCloseHandle(hdb
);
2065 hdb
= MsiGetActiveDatabase(hpkg
);
2067 query
= "CREATE TABLE `_Property` ( "
2068 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2069 r
= run_query(hdb
, query
);
2070 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
2072 MsiCloseHandle(hdb
);
2073 MsiCloseHandle(hpkg
);
2074 DeleteFile(msifile
);
2076 hdb
= create_package_db();
2077 ok( hdb
, "failed to create package\n");
2079 query
= "CREATE TABLE `_Property` ( "
2080 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2081 r
= run_query(hdb
, query
);
2082 ok(r
== ERROR_SUCCESS
, "failed to create table\n");
2084 query
= "ALTER `_Property` ADD `foo` INTEGER";
2085 r
= run_query(hdb
, query
);
2086 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
2088 query
= "ALTER TABLE `_Property` ADD `foo` INTEGER";
2089 r
= run_query(hdb
, query
);
2090 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
2092 query
= "ALTER TABLE `_Property` ADD `extra` INTEGER";
2093 r
= run_query(hdb
, query
);
2094 ok(r
== ERROR_SUCCESS
, "failed to add column\n");
2096 hpkg
= package_from_db(hdb
);
2099 ok(!hpkg
, "package should not be created\n");
2102 MsiCloseHandle(hdb
);
2103 MsiCloseHandle(hpkg
);
2104 DeleteFile(msifile
);
2106 hdb
= create_package_db();
2107 ok (hdb
, "failed to create package database\n");
2109 r
= create_property_table(hdb
);
2110 ok(r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2112 r
= add_property_entry(hdb
, "'prop', 'val'");
2113 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2115 hpkg
= package_from_db(hdb
);
2116 ok(hpkg
, "failed to create package\n");
2118 MsiCloseHandle(hdb
);
2121 r
= MsiGetProperty(hpkg
, "prop", buffer
, &sz
);
2122 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2123 ok(!lstrcmp(buffer
, "val"), "Expected val, got %s\n", buffer
);
2125 hdb
= MsiGetActiveDatabase(hpkg
);
2127 found
= find_prop_in_property(hdb
, "prop", "val");
2128 ok(found
, "prop should be in the _Property table\n");
2130 r
= add_property_entry(hdb
, "'dantes', 'mercedes'");
2131 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2133 query
= "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2134 r
= do_query(hdb
, query
, &hrec
);
2135 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
2137 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2138 ok(found
== FALSE
, "dantes should not be in the _Property table\n");
2141 lstrcpy(buffer
, "aaa");
2142 r
= MsiGetProperty(hpkg
, "dantes", buffer
, &sz
);
2143 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2144 ok(lstrlenA(buffer
) == 0, "Expected empty string, got %s\n", buffer
);
2146 r
= MsiSetProperty(hpkg
, "dantes", "mercedes");
2147 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2149 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2150 ok(found
== TRUE
, "dantes should be in the _Property table\n");
2152 MsiCloseHandle(hdb
);
2153 MsiCloseHandle(hpkg
);
2154 DeleteFile(msifile
);
2157 static UINT
try_query_param( MSIHANDLE hdb
, LPCSTR szQuery
, MSIHANDLE hrec
)
2162 res
= MsiDatabaseOpenView( hdb
, szQuery
, &htab
);
2163 if( res
== ERROR_SUCCESS
)
2167 r
= MsiViewExecute( htab
, hrec
);
2168 if( r
!= ERROR_SUCCESS
)
2171 fprintf(stderr
,"MsiViewExecute failed %08x\n", res
);
2174 r
= MsiViewClose( htab
);
2175 if( r
!= ERROR_SUCCESS
)
2178 r
= MsiCloseHandle( htab
);
2179 if( r
!= ERROR_SUCCESS
)
2185 static UINT
try_query( MSIHANDLE hdb
, LPCSTR szQuery
)
2187 return try_query_param( hdb
, szQuery
, 0 );
2190 static void set_summary_str(MSIHANDLE hdb
, DWORD pid
, LPCSTR value
)
2195 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2196 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2198 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_LPSTR
, 0, NULL
, value
);
2199 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2201 r
= MsiSummaryInfoPersist(summary
);
2202 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2204 MsiCloseHandle(summary
);
2207 static void set_summary_dword(MSIHANDLE hdb
, DWORD pid
, DWORD value
)
2212 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2213 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2215 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_I4
, value
, NULL
, NULL
);
2216 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2218 r
= MsiSummaryInfoPersist(summary
);
2219 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2221 MsiCloseHandle(summary
);
2224 static void test_msipackage(void)
2226 MSIHANDLE hdb
= 0, hpack
= 100;
2231 /* NULL szPackagePath */
2232 r
= MsiOpenPackage(NULL
, &hpack
);
2233 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2235 /* empty szPackagePath */
2236 r
= MsiOpenPackage("", &hpack
);
2239 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2242 if (r
== ERROR_SUCCESS
)
2243 MsiCloseHandle(hpack
);
2245 /* nonexistent szPackagePath */
2246 r
= MsiOpenPackage("nonexistent", &hpack
);
2247 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r
);
2250 r
= MsiOpenPackage(msifile
, NULL
);
2251 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2255 r
= MsiOpenPackage(name
, &hpack
);
2256 ok(r
== ERROR_INVALID_HANDLE
, "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
2258 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2259 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2261 /* database exists, but is emtpy */
2262 sprintf(name
, "#%ld", hdb
);
2263 r
= MsiOpenPackage(name
, &hpack
);
2264 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2265 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2267 query
= "CREATE TABLE `Property` ( "
2268 "`Property` CHAR(72), `Value` CHAR(0) "
2269 "PRIMARY KEY `Property`)";
2270 r
= try_query(hdb
, query
);
2271 ok(r
== ERROR_SUCCESS
, "failed to create Properties table\n");
2273 query
= "CREATE TABLE `InstallExecuteSequence` ("
2274 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2275 "PRIMARY KEY `Action`)";
2276 r
= try_query(hdb
, query
);
2277 ok(r
== ERROR_SUCCESS
, "failed to create InstallExecuteSequence table\n");
2279 /* a few key tables exist */
2280 sprintf(name
, "#%ld", hdb
);
2281 r
= MsiOpenPackage(name
, &hpack
);
2282 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2283 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2285 MsiCloseHandle(hdb
);
2286 DeleteFile(msifile
);
2288 /* start with a clean database to show what constitutes a valid package */
2289 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2290 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2292 sprintf(name
, "#%ld", hdb
);
2294 /* The following summary information props must exist:
2299 set_summary_dword(hdb
, PID_PAGECOUNT
, 100);
2300 r
= MsiOpenPackage(name
, &hpack
);
2301 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2302 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2304 set_summary_str(hdb
, PID_REVNUMBER
, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2305 r
= MsiOpenPackage(name
, &hpack
);
2306 ok(r
== ERROR_SUCCESS
,
2307 "Expected ERROR_SUCCESS, got %d\n", r
);
2309 MsiCloseHandle(hpack
);
2310 MsiCloseHandle(hdb
);
2311 DeleteFile(msifile
);
2314 static void test_formatrecord2(void)
2316 MSIHANDLE hpkg
, hrec
;
2321 hpkg
= package_from_db(create_package_db());
2322 ok( hpkg
, "failed to create package\n");
2324 r
= MsiSetProperty(hpkg
, "Manufacturer", " " );
2325 ok( r
== ERROR_SUCCESS
, "set property failed\n");
2327 hrec
= MsiCreateRecord(2);
2328 ok(hrec
, "create record failed\n");
2330 r
= MsiRecordSetString( hrec
, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2331 ok( r
== ERROR_SUCCESS
, "format record failed\n");
2335 r
= MsiFormatRecord( hpkg
, hrec
, buffer
, &sz
);
2337 r
= MsiRecordSetString(hrec
, 0, "[foo][1]");
2338 r
= MsiRecordSetString(hrec
, 1, "hoo");
2340 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2341 ok( sz
== 3, "size wrong\n");
2342 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2343 ok( r
== ERROR_SUCCESS
, "format failed\n");
2345 r
= MsiRecordSetString(hrec
, 0, "x[~]x");
2347 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2348 ok( sz
== 3, "size wrong\n");
2349 ok( 0 == strcmp(buffer
,"x"), "wrong output %s\n",buffer
);
2350 ok( r
== ERROR_SUCCESS
, "format failed\n");
2352 r
= MsiRecordSetString(hrec
, 0, "[foo.$%}][1]");
2353 r
= MsiRecordSetString(hrec
, 1, "hoo");
2355 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2356 ok( sz
== 3, "size wrong\n");
2357 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2358 ok( r
== ERROR_SUCCESS
, "format failed\n");
2360 r
= MsiRecordSetString(hrec
, 0, "[\\[]");
2362 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2363 ok( sz
== 1, "size wrong\n");
2364 ok( 0 == strcmp(buffer
,"["), "wrong output %s\n",buffer
);
2365 ok( r
== ERROR_SUCCESS
, "format failed\n");
2367 SetEnvironmentVariable("FOO", "BAR");
2368 r
= MsiRecordSetString(hrec
, 0, "[%FOO]");
2370 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2371 ok( sz
== 3, "size wrong\n");
2372 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2373 ok( r
== ERROR_SUCCESS
, "format failed\n");
2375 r
= MsiRecordSetString(hrec
, 0, "[[1]]");
2376 r
= MsiRecordSetString(hrec
, 1, "%FOO");
2378 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2379 ok( sz
== 3, "size wrong\n");
2380 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2381 ok( r
== ERROR_SUCCESS
, "format failed\n");
2383 MsiCloseHandle( hrec
);
2384 MsiCloseHandle( hpkg
);
2385 DeleteFile(msifile
);
2388 static void test_states(void)
2393 INSTALLSTATE state
, action
;
2395 static const CHAR msifile2
[] = "winetest2.msi";
2396 static const CHAR msifile3
[] = "winetest3.msi";
2398 hdb
= create_package_db();
2399 ok ( hdb
, "failed to create package database\n" );
2401 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
2402 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
2404 r
= create_property_table( hdb
);
2405 ok( r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2407 r
= add_property_entry( hdb
, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2408 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2410 r
= add_property_entry( hdb
, "'ProductLanguage', '1033'" );
2411 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2413 r
= add_property_entry( hdb
, "'ProductName', 'MSITEST'" );
2414 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2416 r
= add_property_entry( hdb
, "'ProductVersion', '1.1.1'" );
2417 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2419 r
= create_install_execute_sequence_table( hdb
);
2420 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table: %d\n", r
);
2422 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
2423 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2425 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
2426 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2428 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
2429 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2431 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1400'" );
2432 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2434 r
= add_install_execute_sequence_entry( hdb
, "'InstallInitialize', '', '1500'" );
2435 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2437 r
= add_install_execute_sequence_entry( hdb
, "'ProcessComponents', '', '1600'" );
2438 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2440 r
= add_install_execute_sequence_entry( hdb
, "'UnpublishFeatures', '', '1800'" );
2441 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2443 r
= add_install_execute_sequence_entry( hdb
, "'RegisterProduct', '', '6100'" );
2444 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2446 r
= add_install_execute_sequence_entry( hdb
, "'PublishFeatures', '', '6300'" );
2447 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2449 r
= add_install_execute_sequence_entry( hdb
, "'PublishProduct', '', '6400'" );
2450 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2452 r
= add_install_execute_sequence_entry( hdb
, "'InstallFinalize', '', '6600'" );
2453 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2455 r
= create_media_table( hdb
);
2456 ok( r
== ERROR_SUCCESS
, "cannot create media table: %d\n", r
);
2458 r
= add_media_entry( hdb
, "'1', '3', '', '', 'DISK1', ''");
2459 ok( r
== ERROR_SUCCESS
, "cannot add media entry: %d\n", r
);
2461 r
= create_feature_table( hdb
);
2462 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
2464 r
= create_component_table( hdb
);
2465 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
2467 /* msidbFeatureAttributesFavorLocal */
2468 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
2469 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2471 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2472 r
= add_component_entry( hdb
, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2473 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2475 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2476 r
= add_component_entry( hdb
, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2477 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2479 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2480 r
= add_component_entry( hdb
, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2481 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2483 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2484 r
= add_component_entry( hdb
, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2485 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2487 /* msidbFeatureAttributesFavorSource */
2488 r
= add_feature_entry( hdb
, "'two', '', '', '', 2, 1, '', 1" );
2489 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2491 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2492 r
= add_component_entry( hdb
, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2493 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2495 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2496 r
= add_component_entry( hdb
, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2497 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2499 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2500 r
= add_component_entry( hdb
, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2501 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2503 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2504 r
= add_component_entry( hdb
, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2505 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2507 /* msidbFeatureAttributesFavorSource */
2508 r
= add_feature_entry( hdb
, "'three', '', '', '', 2, 1, '', 1" );
2509 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2511 /* msidbFeatureAttributesFavorLocal */
2512 r
= add_feature_entry( hdb
, "'four', '', '', '', 2, 1, '', 0" );
2513 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2516 r
= add_feature_entry( hdb
, "'five', '', '', '', 2, 0, '', 1" );
2517 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2519 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2520 r
= add_component_entry( hdb
, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2521 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2523 /* no feature parent:msidbComponentAttributesLocalOnly */
2524 r
= add_component_entry( hdb
, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2525 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2527 /* msidbFeatureAttributesFavorLocal:removed */
2528 r
= add_feature_entry( hdb
, "'six', '', '', '', 2, 1, '', 0" );
2529 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2531 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2532 r
= add_component_entry( hdb
, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2533 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2535 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2536 r
= add_component_entry( hdb
, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2537 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2539 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2540 r
= add_component_entry( hdb
, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2541 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2543 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2544 r
= add_component_entry( hdb
, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2545 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2547 /* msidbFeatureAttributesFavorSource:removed */
2548 r
= add_feature_entry( hdb
, "'seven', '', '', '', 2, 1, '', 1" );
2549 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2551 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2552 r
= add_component_entry( hdb
, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2553 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2555 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2556 r
= add_component_entry( hdb
, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2557 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2559 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2560 r
= add_component_entry( hdb
, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2561 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2563 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2564 r
= add_component_entry( hdb
, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2565 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2567 r
= create_feature_components_table( hdb
);
2568 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
2570 r
= add_feature_components_entry( hdb
, "'one', 'alpha'" );
2571 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2573 r
= add_feature_components_entry( hdb
, "'one', 'beta'" );
2574 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2576 r
= add_feature_components_entry( hdb
, "'one', 'gamma'" );
2577 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2579 r
= add_feature_components_entry( hdb
, "'one', 'theta'" );
2580 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2582 r
= add_feature_components_entry( hdb
, "'two', 'delta'" );
2583 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2585 r
= add_feature_components_entry( hdb
, "'two', 'epsilon'" );
2586 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2588 r
= add_feature_components_entry( hdb
, "'two', 'zeta'" );
2589 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2591 r
= add_feature_components_entry( hdb
, "'two', 'iota'" );
2592 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2594 r
= add_feature_components_entry( hdb
, "'three', 'eta'" );
2595 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2597 r
= add_feature_components_entry( hdb
, "'four', 'eta'" );
2598 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2600 r
= add_feature_components_entry( hdb
, "'five', 'eta'" );
2601 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2603 r
= add_feature_components_entry( hdb
, "'six', 'lambda'" );
2604 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2606 r
= add_feature_components_entry( hdb
, "'six', 'mu'" );
2607 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2609 r
= add_feature_components_entry( hdb
, "'six', 'nu'" );
2610 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2612 r
= add_feature_components_entry( hdb
, "'six', 'xi'" );
2613 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2615 r
= add_feature_components_entry( hdb
, "'seven', 'omicron'" );
2616 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2618 r
= add_feature_components_entry( hdb
, "'seven', 'pi'" );
2619 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2621 r
= add_feature_components_entry( hdb
, "'seven', 'rho'" );
2622 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2624 r
= add_feature_components_entry( hdb
, "'seven', 'sigma'" );
2625 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2627 r
= create_file_table( hdb
);
2628 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
2630 r
= add_file_entry( hdb
, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2631 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2633 r
= add_file_entry( hdb
, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2634 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2636 r
= add_file_entry( hdb
, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2637 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2639 r
= add_file_entry( hdb
, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2640 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2642 r
= add_file_entry( hdb
, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2643 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2645 r
= add_file_entry( hdb
, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2646 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2648 r
= add_file_entry( hdb
, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2649 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2651 r
= add_file_entry( hdb
, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2652 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2654 /* compressed file */
2655 r
= add_file_entry( hdb
, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2656 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2658 r
= add_file_entry( hdb
, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2659 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2661 r
= add_file_entry( hdb
, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2662 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2664 r
= add_file_entry( hdb
, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2665 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2667 r
= add_file_entry( hdb
, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2668 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2670 r
= add_file_entry( hdb
, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2671 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2673 r
= add_file_entry( hdb
, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2674 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2676 r
= add_file_entry( hdb
, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2677 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2679 r
= add_file_entry( hdb
, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2680 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2682 r
= add_file_entry( hdb
, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2683 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2685 MsiDatabaseCommit(hdb
);
2687 /* these properties must not be in the saved msi file */
2688 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
2689 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2691 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
2692 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2694 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
2695 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2697 hpkg
= package_from_db( hdb
);
2698 ok( hpkg
, "failed to create package\n");
2700 MsiCloseHandle(hdb
);
2702 CopyFileA(msifile
, msifile2
, FALSE
);
2703 CopyFileA(msifile
, msifile3
, FALSE
);
2707 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2708 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2709 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2710 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2714 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2715 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2716 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2717 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2721 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2722 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2723 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2724 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2728 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2729 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2730 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2731 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2735 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2736 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2737 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2738 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2742 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2743 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2744 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2745 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2749 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2750 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2751 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2752 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2756 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2757 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2758 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2759 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2763 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2764 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2765 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2766 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2770 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2771 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2772 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2773 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2777 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2778 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2779 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2780 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2784 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2785 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2786 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2787 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2791 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2792 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2793 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2794 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2798 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2799 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2800 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2801 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2805 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2806 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2807 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2808 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2812 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2813 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2814 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2815 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2819 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2820 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2821 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2822 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2826 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2827 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2828 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2829 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2833 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2834 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2835 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2836 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2840 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2841 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2842 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2843 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2847 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2848 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2849 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2850 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2854 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
2855 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2856 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2857 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2861 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
2862 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2863 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2864 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2868 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
2869 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2870 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2871 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2875 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
2876 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2877 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2878 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2880 r
= MsiDoAction( hpkg
, "CostInitialize");
2881 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
2885 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2886 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2887 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2888 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2892 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2893 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2894 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2895 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2899 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2900 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2901 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2902 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2906 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2907 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2908 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2909 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2913 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2914 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2915 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2916 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2920 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2921 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2922 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2923 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2927 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2928 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2929 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2930 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2934 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2935 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2936 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2937 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2941 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2942 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2943 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2944 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2948 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2949 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2950 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2951 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2955 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2956 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2957 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2958 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2962 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2963 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2964 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2965 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2969 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2970 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2971 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2972 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2976 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2977 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2978 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2979 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2983 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2984 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2985 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2986 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2990 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2991 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2992 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2993 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2997 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2998 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2999 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3000 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3004 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3005 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3006 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3007 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3011 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3012 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3013 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3014 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3018 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3019 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3020 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3021 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3025 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3026 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3027 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3028 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3032 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3033 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3034 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3035 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3039 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3040 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3041 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3042 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3046 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3047 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3048 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3049 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3053 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3054 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3055 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3056 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3058 r
= MsiDoAction( hpkg
, "FileCost");
3059 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3063 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3064 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3065 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3066 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3070 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3071 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3072 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3073 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3077 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3078 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3079 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3080 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3084 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3085 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3086 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3087 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3091 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3092 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3093 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3094 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3098 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3099 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3100 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3101 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3105 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3106 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3107 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3108 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3112 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3113 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3114 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3115 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3119 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3120 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3121 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3122 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3126 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3127 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3128 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3129 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3133 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3134 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3135 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3136 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3140 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3141 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3142 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3143 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3147 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3148 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3149 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3150 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3154 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3155 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3156 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3157 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3161 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3162 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3163 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3164 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3168 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3169 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3170 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3171 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3175 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3176 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3177 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3178 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3182 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3183 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3184 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3185 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3189 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3190 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3191 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3192 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3196 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3197 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3198 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3199 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3203 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3204 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3205 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3206 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3210 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3211 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3212 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3213 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3217 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3218 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3219 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3220 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3224 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3225 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3226 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3227 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3231 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3232 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3233 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3234 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3236 r
= MsiDoAction( hpkg
, "CostFinalize");
3237 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3241 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3242 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3243 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3244 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3248 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3249 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3250 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3251 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3255 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3256 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3257 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3258 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3262 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3263 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3264 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3265 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3269 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3270 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3271 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3272 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3276 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3277 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3278 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3279 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3283 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3284 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3285 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3286 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3290 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3291 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3292 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3293 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3297 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3298 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3299 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3300 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3304 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3305 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3306 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3307 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3311 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3312 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3313 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3314 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3318 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3319 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3320 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3321 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3325 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3326 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3327 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3328 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3332 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3333 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3334 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3335 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3339 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3340 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3341 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3342 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3346 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3347 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3348 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3349 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3353 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3354 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3355 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3356 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3360 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3361 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3362 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3363 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3367 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3368 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3369 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3370 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3374 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3375 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3376 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3377 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3381 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3382 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3383 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3384 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3388 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3389 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3390 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3391 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3395 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3396 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3397 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3398 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3402 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3403 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3404 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3405 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3409 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3410 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3411 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3412 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3414 MsiCloseHandle( hpkg
);
3416 /* publish the features and components */
3417 r
= MsiInstallProduct(msifile
, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven");
3418 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3420 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
3421 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3423 /* these properties must not be in the saved msi file */
3424 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
3425 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3427 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
3428 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3430 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
3431 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3433 hpkg
= package_from_db( hdb
);
3434 ok( hpkg
, "failed to create package\n");
3436 MsiCloseHandle(hdb
);
3440 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3441 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3442 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3443 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3447 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3448 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3449 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3450 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3454 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3455 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3456 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3457 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3461 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3462 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3463 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3464 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3468 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3469 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3470 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3471 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3475 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3476 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3477 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3478 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3482 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3483 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3484 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3485 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3489 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3490 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3491 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3492 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3496 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3497 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3498 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3499 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3503 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3504 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3505 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3506 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3510 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3511 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3512 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3513 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3517 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3518 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3519 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3520 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3524 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3525 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3526 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3527 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3531 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3532 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3533 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3534 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3538 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3539 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3540 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3541 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3545 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3546 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3547 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3548 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3552 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3553 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3554 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3555 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3559 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3560 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3561 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3562 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3566 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3567 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3568 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3569 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3573 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3574 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3575 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3576 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3580 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3581 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3582 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3583 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3587 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3588 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3589 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3590 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3594 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3595 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3596 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3597 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3601 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3602 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3603 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3604 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3608 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3609 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3610 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3611 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3613 r
= MsiDoAction( hpkg
, "CostInitialize");
3614 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3618 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3619 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3620 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3621 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3625 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3626 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3627 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3628 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3632 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3633 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3634 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3635 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3639 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3640 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3641 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3642 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3646 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3647 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3648 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3649 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3653 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3654 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3655 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3656 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3660 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3661 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3662 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3663 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3667 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3668 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3669 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3670 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3674 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3675 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3676 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3677 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3681 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3682 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3683 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3684 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3688 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3689 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3690 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3691 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3695 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3696 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3697 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3698 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3702 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3703 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3704 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3705 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3709 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3710 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3711 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3712 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3716 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3717 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3718 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3719 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3723 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3724 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3725 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3726 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3730 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3731 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3732 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3733 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3737 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3738 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3739 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3740 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3744 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3745 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3746 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3747 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3751 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3752 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3753 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3754 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3758 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3759 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3760 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3761 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3765 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3766 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3767 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3768 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3772 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3773 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3774 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3775 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3779 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3780 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3781 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3782 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3786 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3787 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3788 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3789 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3791 r
= MsiDoAction( hpkg
, "FileCost");
3792 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3796 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3797 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3798 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3799 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3803 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3804 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3805 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3806 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3810 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3811 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3812 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3813 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3817 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3818 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3819 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3820 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3824 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3825 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3826 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3827 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3831 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3832 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3833 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3834 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3838 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3839 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3840 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3841 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3845 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3846 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3847 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3848 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3852 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3853 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3854 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3855 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3859 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3860 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3861 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3862 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3866 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3867 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3868 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3869 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3873 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3874 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3875 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3876 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3880 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3881 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3882 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3883 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3887 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3888 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3889 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3890 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3894 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3895 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3896 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3897 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3901 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3902 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3903 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3904 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3908 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3909 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3910 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3911 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3915 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3916 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3917 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3918 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3922 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3923 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3924 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3925 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3929 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3930 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3931 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3932 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3936 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3937 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3938 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3939 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3943 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3944 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3945 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3946 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3950 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3951 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3952 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3953 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3957 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3958 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3959 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3960 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3964 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3965 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3966 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3967 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3969 r
= MsiDoAction( hpkg
, "CostFinalize");
3970 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3974 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3975 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3976 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3977 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3981 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3982 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3983 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
3984 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3988 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3989 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3990 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3991 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3995 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3996 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3997 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3998 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4002 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4003 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4004 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4005 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4009 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4010 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4011 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4012 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4016 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4017 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4018 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4019 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4023 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4024 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4025 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4026 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4030 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4031 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4032 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4033 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4037 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4038 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4039 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4040 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4044 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4045 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4046 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4047 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4051 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4052 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4053 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4054 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4058 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4059 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4060 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4061 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4065 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4066 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4067 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4068 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4072 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4073 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4074 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4075 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4079 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4080 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4081 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4082 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4086 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4087 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4088 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4089 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4093 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4094 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4095 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4096 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4100 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4101 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4102 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4103 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4107 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4108 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4109 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4110 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4114 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4115 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4116 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4117 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4121 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4122 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4123 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4124 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4128 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4129 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4130 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4131 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4135 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4136 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4137 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4138 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4142 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4143 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4144 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4145 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4147 MsiCloseHandle(hpkg
);
4149 /* uninstall the product */
4150 r
= MsiInstallProduct(msifile
, "REMOVE=ALL");
4151 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4153 /* all features installed locally */
4154 r
= MsiInstallProduct(msifile2
, "ADDLOCAL=ALL");
4155 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4157 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_DIRECT
, &hdb
);
4158 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4160 /* these properties must not be in the saved msi file */
4161 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,two,three,four,five,six,seven'");
4162 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4164 hpkg
= package_from_db( hdb
);
4165 ok( hpkg
, "failed to create package\n");
4169 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4170 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4171 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4172 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4176 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4177 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4178 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4179 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4183 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4184 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4185 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4186 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4190 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4191 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4192 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4193 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4197 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4198 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4199 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4200 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4204 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4205 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4206 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4207 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4211 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4212 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4213 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4214 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4218 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4219 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4220 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4221 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4225 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4226 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4227 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4228 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4232 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4233 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4234 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4235 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4239 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4240 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4241 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4242 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4246 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4247 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4248 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4249 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4253 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4254 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4255 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4256 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4260 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4261 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4262 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4263 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4267 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4268 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4269 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4270 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4274 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4275 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4276 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4277 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4281 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4282 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4283 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4284 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4288 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4289 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4290 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4291 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4295 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4296 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4297 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4298 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4302 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4303 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4304 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4305 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4309 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4310 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4311 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4312 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4316 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4317 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4318 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4319 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4323 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4324 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4325 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4326 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4330 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4331 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4332 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4333 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4337 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4338 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4339 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4340 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4342 r
= MsiDoAction( hpkg
, "CostInitialize");
4343 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4347 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4348 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4349 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4350 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4354 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4355 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4356 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4357 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4361 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4362 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4363 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4364 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4368 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4369 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4370 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4371 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4375 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4376 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4377 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4378 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4382 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4383 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4384 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4385 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4389 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4390 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4391 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4392 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4396 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4397 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4398 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4399 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4403 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4404 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4405 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4406 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4410 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4411 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4412 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4413 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4417 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4418 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4419 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4420 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4424 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4425 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4426 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4427 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4431 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4432 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4433 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4434 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4438 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4439 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4440 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4441 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4445 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4446 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4447 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4448 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4452 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4453 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4454 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4455 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4459 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4460 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4461 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4462 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4466 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4467 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4468 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4469 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4473 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4474 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4475 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4476 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4480 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4481 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4482 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4483 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4487 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4488 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4489 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4490 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4494 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4495 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4496 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4497 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4501 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4502 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4503 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4504 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4508 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4509 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4510 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4511 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4515 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4516 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4517 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4518 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4520 r
= MsiDoAction( hpkg
, "FileCost");
4521 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
4525 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4526 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4527 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4528 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4532 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4533 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4534 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4535 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4539 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4540 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4541 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4542 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4546 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4547 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4548 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4549 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4553 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4554 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4555 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4556 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4560 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4561 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4562 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4563 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4567 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4568 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4569 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4570 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4574 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4575 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4576 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4577 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4581 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4582 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4583 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4584 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4588 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4589 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4590 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4591 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4595 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4596 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4597 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4598 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4602 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4603 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4604 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4605 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4609 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4610 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4611 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4612 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4616 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4617 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4618 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4619 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4623 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4624 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4625 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4626 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4630 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4631 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4632 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4633 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4637 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4638 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4639 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4640 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4644 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4645 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4646 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4647 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4651 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4652 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4653 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4654 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4658 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4659 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4660 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4661 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4665 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4666 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4667 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4668 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4672 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4673 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4674 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4675 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4679 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4680 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4681 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4682 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4686 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4687 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4688 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4689 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4693 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4694 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4695 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4696 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4698 r
= MsiDoAction( hpkg
, "CostFinalize");
4699 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4703 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4704 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4705 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4706 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4710 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4711 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4712 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4713 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4717 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4718 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4719 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4720 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4724 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4725 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4726 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4727 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4731 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4732 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4733 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4734 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4738 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4739 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4740 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4741 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4745 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4746 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4747 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4748 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4752 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4753 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4754 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4755 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4759 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4760 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4761 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4762 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4766 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4767 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4768 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4769 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4773 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4774 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4775 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4776 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4780 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4781 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( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4787 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4788 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4789 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4790 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4794 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4795 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4796 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4797 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4801 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4802 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4803 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4804 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4808 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4809 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4810 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4811 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4815 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4816 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4817 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4818 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4822 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4823 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4824 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4825 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4829 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4830 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4831 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4832 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4836 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4837 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4838 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4839 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4843 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4844 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4845 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4846 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4850 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4851 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4852 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4853 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4857 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4858 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4859 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4860 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4864 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4865 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4866 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4867 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4871 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4872 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4873 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4874 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4876 MsiCloseHandle(hpkg
);
4878 /* uninstall the product */
4879 r
= MsiInstallProduct(msifile2
, "REMOVE=ALL");
4880 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4882 /* all features installed from source */
4883 r
= MsiInstallProduct(msifile3
, "ADDSOURCE=ALL");
4884 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4886 r
= MsiOpenDatabase(msifile3
, MSIDBOPEN_DIRECT
, &hdb
);
4887 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4889 /* this property must not be in the saved msi file */
4890 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven'");
4891 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4893 hpkg
= package_from_db( hdb
);
4894 ok( hpkg
, "failed to create package\n");
4898 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4899 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4900 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4901 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4905 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4906 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4907 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4908 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4912 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4913 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4914 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4915 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4919 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4920 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4921 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4922 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4926 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4927 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4928 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4929 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4933 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4934 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4935 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4936 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4940 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4941 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4942 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4943 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4947 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4948 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4949 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4950 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4954 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4955 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4956 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4957 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4961 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4962 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4963 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4964 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4968 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4969 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4970 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4971 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4975 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4976 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4977 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4978 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4982 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4983 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4984 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4985 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4989 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4990 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4991 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4992 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4996 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4997 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4998 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4999 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5003 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5004 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5005 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5006 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5010 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5011 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5012 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5013 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5017 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5018 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5019 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5020 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5024 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5025 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5026 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5027 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5031 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5032 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5033 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5034 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5038 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5039 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5040 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5041 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5045 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5046 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5047 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5048 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5052 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5053 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5054 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5055 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5059 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5060 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5061 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5062 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5066 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5067 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5068 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5069 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5071 r
= MsiDoAction( hpkg
, "CostInitialize");
5072 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5076 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5077 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5078 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5079 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5083 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5084 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5085 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5086 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5090 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5091 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5092 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5093 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5097 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5098 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5099 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5100 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5104 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5105 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5106 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5107 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5111 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5112 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5113 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5114 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5118 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5119 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5120 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5121 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5125 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5126 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5127 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5128 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5132 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5133 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5134 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5135 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5139 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5140 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5141 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5142 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5146 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5147 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5148 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5149 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5153 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5154 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5155 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5156 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5160 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5161 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5162 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5163 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5167 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5168 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5169 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5170 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5174 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5175 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5176 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5177 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5181 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5182 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5183 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5184 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5188 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5189 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5190 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5191 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5195 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5196 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5197 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5198 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5202 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5203 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5204 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5205 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5209 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5210 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5211 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5212 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5216 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5217 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5218 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5219 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5223 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5224 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5225 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5226 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5230 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5231 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5232 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5233 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5237 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5238 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5239 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5240 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5244 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5245 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5246 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5247 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5249 r
= MsiDoAction( hpkg
, "FileCost");
5250 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5254 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5255 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5256 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5257 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5261 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5262 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5263 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5264 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5268 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5269 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5270 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5271 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5275 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5276 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5277 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5278 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5282 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5283 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5284 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5285 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5289 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5290 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5291 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5292 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5296 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5297 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5298 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5299 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5303 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5304 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5305 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5306 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5310 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5311 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5312 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5313 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5317 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5318 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5319 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5320 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5324 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5325 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5326 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5327 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5331 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5332 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5333 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5334 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5338 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5339 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5340 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5341 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5345 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5346 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5347 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5348 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5352 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5353 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5354 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5355 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5359 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5360 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5361 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5362 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5366 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5367 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5368 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5369 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5373 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5374 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5375 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5376 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5380 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5381 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5382 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5383 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5387 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5388 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5389 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5390 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5394 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5395 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5396 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5397 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5401 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5402 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5403 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5404 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5408 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5409 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5410 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5411 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5415 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5416 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5417 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5418 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5422 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5423 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5424 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5425 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5427 r
= MsiDoAction( hpkg
, "CostFinalize");
5428 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5432 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5433 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5434 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5435 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5439 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5440 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5441 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5442 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5446 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5447 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5448 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5449 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5453 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5454 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5455 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5456 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5460 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5461 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5462 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5463 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5467 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5468 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5469 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5470 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5474 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5475 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5476 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5477 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5481 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5482 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5483 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5484 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5488 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5489 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5490 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5491 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5495 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5496 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5497 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5498 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5502 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5503 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5504 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5505 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5509 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5510 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5511 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5512 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5516 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5517 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5518 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5519 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5523 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5524 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5525 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5526 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5530 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5531 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5532 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5533 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5537 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5538 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5539 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5540 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5544 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5545 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5546 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5547 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5551 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5552 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5553 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5554 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5558 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5559 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5560 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5561 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5565 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5566 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
);
5572 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5573 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5574 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5575 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5579 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5580 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5581 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5582 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5586 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5587 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5588 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5589 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5593 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5594 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5595 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5596 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5600 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5601 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5602 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5603 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5605 MsiCloseHandle(hpkg
);
5607 /* uninstall the product */
5608 r
= MsiInstallProduct(msifile3
, "REMOVE=ALL");
5609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5611 DeleteFileA(msifile
);
5612 DeleteFileA(msifile2
);
5613 DeleteFileA(msifile3
);
5616 static void test_getproperty(void)
5618 MSIHANDLE hPackage
= 0;
5620 static CHAR empty
[] = "";
5624 hPackage
= package_from_db(create_package_db());
5625 ok( hPackage
!= 0, " Failed to create package\n");
5627 /* set the property */
5628 r
= MsiSetProperty(hPackage
, "Name", "Value");
5629 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5631 /* retrieve the size, NULL pointer */
5633 r
= MsiGetProperty(hPackage
, "Name", NULL
, &size
);
5634 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5635 ok( size
== 5, "Expected 5, got %d\n", size
);
5637 /* retrieve the size, empty string */
5639 r
= MsiGetProperty(hPackage
, "Name", empty
, &size
);
5640 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
5641 ok( size
== 5, "Expected 5, got %d\n", size
);
5643 /* don't change size */
5644 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
5645 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
5646 ok( size
== 5, "Expected 5, got %d\n", size
);
5647 ok( !lstrcmp(prop
, "Valu"), "Expected Valu, got %s\n", prop
);
5649 /* increase the size by 1 */
5651 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
5652 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5653 ok( size
== 5, "Expected 5, got %d\n", size
);
5654 ok( !lstrcmp(prop
, "Value"), "Expected Value, got %s\n", prop
);
5656 r
= MsiCloseHandle( hPackage
);
5657 ok( r
== ERROR_SUCCESS
, "Failed to close package\n" );
5658 DeleteFile(msifile
);
5661 static void test_removefiles(void)
5667 hdb
= create_package_db();
5668 ok ( hdb
, "failed to create package database\n" );
5670 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
5671 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
5673 r
= create_feature_table( hdb
);
5674 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
5676 r
= create_component_table( hdb
);
5677 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
5679 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
5680 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
5682 r
= add_component_entry( hdb
, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
5683 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5685 r
= add_component_entry( hdb
, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
5686 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5688 r
= add_component_entry( hdb
, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
5689 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5691 r
= add_component_entry( hdb
, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
5692 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5694 r
= add_component_entry( hdb
, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
5695 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5697 r
= add_component_entry( hdb
, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
5698 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
5700 r
= create_feature_components_table( hdb
);
5701 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
5703 r
= add_feature_components_entry( hdb
, "'one', 'hydrogen'" );
5704 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5706 r
= add_feature_components_entry( hdb
, "'one', 'helium'" );
5707 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5709 r
= add_feature_components_entry( hdb
, "'one', 'lithium'" );
5710 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5712 r
= add_feature_components_entry( hdb
, "'one', 'beryllium'" );
5713 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5715 r
= add_feature_components_entry( hdb
, "'one', 'boron'" );
5716 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5718 r
= add_feature_components_entry( hdb
, "'one', 'carbon'" );
5719 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
5721 r
= create_file_table( hdb
);
5722 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
5724 r
= add_file_entry( hdb
, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
5725 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5727 r
= add_file_entry( hdb
, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
5728 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5730 r
= add_file_entry( hdb
, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
5731 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5733 r
= add_file_entry( hdb
, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
5734 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5736 r
= add_file_entry( hdb
, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
5737 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5739 r
= add_file_entry( hdb
, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
5740 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
5742 r
= create_remove_file_table( hdb
);
5743 ok( r
== ERROR_SUCCESS
, "cannot create Remove File table: %d\n", r
);
5745 hpkg
= package_from_db( hdb
);
5746 ok( hpkg
, "failed to create package\n");
5748 MsiCloseHandle( hdb
);
5750 create_test_file( "hydrogen.txt" );
5751 create_test_file( "helium.txt" );
5752 create_test_file( "lithium.txt" );
5753 create_test_file( "beryllium.txt" );
5754 create_test_file( "boron.txt" );
5755 create_test_file( "carbon.txt" );
5757 r
= MsiSetProperty( hpkg
, "TARGETDIR", CURR_DIR
);
5758 ok( r
== ERROR_SUCCESS
, "set property failed\n");
5760 r
= MsiDoAction( hpkg
, "CostInitialize");
5761 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5763 r
= MsiDoAction( hpkg
, "FileCost");
5764 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5766 r
= MsiDoAction( hpkg
, "CostFinalize");
5767 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5769 r
= MsiDoAction( hpkg
, "InstallValidate");
5770 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
5772 r
= MsiSetComponentState( hpkg
, "hydrogen", INSTALLSTATE_ABSENT
);
5773 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5775 r
= MsiSetComponentState( hpkg
, "helium", INSTALLSTATE_LOCAL
);
5776 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5778 r
= MsiSetComponentState( hpkg
, "lithium", INSTALLSTATE_SOURCE
);
5779 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5781 r
= MsiSetComponentState( hpkg
, "beryllium", INSTALLSTATE_ABSENT
);
5782 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5784 r
= MsiSetComponentState( hpkg
, "boron", INSTALLSTATE_LOCAL
);
5785 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5787 r
= MsiSetComponentState( hpkg
, "carbon", INSTALLSTATE_SOURCE
);
5788 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
5790 r
= MsiDoAction( hpkg
, "RemoveFiles");
5791 ok( r
== ERROR_SUCCESS
, "remove files failed\n");
5793 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
5794 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
5795 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
5796 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
5797 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
5798 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
5800 MsiCloseHandle( hpkg
);
5801 DeleteFileA(msifile
);
5804 static void test_appsearch(void)
5809 CHAR prop
[MAX_PATH
];
5810 DWORD size
= MAX_PATH
;
5812 hdb
= create_package_db();
5813 ok ( hdb
, "failed to create package database\n" );
5815 r
= create_appsearch_table( hdb
);
5816 ok( r
== ERROR_SUCCESS
, "cannot create AppSearch table: %d\n", r
);
5818 r
= add_appsearch_entry( hdb
, "'WEBBROWSERPROG', 'NewSignature1'" );
5819 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
5821 r
= create_reglocator_table( hdb
);
5822 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
5824 r
= add_reglocator_entry( hdb
, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
5825 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
5827 r
= create_signature_table( hdb
);
5828 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
5830 r
= add_signature_entry( hdb
, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
5831 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
5833 hpkg
= package_from_db( hdb
);
5834 ok( hpkg
, "failed to create package\n");
5836 MsiCloseHandle( hdb
);
5838 r
= MsiDoAction( hpkg
, "AppSearch" );
5839 ok( r
== ERROR_SUCCESS
, "AppSearch failed: %d\n", r
);
5841 r
= MsiGetPropertyA( hpkg
, "WEBBROWSERPROG", prop
, &size
);
5842 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
5843 ok( lstrlenA(prop
) != 0, "Expected non-zero length\n");
5845 MsiCloseHandle( hpkg
);
5846 DeleteFileA(msifile
);
5849 static void test_appsearch_complocator(void)
5851 MSIHANDLE hpkg
, hdb
;
5852 CHAR path
[MAX_PATH
];
5853 CHAR prop
[MAX_PATH
];
5858 get_user_sid(&usersid
);
5861 skip("ConvertSidToStringSidA is not available\n");
5865 create_test_file("FileName1");
5866 create_test_file("FileName4");
5867 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE
,
5868 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL
, FALSE
);
5870 create_test_file("FileName2");
5871 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED
,
5872 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid
, FALSE
);
5874 create_test_file("FileName3");
5875 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED
,
5876 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid
, FALSE
);
5878 create_test_file("FileName5");
5879 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE
,
5880 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL
, TRUE
);
5882 create_test_file("FileName6");
5883 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE
,
5884 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL
, TRUE
);
5886 create_test_file("FileName7");
5887 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE
,
5888 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL
, FALSE
);
5890 /* dir is FALSE, but we're pretending it's a directory */
5891 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE
,
5892 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL
, FALSE
);
5894 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
5895 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE
,
5896 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL
, FALSE
);
5898 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
5899 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE
,
5900 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL
, FALSE
);
5902 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
5903 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE
,
5904 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL
, FALSE
);
5906 hdb
= create_package_db();
5907 ok(hdb
, "Expected a valid database handle\n");
5909 r
= create_appsearch_table(hdb
);
5910 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5912 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
5913 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5915 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
5916 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5918 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
5919 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5921 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
5922 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5924 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
5925 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5927 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
5928 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5930 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
5931 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5933 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
5934 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5936 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
5937 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5939 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
5940 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5942 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
5943 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5945 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
5946 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5948 r
= create_complocator_table(hdb
);
5949 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5951 /* published component, machine, file, signature, misdbLocatorTypeFile */
5952 r
= add_complocator_entry(hdb
, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
5953 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5955 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
5956 r
= add_complocator_entry(hdb
, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
5957 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5959 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
5960 r
= add_complocator_entry(hdb
, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
5961 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5963 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
5964 r
= add_complocator_entry(hdb
, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
5965 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5967 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
5968 r
= add_complocator_entry(hdb
, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
5969 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5971 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
5972 r
= add_complocator_entry(hdb
, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
5973 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5975 /* published component, machine, file, no signature, misdbLocatorTypeFile */
5976 r
= add_complocator_entry(hdb
, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
5977 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5979 /* unpublished component, no signature, misdbLocatorTypeDir */
5980 r
= add_complocator_entry(hdb
, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
5981 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5983 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
5984 r
= add_complocator_entry(hdb
, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
5985 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5987 /* published component, signature w/ ver, misdbLocatorTypeFile */
5988 r
= add_complocator_entry(hdb
, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
5989 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5991 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
5992 r
= add_complocator_entry(hdb
, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
5993 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5995 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
5996 r
= add_complocator_entry(hdb
, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
5997 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5999 r
= create_signature_table(hdb
);
6000 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6002 r
= add_signature_entry(hdb
, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
6003 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6005 r
= add_signature_entry(hdb
, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
6006 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6008 r
= add_signature_entry(hdb
, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
6009 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6011 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
6012 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6014 r
= add_signature_entry(hdb
, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
6015 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6017 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6018 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6020 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6021 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6023 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6024 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6026 hpkg
= package_from_db(hdb
);
6027 ok(hpkg
, "Expected a valid package handle\n");
6029 r
= MsiSetPropertyA(hpkg
, "SIGPROP8", "october");
6030 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6032 r
= MsiDoAction(hpkg
, "AppSearch");
6033 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6036 sprintf(path
, "%s\\FileName1", CURR_DIR
);
6037 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
6038 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6039 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6042 sprintf(path
, "%s\\FileName2", CURR_DIR
);
6043 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
6044 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6045 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6048 sprintf(path
, "%s\\FileName3", CURR_DIR
);
6049 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
6050 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6051 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6054 sprintf(path
, "%s\\FileName4", CURR_DIR
);
6055 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
6056 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6057 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6060 sprintf(path
, "%s\\FileName5", CURR_DIR
);
6061 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
6062 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6063 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6066 sprintf(path
, "%s\\", CURR_DIR
);
6067 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
6068 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6069 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6072 sprintf(path
, "%s\\", CURR_DIR
);
6073 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
6074 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6075 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6078 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
6079 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6080 ok(!lstrcmpA(prop
, "october"), "Expected \"october\", got \"%s\"\n", prop
);
6083 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
6084 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6085 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6088 sprintf(path
, "%s\\FileName8.dll", CURR_DIR
);
6089 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
6090 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6091 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6094 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
6095 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6098 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6102 sprintf(path
, "%s\\FileName10.dll", CURR_DIR
);
6103 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
6104 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6105 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6107 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
6108 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6109 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
6110 MSIINSTALLCONTEXT_USERUNMANAGED
, usersid
);
6111 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
6112 MSIINSTALLCONTEXT_USERMANAGED
, usersid
);
6113 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
6114 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6115 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
6116 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6117 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
6118 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6119 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
6120 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6121 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
6122 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6123 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
6124 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6125 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
6126 MSIINSTALLCONTEXT_MACHINE
, NULL
);
6128 DeleteFileA("FileName1");
6129 DeleteFileA("FileName2");
6130 DeleteFileA("FileName3");
6131 DeleteFileA("FileName4");
6132 DeleteFileA("FileName5");
6133 DeleteFileA("FileName6");
6134 DeleteFileA("FileName7");
6135 DeleteFileA("FileName8.dll");
6136 DeleteFileA("FileName9.dll");
6137 DeleteFileA("FileName10.dll");
6138 MsiCloseHandle(hpkg
);
6139 DeleteFileA(msifile
);
6142 static void test_appsearch_reglocator(void)
6144 MSIHANDLE hpkg
, hdb
;
6145 CHAR path
[MAX_PATH
];
6146 CHAR prop
[MAX_PATH
];
6155 res
= RegCreateKeyA(HKEY_CLASSES_ROOT
, "Software\\Wine", &classes
);
6156 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6158 res
= RegSetValueExA(classes
, "Value1", 0, REG_SZ
,
6159 (const BYTE
*)"regszdata", 10);
6160 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6162 res
= RegCreateKeyA(HKEY_CURRENT_USER
, "Software\\Wine", &hkcu
);
6163 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6165 res
= RegSetValueExA(hkcu
, "Value1", 0, REG_SZ
,
6166 (const BYTE
*)"regszdata", 10);
6167 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6169 res
= RegCreateKeyA(HKEY_USERS
, "S-1-5-18\\Software\\Wine", &users
);
6170 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6172 res
= RegSetValueExA(users
, "Value1", 0, REG_SZ
,
6173 (const BYTE
*)"regszdata", 10);
6174 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6176 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine", &hklm
);
6177 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6179 res
= RegSetValueA(hklm
, NULL
, REG_SZ
, "defvalue", 8);
6180 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6182 res
= RegSetValueExA(hklm
, "Value1", 0, REG_SZ
,
6183 (const BYTE
*)"regszdata", 10);
6184 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6187 res
= RegSetValueExA(hklm
, "Value2", 0, REG_DWORD
,
6188 (const BYTE
*)&val
, sizeof(DWORD
));
6189 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6192 res
= RegSetValueExA(hklm
, "Value3", 0, REG_DWORD
,
6193 (const BYTE
*)&val
, sizeof(DWORD
));
6194 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6196 res
= RegSetValueExA(hklm
, "Value4", 0, REG_EXPAND_SZ
,
6197 (const BYTE
*)"%PATH%", 7);
6198 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6200 res
= RegSetValueExA(hklm
, "Value5", 0, REG_EXPAND_SZ
,
6201 (const BYTE
*)"my%NOVAR%", 10);
6202 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6204 res
= RegSetValueExA(hklm
, "Value6", 0, REG_MULTI_SZ
,
6205 (const BYTE
*)"one\0two\0", 9);
6206 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6208 binary
[0] = 0x1234abcd;
6209 binary
[1] = 0x567890ef;
6210 res
= RegSetValueExA(hklm
, "Value7", 0, REG_BINARY
,
6211 (const BYTE
*)binary
, sizeof(binary
));
6212 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6214 res
= RegSetValueExA(hklm
, "Value8", 0, REG_SZ
,
6215 (const BYTE
*)"#regszdata", 11);
6216 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6218 create_test_file("FileName1");
6219 sprintf(path
, "%s\\FileName1", CURR_DIR
);
6220 res
= RegSetValueExA(hklm
, "Value9", 0, REG_SZ
,
6221 (const BYTE
*)path
, lstrlenA(path
) + 1);
6222 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6224 sprintf(path
, "%s\\FileName2", CURR_DIR
);
6225 res
= RegSetValueExA(hklm
, "Value10", 0, REG_SZ
,
6226 (const BYTE
*)path
, lstrlenA(path
) + 1);
6227 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6229 lstrcpyA(path
, CURR_DIR
);
6230 res
= RegSetValueExA(hklm
, "Value11", 0, REG_SZ
,
6231 (const BYTE
*)path
, lstrlenA(path
) + 1);
6232 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6234 res
= RegSetValueExA(hklm
, "Value12", 0, REG_SZ
,
6235 (const BYTE
*)"", 1);
6236 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6238 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6239 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
6240 res
= RegSetValueExA(hklm
, "Value13", 0, REG_SZ
,
6241 (const BYTE
*)path
, lstrlenA(path
) + 1);
6242 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6244 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
6245 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
6246 res
= RegSetValueExA(hklm
, "Value14", 0, REG_SZ
,
6247 (const BYTE
*)path
, lstrlenA(path
) + 1);
6248 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6250 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6251 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
6252 res
= RegSetValueExA(hklm
, "Value15", 0, REG_SZ
,
6253 (const BYTE
*)path
, lstrlenA(path
) + 1);
6254 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6256 hdb
= create_package_db();
6257 ok(hdb
, "Expected a valid database handle\n");
6259 r
= create_appsearch_table(hdb
);
6260 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6262 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
6263 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6265 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
6266 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6268 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
6269 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6271 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
6272 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6274 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
6275 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6277 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
6278 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6280 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
6281 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6283 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
6284 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6286 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
6287 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6289 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
6290 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6292 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
6293 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6295 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
6296 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6298 r
= add_appsearch_entry(hdb
, "'SIGPROP13', 'NewSignature13'");
6299 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6301 r
= add_appsearch_entry(hdb
, "'SIGPROP14', 'NewSignature14'");
6302 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6304 r
= add_appsearch_entry(hdb
, "'SIGPROP15', 'NewSignature15'");
6305 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6307 r
= add_appsearch_entry(hdb
, "'SIGPROP16', 'NewSignature16'");
6308 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6310 r
= add_appsearch_entry(hdb
, "'SIGPROP17', 'NewSignature17'");
6311 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6313 r
= add_appsearch_entry(hdb
, "'SIGPROP18', 'NewSignature18'");
6314 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6316 r
= add_appsearch_entry(hdb
, "'SIGPROP19', 'NewSignature19'");
6317 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6319 r
= add_appsearch_entry(hdb
, "'SIGPROP20', 'NewSignature20'");
6320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6322 r
= add_appsearch_entry(hdb
, "'SIGPROP21', 'NewSignature21'");
6323 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6325 r
= add_appsearch_entry(hdb
, "'SIGPROP22', 'NewSignature22'");
6326 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6328 r
= add_appsearch_entry(hdb
, "'SIGPROP23', 'NewSignature23'");
6329 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6331 r
= create_reglocator_table(hdb
);
6332 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6334 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
6335 str
= "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
6336 r
= add_reglocator_entry(hdb
, str
);
6337 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6339 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
6340 str
= "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
6341 r
= add_reglocator_entry(hdb
, str
);
6342 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6344 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
6345 str
= "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
6346 r
= add_reglocator_entry(hdb
, str
);
6347 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6349 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
6350 str
= "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
6351 r
= add_reglocator_entry(hdb
, str
);
6352 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6354 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
6355 str
= "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
6356 r
= add_reglocator_entry(hdb
, str
);
6357 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6359 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
6360 str
= "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
6361 r
= add_reglocator_entry(hdb
, str
);
6362 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6364 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
6365 str
= "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
6366 r
= add_reglocator_entry(hdb
, str
);
6367 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6369 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
6370 str
= "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
6371 r
= add_reglocator_entry(hdb
, str
);
6372 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6374 /* HKLM, msidbLocatorTypeFileName, file exists */
6375 str
= "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
6376 r
= add_reglocator_entry(hdb
, str
);
6377 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6379 /* HKLM, msidbLocatorTypeFileName, file does not exist */
6380 str
= "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
6381 r
= add_reglocator_entry(hdb
, str
);
6382 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6384 /* HKLM, msidbLocatorTypeFileName, no signature */
6385 str
= "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
6386 r
= add_reglocator_entry(hdb
, str
);
6387 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6389 /* HKLM, msidbLocatorTypeDirectory, file exists */
6390 str
= "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
6391 r
= add_reglocator_entry(hdb
, str
);
6392 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6394 /* HKLM, msidbLocatorTypeDirectory, directory */
6395 str
= "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
6396 r
= add_reglocator_entry(hdb
, str
);
6397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6399 /* HKLM, msidbLocatorTypeDirectory, file exists, with signature */
6400 str
= "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
6401 r
= add_reglocator_entry(hdb
, str
);
6402 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6404 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
6405 str
= "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
6406 r
= add_reglocator_entry(hdb
, str
);
6407 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6409 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
6410 str
= "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
6411 r
= add_reglocator_entry(hdb
, str
);
6412 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6414 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
6415 str
= "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
6416 r
= add_reglocator_entry(hdb
, str
);
6417 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6419 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
6420 str
= "'NewSignature18', 2, 'Software\\Wine', '', 2";
6421 r
= add_reglocator_entry(hdb
, str
);
6422 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6424 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
6425 str
= "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
6426 r
= add_reglocator_entry(hdb
, str
);
6427 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6429 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
6430 str
= "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
6431 r
= add_reglocator_entry(hdb
, str
);
6432 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6434 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, signature */
6435 str
= "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
6436 r
= add_reglocator_entry(hdb
, str
);
6437 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6439 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
6440 str
= "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
6441 r
= add_reglocator_entry(hdb
, str
);
6442 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6444 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
6445 str
= "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
6446 r
= add_reglocator_entry(hdb
, str
);
6447 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6449 r
= create_signature_table(hdb
);
6450 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6452 str
= "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
6453 r
= add_signature_entry(hdb
, str
);
6454 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6456 str
= "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
6457 r
= add_signature_entry(hdb
, str
);
6458 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6460 str
= "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
6461 r
= add_signature_entry(hdb
, str
);
6462 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6464 str
= "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
6465 r
= add_signature_entry(hdb
, str
);
6466 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6468 str
= "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
6469 r
= add_signature_entry(hdb
, str
);
6470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6472 str
= "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
6473 r
= add_signature_entry(hdb
, str
);
6474 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6476 hpkg
= package_from_db(hdb
);
6477 ok(hpkg
, "Expected a valid package handle\n");
6479 r
= MsiDoAction(hpkg
, "AppSearch");
6480 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6483 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
6484 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6485 ok(!lstrcmpA(prop
, "regszdata"),
6486 "Expected \"regszdata\", got \"%s\"\n", prop
);
6489 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
6490 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6491 ok(!lstrcmpA(prop
, "#42"), "Expected \"#42\", got \"%s\"\n", prop
);
6494 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
6495 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6496 ok(!lstrcmpA(prop
, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop
);
6498 ExpandEnvironmentStringsA("%PATH%", path
, MAX_PATH
);
6501 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
6502 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6503 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6506 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
6507 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6509 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop
);
6512 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
6513 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6516 ok(!memcmp(prop
, "\0one\0two\0\0", 10),
6517 "Expected \"\\0one\\0two\\0\\0\"\n");
6521 lstrcpyA(path
, "#xCDAB3412EF907856");
6522 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
6523 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6524 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6527 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
6528 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6529 ok(!lstrcmpA(prop
, "##regszdata"),
6530 "Expected \"##regszdata\", got \"%s\"\n", prop
);
6533 sprintf(path
, "%s\\FileName1", CURR_DIR
);
6534 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
6535 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6536 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6539 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
6540 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6543 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6547 sprintf(path
, "%s\\", CURR_DIR
);
6548 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
6549 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6552 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6556 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
6557 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6558 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6561 sprintf(path
, "%s\\", CURR_DIR
);
6562 r
= MsiGetPropertyA(hpkg
, "SIGPROP13", prop
, &size
);
6563 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6564 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6567 r
= MsiGetPropertyA(hpkg
, "SIGPROP14", prop
, &size
);
6568 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6569 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6572 r
= MsiGetPropertyA(hpkg
, "SIGPROP15", prop
, &size
);
6573 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6574 ok(!lstrcmpA(prop
, "regszdata"),
6575 "Expected \"regszdata\", got \"%s\"\n", prop
);
6578 r
= MsiGetPropertyA(hpkg
, "SIGPROP16", prop
, &size
);
6579 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6580 ok(!lstrcmpA(prop
, "regszdata"),
6581 "Expected \"regszdata\", got \"%s\"\n", prop
);
6584 r
= MsiGetPropertyA(hpkg
, "SIGPROP17", prop
, &size
);
6585 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6586 ok(!lstrcmpA(prop
, "regszdata"),
6587 "Expected \"regszdata\", got \"%s\"\n", prop
);
6590 r
= MsiGetPropertyA(hpkg
, "SIGPROP18", prop
, &size
);
6591 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6592 ok(!lstrcmpA(prop
, "defvalue"),
6593 "Expected \"defvalue\", got \"%s\"\n", prop
);
6596 r
= MsiGetPropertyA(hpkg
, "SIGPROP19", prop
, &size
);
6597 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6598 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6601 r
= MsiGetPropertyA(hpkg
, "SIGPROP20", prop
, &size
);
6602 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6603 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6606 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
6607 r
= MsiGetPropertyA(hpkg
, "SIGPROP21", prop
, &size
);
6608 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6609 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6612 r
= MsiGetPropertyA(hpkg
, "SIGPROP22", prop
, &size
);
6613 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6616 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6620 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
6621 r
= MsiGetPropertyA(hpkg
, "SIGPROP23", prop
, &size
);
6622 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6623 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6625 RegSetValueA(hklm
, NULL
, REG_SZ
, "", 0);
6626 RegDeleteValueA(hklm
, "Value1");
6627 RegDeleteValueA(hklm
, "Value2");
6628 RegDeleteValueA(hklm
, "Value3");
6629 RegDeleteValueA(hklm
, "Value4");
6630 RegDeleteValueA(hklm
, "Value5");
6631 RegDeleteValueA(hklm
, "Value6");
6632 RegDeleteValueA(hklm
, "Value7");
6633 RegDeleteValueA(hklm
, "Value8");
6634 RegDeleteValueA(hklm
, "Value9");
6635 RegDeleteValueA(hklm
, "Value10");
6636 RegDeleteValueA(hklm
, "Value11");
6637 RegDeleteValueA(hklm
, "Value12");
6638 RegDeleteValueA(hklm
, "Value13");
6639 RegDeleteValueA(hklm
, "Value14");
6640 RegDeleteValueA(hklm
, "Value15");
6641 RegDeleteKeyA(hklm
, "");
6644 RegDeleteValueA(classes
, "Value1");
6645 RegDeleteKeyA(classes
, "");
6646 RegCloseKey(classes
);
6648 RegDeleteValueA(hkcu
, "Value1");
6649 RegDeleteKeyA(hkcu
, "");
6652 RegDeleteValueA(users
, "Value1");
6653 RegDeleteKeyA(users
, "");
6656 DeleteFileA("FileName1");
6657 DeleteFileA("FileName3.dll");
6658 DeleteFileA("FileName4.dll");
6659 DeleteFileA("FileName5.dll");
6660 MsiCloseHandle(hpkg
);
6661 DeleteFileA(msifile
);
6664 static void delete_win_ini(LPCSTR file
)
6666 CHAR path
[MAX_PATH
];
6668 GetWindowsDirectoryA(path
, MAX_PATH
);
6669 lstrcatA(path
, "\\");
6670 lstrcatA(path
, file
);
6675 static void test_appsearch_inilocator(void)
6677 MSIHANDLE hpkg
, hdb
;
6678 CHAR path
[MAX_PATH
];
6679 CHAR prop
[MAX_PATH
];
6685 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
6687 create_test_file("FileName1");
6688 sprintf(path
, "%s\\FileName1", CURR_DIR
);
6689 WritePrivateProfileStringA("Section", "Key2", path
, "IniFile.ini");
6691 WritePrivateProfileStringA("Section", "Key3", CURR_DIR
, "IniFile.ini");
6693 sprintf(path
, "%s\\IDontExist", CURR_DIR
);
6694 WritePrivateProfileStringA("Section", "Key4", path
, "IniFile.ini");
6696 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6697 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
6698 WritePrivateProfileStringA("Section", "Key5", path
, "IniFile.ini");
6700 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
6701 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
6702 WritePrivateProfileStringA("Section", "Key6", path
, "IniFile.ini");
6704 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6705 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
6706 WritePrivateProfileStringA("Section", "Key7", path
, "IniFile.ini");
6708 hdb
= create_package_db();
6709 ok(hdb
, "Expected a valid database handle\n");
6711 r
= create_appsearch_table(hdb
);
6712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6714 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
6715 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6717 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
6718 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6720 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
6721 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6723 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
6724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6726 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
6727 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6729 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
6730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6732 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
6733 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6735 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
6736 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6738 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
6739 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6741 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
6742 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6744 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
6745 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6747 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
6748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6750 r
= create_inilocator_table(hdb
);
6751 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6753 /* msidbLocatorTypeRawValue, field 1 */
6754 str
= "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
6755 r
= add_inilocator_entry(hdb
, str
);
6756 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6758 /* msidbLocatorTypeRawValue, field 2 */
6759 str
= "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
6760 r
= add_inilocator_entry(hdb
, str
);
6761 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6763 /* msidbLocatorTypeRawValue, entire field */
6764 str
= "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
6765 r
= add_inilocator_entry(hdb
, str
);
6766 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6768 /* msidbLocatorTypeFile */
6769 str
= "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
6770 r
= add_inilocator_entry(hdb
, str
);
6771 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6773 /* msidbLocatorTypeDirectory, file */
6774 str
= "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
6775 r
= add_inilocator_entry(hdb
, str
);
6776 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6778 /* msidbLocatorTypeDirectory, directory */
6779 str
= "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
6780 r
= add_inilocator_entry(hdb
, str
);
6781 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6783 /* msidbLocatorTypeFile, file, no signature */
6784 str
= "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
6785 r
= add_inilocator_entry(hdb
, str
);
6786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6788 /* msidbLocatorTypeFile, dir, no signature */
6789 str
= "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
6790 r
= add_inilocator_entry(hdb
, str
);
6791 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6793 /* msidbLocatorTypeFile, file does not exist */
6794 str
= "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
6795 r
= add_inilocator_entry(hdb
, str
);
6796 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6798 /* msidbLocatorTypeFile, signature with version */
6799 str
= "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
6800 r
= add_inilocator_entry(hdb
, str
);
6801 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6803 /* msidbLocatorTypeFile, signature with version, ver > max */
6804 str
= "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
6805 r
= add_inilocator_entry(hdb
, str
);
6806 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6808 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
6809 str
= "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
6810 r
= add_inilocator_entry(hdb
, str
);
6811 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6813 r
= create_signature_table(hdb
);
6814 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6816 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
6817 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6819 r
= add_signature_entry(hdb
, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
6820 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6822 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6823 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6825 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6826 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6828 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
6829 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6831 hpkg
= package_from_db(hdb
);
6832 ok(hpkg
, "Expected a valid package handle\n");
6834 r
= MsiDoAction(hpkg
, "AppSearch");
6835 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6838 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
6839 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6840 ok(!lstrcmpA(prop
, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop
);
6843 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
6844 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6845 ok(!lstrcmpA(prop
, "field2"), "Expected \"field2\", got \"%s\"\n", prop
);
6848 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
6849 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6850 ok(!lstrcmpA(prop
, "keydata,field2"),
6851 "Expected \"keydata,field2\", got \"%s\"\n", prop
);
6854 sprintf(path
, "%s\\FileName1", CURR_DIR
);
6855 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
6856 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6859 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6863 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
6864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6865 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6868 sprintf(path
, "%s\\", CURR_DIR
);
6869 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
6870 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6873 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6877 sprintf(path
, "%s\\", CURR_DIR
);
6878 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
6879 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6882 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6886 lstrcpyA(path
, CURR_DIR
);
6887 ptr
= strrchr(path
, '\\');
6889 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
6890 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6893 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6897 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
6898 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6899 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6902 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
6903 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
6904 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6907 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6911 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
6912 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6913 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
6916 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
6917 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
6918 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6921 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
6924 delete_win_ini("IniFile.ini");
6925 DeleteFileA("FileName1");
6926 DeleteFileA("FileName2.dll");
6927 DeleteFileA("FileName3.dll");
6928 DeleteFileA("FileName4.dll");
6929 MsiCloseHandle(hpkg
);
6930 DeleteFileA(msifile
);
6933 static void test_appsearch_drlocator(void)
6935 MSIHANDLE hpkg
, hdb
;
6936 CHAR path
[MAX_PATH
];
6937 CHAR prop
[MAX_PATH
];
6942 create_test_file("FileName1");
6943 CreateDirectoryA("one", NULL
);
6944 CreateDirectoryA("one\\two", NULL
);
6945 CreateDirectoryA("one\\two\\three", NULL
);
6946 create_test_file("one\\two\\three\\FileName2");
6947 CreateDirectoryA("another", NULL
);
6948 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6949 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
6950 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
6952 hdb
= create_package_db();
6953 ok(hdb
, "Expected a valid database handle\n");
6955 r
= create_appsearch_table(hdb
);
6956 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6958 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
6959 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6961 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
6962 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6964 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
6965 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6967 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
6968 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6970 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
6971 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6973 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
6974 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6976 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
6977 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6979 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
6980 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6982 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
6983 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6985 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
6986 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6988 r
= create_drlocator_table(hdb
);
6989 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6991 /* no parent, full path, depth 0, signature */
6992 sprintf(path
, "'NewSignature1', '', '%s', 0", CURR_DIR
);
6993 r
= add_drlocator_entry(hdb
, path
);
6994 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6996 /* no parent, full path, depth 0, no signature */
6997 sprintf(path
, "'NewSignature2', '', '%s', 0", CURR_DIR
);
6998 r
= add_drlocator_entry(hdb
, path
);
6999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7001 /* no parent, relative path, depth 0, no signature */
7002 sprintf(path
, "'NewSignature3', '', '%s', 0", CURR_DIR
+ 3);
7003 r
= add_drlocator_entry(hdb
, path
);
7004 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7006 /* no parent, full path, depth 2, signature */
7007 sprintf(path
, "'NewSignature4', '', '%s', 2", CURR_DIR
);
7008 r
= add_drlocator_entry(hdb
, path
);
7009 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7011 /* no parent, full path, depth 3, signature */
7012 sprintf(path
, "'NewSignature5', '', '%s', 3", CURR_DIR
);
7013 r
= add_drlocator_entry(hdb
, path
);
7014 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7016 /* no parent, full path, depth 1, signature is dir */
7017 sprintf(path
, "'NewSignature6', '', '%s', 1", CURR_DIR
);
7018 r
= add_drlocator_entry(hdb
, path
);
7019 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7021 /* parent is in DrLocator, relative path, depth 0, signature */
7022 sprintf(path
, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
7023 r
= add_drlocator_entry(hdb
, path
);
7024 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7026 /* no parent, full path, depth 0, signature w/ version */
7027 sprintf(path
, "'NewSignature8', '', '%s', 0", CURR_DIR
);
7028 r
= add_drlocator_entry(hdb
, path
);
7029 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7031 /* no parent, full path, depth 0, signature w/ version, ver > max */
7032 sprintf(path
, "'NewSignature9', '', '%s', 0", CURR_DIR
);
7033 r
= add_drlocator_entry(hdb
, path
);
7034 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7036 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
7037 sprintf(path
, "'NewSignature10', '', '%s', 0", CURR_DIR
);
7038 r
= add_drlocator_entry(hdb
, path
);
7039 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7041 r
= create_signature_table(hdb
);
7042 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7044 str
= "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
7045 r
= add_signature_entry(hdb
, str
);
7046 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7048 str
= "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
7049 r
= add_signature_entry(hdb
, str
);
7050 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7052 str
= "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
7053 r
= add_signature_entry(hdb
, str
);
7054 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7056 str
= "'NewSignature6', 'another', '', '', '', '', '', '', ''";
7057 r
= add_signature_entry(hdb
, str
);
7058 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7060 str
= "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
7061 r
= add_signature_entry(hdb
, str
);
7062 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7064 str
= "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7065 r
= add_signature_entry(hdb
, str
);
7066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7068 str
= "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7069 r
= add_signature_entry(hdb
, str
);
7070 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7072 str
= "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7073 r
= add_signature_entry(hdb
, str
);
7074 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7076 hpkg
= package_from_db(hdb
);
7077 ok(hpkg
, "Expected a valid package handle\n");
7079 r
= MsiDoAction(hpkg
, "AppSearch");
7080 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7083 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7084 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
7085 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7088 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7092 sprintf(path
, "%s\\", CURR_DIR
);
7093 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
7094 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7095 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7098 sprintf(path
, "%s\\", CURR_DIR
);
7099 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
7100 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7101 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7104 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
7105 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7108 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7112 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
7113 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
7114 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7117 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7121 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
7122 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7125 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7129 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
7130 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
7131 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7134 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7138 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
7139 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
7140 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7143 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7147 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
7148 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7151 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7155 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
7156 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7159 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7162 DeleteFileA("FileName1");
7163 DeleteFileA("FileName3.dll");
7164 DeleteFileA("FileName4.dll");
7165 DeleteFileA("FileName5.dll");
7166 DeleteFileA("one\\two\\three\\FileName2");
7167 RemoveDirectoryA("one\\two\\three");
7168 RemoveDirectoryA("one\\two");
7169 RemoveDirectoryA("one");
7170 RemoveDirectoryA("another");
7171 MsiCloseHandle(hpkg
);
7172 DeleteFileA(msifile
);
7175 static void test_featureparents(void)
7180 INSTALLSTATE state
, action
;
7182 hdb
= create_package_db();
7183 ok ( hdb
, "failed to create package database\n" );
7185 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
7186 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
7188 r
= create_feature_table( hdb
);
7189 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
7191 r
= create_component_table( hdb
);
7192 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
7194 r
= create_feature_components_table( hdb
);
7195 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
7197 r
= create_file_table( hdb
);
7198 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
7200 /* msidbFeatureAttributesFavorLocal */
7201 r
= add_feature_entry( hdb
, "'zodiac', '', '', '', 2, 1, '', 0" );
7202 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7204 /* msidbFeatureAttributesFavorSource */
7205 r
= add_feature_entry( hdb
, "'perseus', '', '', '', 2, 1, '', 1" );
7206 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7208 /* msidbFeatureAttributesFavorLocal */
7209 r
= add_feature_entry( hdb
, "'orion', '', '', '', 2, 1, '', 0" );
7210 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7212 /* disabled because of install level */
7213 r
= add_feature_entry( hdb
, "'waters', '', '', '', 15, 101, '', 9" );
7214 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7216 /* child feature of disabled feature */
7217 r
= add_feature_entry( hdb
, "'bayer', 'waters', '', '', 14, 1, '', 9" );
7218 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7220 /* component of disabled feature (install level) */
7221 r
= add_component_entry( hdb
, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
7222 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7224 /* component of disabled child feature (install level) */
7225 r
= add_component_entry( hdb
, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
7226 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7228 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
7229 r
= add_component_entry( hdb
, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
7230 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7232 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
7233 r
= add_component_entry( hdb
, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
7234 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7236 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
7237 r
= add_component_entry( hdb
, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
7238 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7240 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
7241 r
= add_component_entry( hdb
, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
7242 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7244 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
7245 r
= add_component_entry( hdb
, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
7246 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7248 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
7249 r
= add_component_entry( hdb
, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
7250 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7252 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
7253 r
= add_component_entry( hdb
, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
7254 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7256 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
7257 r
= add_component_entry( hdb
, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
7258 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7260 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
7261 r
= add_component_entry( hdb
, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
7263 r
= add_feature_components_entry( hdb
, "'zodiac', 'leo'" );
7264 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7266 r
= add_feature_components_entry( hdb
, "'zodiac', 'virgo'" );
7267 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7269 r
= add_feature_components_entry( hdb
, "'zodiac', 'libra'" );
7270 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7272 r
= add_feature_components_entry( hdb
, "'perseus', 'cassiopeia'" );
7273 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7275 r
= add_feature_components_entry( hdb
, "'perseus', 'cepheus'" );
7276 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7278 r
= add_feature_components_entry( hdb
, "'perseus', 'andromeda'" );
7279 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7281 r
= add_feature_components_entry( hdb
, "'orion', 'leo'" );
7282 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7284 r
= add_feature_components_entry( hdb
, "'orion', 'virgo'" );
7285 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7287 r
= add_feature_components_entry( hdb
, "'orion', 'libra'" );
7288 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7290 r
= add_feature_components_entry( hdb
, "'orion', 'cassiopeia'" );
7291 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7293 r
= add_feature_components_entry( hdb
, "'orion', 'cepheus'" );
7294 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7296 r
= add_feature_components_entry( hdb
, "'orion', 'andromeda'" );
7297 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7299 r
= add_feature_components_entry( hdb
, "'orion', 'canis'" );
7300 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7302 r
= add_feature_components_entry( hdb
, "'orion', 'monoceros'" );
7303 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7305 r
= add_feature_components_entry( hdb
, "'orion', 'lepus'" );
7306 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7308 r
= add_feature_components_entry( hdb
, "'waters', 'delphinus'" );
7309 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7311 r
= add_feature_components_entry( hdb
, "'bayer', 'hydrus'" );
7312 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7314 r
= add_file_entry( hdb
, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
7315 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7317 r
= add_file_entry( hdb
, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
7318 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7320 r
= add_file_entry( hdb
, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
7321 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7323 r
= add_file_entry( hdb
, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
7324 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7326 r
= add_file_entry( hdb
, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
7327 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7329 r
= add_file_entry( hdb
, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
7330 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7332 r
= add_file_entry( hdb
, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
7333 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7335 r
= add_file_entry( hdb
, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
7336 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7338 r
= add_file_entry( hdb
, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
7339 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7341 r
= add_file_entry( hdb
, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
7342 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7344 r
= add_file_entry( hdb
, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
7345 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7347 hpkg
= package_from_db( hdb
);
7348 ok( hpkg
, "failed to create package\n");
7350 MsiCloseHandle( hdb
);
7352 r
= MsiDoAction( hpkg
, "CostInitialize");
7353 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
7355 r
= MsiDoAction( hpkg
, "FileCost");
7356 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
7358 r
= MsiDoAction( hpkg
, "CostFinalize");
7359 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7363 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
7364 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7365 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7366 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7370 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
7371 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7372 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7373 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7377 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
7378 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7379 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7380 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7384 r
= MsiGetFeatureState(hpkg
, "waters", &state
, &action
);
7385 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7386 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7387 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7391 r
= MsiGetFeatureState(hpkg
, "bayer", &state
, &action
);
7392 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7393 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7394 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7398 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
7399 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7400 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7401 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7405 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
7406 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7407 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
7408 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
7412 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
7413 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7414 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
7415 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
7419 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
7420 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7421 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
7422 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
7426 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
7427 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7428 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7429 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
7433 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
7434 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7435 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
7436 ok( action
== INSTALLSTATE_LOCAL
, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action
);
7440 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
7441 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7442 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
7443 ok( action
== INSTALLSTATE_LOCAL
, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action
);
7447 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
7448 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7449 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
7450 ok( action
== INSTALLSTATE_SOURCE
, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action
);
7454 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
7455 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7456 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7457 ok( action
== INSTALLSTATE_LOCAL
, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action
);
7461 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
7462 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7463 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7464 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
7468 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
7469 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7470 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7471 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
7473 r
= MsiSetFeatureState(hpkg
, "orion", INSTALLSTATE_ABSENT
);
7474 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
7478 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
7479 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7480 ok( state
== INSTALLSTATE_ABSENT
, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state
);
7481 ok( action
== INSTALLSTATE_LOCAL
, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action
);
7485 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
7486 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7487 ok( state
== INSTALLSTATE_ABSENT
, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state
);
7488 ok( action
== INSTALLSTATE_SOURCE
, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action
);
7492 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
7493 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7494 ok( state
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state
);
7495 ok( action
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action
);
7499 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
7500 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7501 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state
);
7502 ok( action
== INSTALLSTATE_LOCAL
, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action
);
7506 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
7507 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7508 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
7509 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
7513 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
7514 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7515 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
7516 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
7520 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
7521 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7522 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
7523 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
7527 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
7528 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7529 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7530 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
7534 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
7535 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7536 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
7537 ok( action
== INSTALLSTATE_SOURCE
, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action
);
7541 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
7542 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7543 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
7544 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action
);
7548 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
7549 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7550 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
7551 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action
);
7555 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
7556 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7557 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7558 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action
);
7562 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
7563 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7564 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7565 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
7569 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
7570 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7571 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
7572 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
7574 MsiCloseHandle(hpkg
);
7575 DeleteFileA(msifile
);
7578 static void test_installprops(void)
7580 MSIHANDLE hpkg
, hdb
;
7581 CHAR path
[MAX_PATH
];
7589 GetCurrentDirectory(MAX_PATH
, path
);
7590 lstrcat(path
, "\\");
7591 lstrcat(path
, msifile
);
7593 hdb
= create_package_db();
7594 ok( hdb
, "failed to create database\n");
7596 hpkg
= package_from_db(hdb
);
7597 ok( hpkg
, "failed to create package\n");
7599 MsiCloseHandle(hdb
);
7602 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
7603 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7604 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
7606 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
7608 RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2
);
7613 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
7617 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
7620 /* win9x doesn't set this */
7624 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
7625 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7626 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
7632 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
7636 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
7642 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
7643 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7644 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
7648 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
7649 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7650 trace("VersionDatabase = %s\n", buf
);
7653 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
7654 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7655 trace("VersionMsi = %s\n", buf
);
7658 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
7659 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7660 trace("Date = %s\n", buf
);
7663 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
7664 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7665 trace("Time = %s\n", buf
);
7668 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
7669 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
7670 trace("PackageCode = %s\n", buf
);
7672 langid
= GetUserDefaultLangID();
7673 sprintf(path
, "%d", langid
);
7676 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
7677 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS< got %d\n", r
);
7678 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
7680 res
= GetSystemMetrics(SM_CXSCREEN
);
7682 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
7683 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
7685 res
= GetSystemMetrics(SM_CYSCREEN
);
7687 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
7688 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
7692 MsiCloseHandle(hpkg
);
7693 DeleteFile(msifile
);
7696 static void test_launchconditions(void)
7702 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
7704 hdb
= create_package_db();
7705 ok( hdb
, "failed to create package database\n" );
7707 r
= create_launchcondition_table( hdb
);
7708 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
7710 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
7711 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
7713 /* invalid condition */
7714 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
7715 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
7717 hpkg
= package_from_db( hdb
);
7718 ok( hpkg
, "failed to create package\n");
7720 MsiCloseHandle( hdb
);
7722 r
= MsiSetProperty( hpkg
, "X", "1" );
7723 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
7725 /* invalid conditions are ignored */
7726 r
= MsiDoAction( hpkg
, "LaunchConditions" );
7727 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
7729 /* verify LaunchConditions still does some verification */
7730 r
= MsiSetProperty( hpkg
, "X", "2" );
7731 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
7733 r
= MsiDoAction( hpkg
, "LaunchConditions" );
7734 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
7736 MsiCloseHandle( hpkg
);
7737 DeleteFile( msifile
);
7740 static void test_ccpsearch(void)
7742 MSIHANDLE hdb
, hpkg
;
7743 CHAR prop
[MAX_PATH
];
7744 DWORD size
= MAX_PATH
;
7747 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
7749 hdb
= create_package_db();
7750 ok(hdb
, "failed to create package database\n");
7752 r
= create_ccpsearch_table(hdb
);
7753 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7755 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
7756 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7758 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
7759 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7761 r
= create_reglocator_table(hdb
);
7762 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7764 r
= add_reglocator_entry(hdb
, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
7765 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7767 r
= create_drlocator_table(hdb
);
7768 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7770 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
7771 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7773 r
= create_signature_table(hdb
);
7774 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7776 hpkg
= package_from_db(hdb
);
7777 ok(hpkg
, "failed to create package\n");
7779 MsiCloseHandle(hdb
);
7781 r
= MsiDoAction(hpkg
, "CCPSearch");
7782 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7784 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
7785 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7786 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
7788 MsiCloseHandle(hpkg
);
7789 DeleteFileA(msifile
);
7792 static void test_complocator(void)
7794 MSIHANDLE hdb
, hpkg
;
7796 CHAR prop
[MAX_PATH
];
7797 CHAR expected
[MAX_PATH
];
7798 DWORD size
= MAX_PATH
;
7800 hdb
= create_package_db();
7801 ok(hdb
, "failed to create package database\n");
7803 r
= create_appsearch_table(hdb
);
7804 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7806 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
7807 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7809 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
7810 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7812 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
7813 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7815 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
7816 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7818 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
7819 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7821 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
7822 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7824 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
7825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7827 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
7828 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7830 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
7831 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7833 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
7834 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7836 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
7837 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7839 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
7840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7842 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
7843 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7845 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
7846 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7848 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
7849 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7851 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
7852 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7854 r
= create_complocator_table(hdb
);
7855 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7857 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
7858 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7860 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
7861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7863 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
7864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7866 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
7867 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7869 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
7870 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7872 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
7873 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7875 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
7876 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7878 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
7879 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7881 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
7882 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7884 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
7885 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7887 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
7888 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7890 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
7891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7893 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
7894 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7896 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
7897 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7899 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
7900 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7902 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
7903 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7905 r
= create_signature_table(hdb
);
7906 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7908 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
7909 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7911 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
7912 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7914 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
7915 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7917 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
7918 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7920 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
7921 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7923 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
7924 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7926 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
7927 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7929 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
7930 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7932 hpkg
= package_from_db(hdb
);
7933 ok(hpkg
, "failed to create package\n");
7935 MsiCloseHandle(hdb
);
7937 create_test_file("abelisaurus");
7938 create_test_file("bactrosaurus");
7939 create_test_file("camelotia");
7940 create_test_file("diclonius");
7941 create_test_file("echinodon");
7942 create_test_file("falcarius");
7943 create_test_file("gallimimus");
7944 create_test_file("hagryphus");
7945 CreateDirectoryA("iguanodon", NULL
);
7946 CreateDirectoryA("jobaria", NULL
);
7947 CreateDirectoryA("kakuru", NULL
);
7948 CreateDirectoryA("labocania", NULL
);
7949 CreateDirectoryA("megaraptor", NULL
);
7950 CreateDirectoryA("neosodon", NULL
);
7951 CreateDirectoryA("olorotitan", NULL
);
7952 CreateDirectoryA("pantydraco", NULL
);
7954 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE
,
7955 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL
, FALSE
);
7956 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE
,
7957 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL
, FALSE
);
7958 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE
,
7959 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL
, FALSE
);
7960 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE
,
7961 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL
, FALSE
);
7962 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE
,
7963 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL
, FALSE
);
7964 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE
,
7965 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL
, FALSE
);
7966 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE
,
7967 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL
, FALSE
);
7968 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE
,
7969 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL
, FALSE
);
7971 r
= MsiDoAction(hpkg
, "AppSearch");
7972 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7975 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
7976 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7978 lstrcpyA(expected
, CURR_DIR
);
7979 lstrcatA(expected
, "\\abelisaurus");
7980 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
7981 "Expected %s or empty string, got %s\n", expected
, prop
);
7984 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", prop
, &size
);
7985 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7986 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
7989 r
= MsiGetPropertyA(hpkg
, "CAMELOTIA", prop
, &size
);
7990 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7991 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
7994 r
= MsiGetPropertyA(hpkg
, "DICLONIUS", prop
, &size
);
7995 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7996 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
7999 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
8000 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8002 lstrcpyA(expected
, CURR_DIR
);
8003 lstrcatA(expected
, "\\");
8004 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
8005 "Expected %s or empty string, got %s\n", expected
, prop
);
8008 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
8009 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8010 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8013 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
8014 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8015 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8018 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
8019 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8020 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8023 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
8024 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8025 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8028 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
8029 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8030 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8033 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
8034 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8035 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8038 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
8039 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8040 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8043 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
8044 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8046 lstrcpyA(expected
, CURR_DIR
);
8047 lstrcatA(expected
, "\\");
8048 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
8049 "Expected %s or empty string, got %s\n", expected
, prop
);
8052 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
8053 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8055 lstrcpyA(expected
, CURR_DIR
);
8056 lstrcatA(expected
, "\\neosodon\\");
8057 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
8058 "Expected %s or empty string, got %s\n", expected
, prop
);
8061 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
8062 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8063 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8066 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
8067 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8068 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
8070 MsiCloseHandle(hpkg
);
8071 DeleteFileA("abelisaurus");
8072 DeleteFileA("bactrosaurus");
8073 DeleteFileA("camelotia");
8074 DeleteFileA("diclonius");
8075 DeleteFileA("echinodon");
8076 DeleteFileA("falcarius");
8077 DeleteFileA("gallimimus");
8078 DeleteFileA("hagryphus");
8079 RemoveDirectoryA("iguanodon");
8080 RemoveDirectoryA("jobaria");
8081 RemoveDirectoryA("kakuru");
8082 RemoveDirectoryA("labocania");
8083 RemoveDirectoryA("megaraptor");
8084 RemoveDirectoryA("neosodon");
8085 RemoveDirectoryA("olorotitan");
8086 RemoveDirectoryA("pantydraco");
8087 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
8088 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8089 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
8090 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8091 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
8092 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8093 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
8094 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8095 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
8096 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8097 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
8098 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8099 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
8100 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8101 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
8102 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8103 DeleteFileA(msifile
);
8106 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
8111 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
8112 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8114 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
8115 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8117 r
= MsiSummaryInfoPersist(summary
);
8118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
8120 MsiCloseHandle(summary
);
8123 static void test_MsiGetSourcePath(void)
8125 MSIHANDLE hdb
, hpkg
;
8126 CHAR path
[MAX_PATH
];
8128 CHAR subsrc
[MAX_PATH
];
8129 CHAR sub2
[MAX_PATH
];
8133 lstrcpyA(cwd
, CURR_DIR
);
8134 lstrcatA(cwd
, "\\");
8136 lstrcpyA(subsrc
, cwd
);
8137 lstrcatA(subsrc
, "subsource");
8138 lstrcatA(subsrc
, "\\");
8140 lstrcpyA(sub2
, subsrc
);
8141 lstrcatA(sub2
, "sub2");
8142 lstrcatA(sub2
, "\\");
8144 /* uncompressed source */
8146 hdb
= create_package_db();
8147 ok( hdb
, "failed to create database\n");
8149 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
8151 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
8152 ok(r
== S_OK
, "failed\n");
8154 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
8155 ok(r
== S_OK
, "failed\n");
8157 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
8158 ok(r
== S_OK
, "failed\n");
8160 r
= MsiDatabaseCommit(hdb
);
8161 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
8163 hpkg
= package_from_db(hdb
);
8164 ok(hpkg
, "failed to create package\n");
8166 MsiCloseHandle(hdb
);
8168 /* invalid database handle */
8170 lstrcpyA(path
, "kiwi");
8171 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
8172 ok(r
== ERROR_INVALID_HANDLE
,
8173 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
8174 ok(!lstrcmpA(path
, "kiwi"),
8175 "Expected path to be unchanged, got \"%s\"\n", path
);
8176 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8180 lstrcpyA(path
, "kiwi");
8181 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
8182 ok(r
== ERROR_INVALID_PARAMETER
,
8183 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
8184 ok(!lstrcmpA(path
, "kiwi"),
8185 "Expected path to be unchanged, got \"%s\"\n", path
);
8186 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8188 /* empty szFolder */
8190 lstrcpyA(path
, "kiwi");
8191 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
8192 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8193 ok(!lstrcmpA(path
, "kiwi"),
8194 "Expected path to be unchanged, got \"%s\"\n", path
);
8195 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8199 lstrcpyA(path
, "kiwi");
8200 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
8201 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8202 ok(!lstrcmpA(path
, "kiwi"),
8203 "Expected path to be unchanged, got \"%s\"\n", path
);
8204 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8208 lstrcpyA(path
, "kiwi");
8209 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8210 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8211 ok(!lstrcmpA(path
, "kiwi"),
8212 "Expected path to be unchanged, got \"%s\"\n", path
);
8213 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8217 lstrcpyA(path
, "kiwi");
8218 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
8219 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8220 ok(!lstrcmpA(path
, "kiwi"),
8221 "Expected path to be unchanged, got \"%s\"\n", path
);
8222 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8224 /* source path does not exist, but the property exists */
8226 lstrcpyA(path
, "kiwi");
8227 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
8228 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8229 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8230 ok(size
== 0, "Expected 0, got %d\n", size
);
8234 lstrcpyA(path
, "kiwi");
8235 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8236 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8237 ok(!lstrcmpA(path
, "kiwi"),
8238 "Expected path to be unchanged, got \"%s\"\n", path
);
8239 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8243 lstrcpyA(path
, "kiwi");
8244 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8245 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8246 ok(!lstrcmpA(path
, "kiwi"),
8247 "Expected path to be unchanged, got \"%s\"\n", path
);
8248 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8250 r
= MsiDoAction(hpkg
, "CostInitialize");
8251 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
8253 /* try TARGETDIR after CostInitialize */
8255 lstrcpyA(path
, "kiwi");
8256 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
8257 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8258 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8259 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8261 /* try SourceDir after CostInitialize */
8263 lstrcpyA(path
, "kiwi");
8264 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8265 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8266 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8267 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8269 /* try SOURCEDIR after CostInitialize */
8271 lstrcpyA(path
, "kiwi");
8272 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
8273 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8274 ok(!lstrcmpA(path
, "kiwi"),
8275 "Expected path to be unchanged, got \"%s\"\n", path
);
8276 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8278 /* source path does not exist, but the property exists */
8280 lstrcpyA(path
, "kiwi");
8281 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
8282 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8285 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8286 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8289 /* try SubDir after CostInitialize */
8291 lstrcpyA(path
, "kiwi");
8292 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8293 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8294 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8295 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8297 /* try SubDir2 after CostInitialize */
8299 lstrcpyA(path
, "kiwi");
8300 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8301 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8302 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
8303 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
8305 r
= MsiDoAction(hpkg
, "ResolveSource");
8306 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8308 /* try TARGETDIR after ResolveSource */
8310 lstrcpyA(path
, "kiwi");
8311 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
8312 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8313 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8314 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8316 /* try SourceDir after ResolveSource */
8318 lstrcpyA(path
, "kiwi");
8319 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8321 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8322 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8324 /* try SOURCEDIR after ResolveSource */
8326 lstrcpyA(path
, "kiwi");
8327 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
8328 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8329 ok(!lstrcmpA(path
, "kiwi"),
8330 "Expected path to be unchanged, got \"%s\"\n", path
);
8331 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8333 /* source path does not exist, but the property exists */
8335 lstrcpyA(path
, "kiwi");
8336 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
8337 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8338 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8339 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8341 /* try SubDir after ResolveSource */
8343 lstrcpyA(path
, "kiwi");
8344 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8345 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8346 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8347 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8349 /* try SubDir2 after ResolveSource */
8351 lstrcpyA(path
, "kiwi");
8352 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8353 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8354 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
8355 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
8357 r
= MsiDoAction(hpkg
, "FileCost");
8358 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8360 /* try TARGETDIR after FileCost */
8362 lstrcpyA(path
, "kiwi");
8363 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
8364 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8365 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8366 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8368 /* try SourceDir after FileCost */
8370 lstrcpyA(path
, "kiwi");
8371 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8372 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8373 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8374 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8376 /* try SOURCEDIR after FileCost */
8378 lstrcpyA(path
, "kiwi");
8379 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
8380 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8381 ok(!lstrcmpA(path
, "kiwi"),
8382 "Expected path to be unchanged, got \"%s\"\n", path
);
8383 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8385 /* try SubDir after FileCost */
8387 lstrcpyA(path
, "kiwi");
8388 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8389 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8390 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8391 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8393 /* try SubDir2 after FileCost */
8395 lstrcpyA(path
, "kiwi");
8396 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8398 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
8399 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
8401 r
= MsiDoAction(hpkg
, "CostFinalize");
8402 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8404 /* try TARGETDIR after CostFinalize */
8406 lstrcpyA(path
, "kiwi");
8407 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
8408 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8409 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8410 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8412 /* try SourceDir after CostFinalize */
8414 lstrcpyA(path
, "kiwi");
8415 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8416 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8417 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8418 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8420 /* try SOURCEDIR after CostFinalize */
8422 lstrcpyA(path
, "kiwi");
8423 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
8424 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8425 ok(!lstrcmpA(path
, "kiwi"),
8426 "Expected path to be unchanged, got \"%s\"\n", path
);
8427 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8429 /* try SubDir after CostFinalize */
8431 lstrcpyA(path
, "kiwi");
8432 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8433 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8434 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8435 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8437 /* try SubDir2 after CostFinalize */
8439 lstrcpyA(path
, "kiwi");
8440 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8441 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8442 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
8443 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
8445 /* nonexistent directory */
8447 lstrcpyA(path
, "kiwi");
8448 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
8449 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
8450 ok(!lstrcmpA(path
, "kiwi"),
8451 "Expected path to be unchanged, got \"%s\"\n", path
);
8452 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
8454 /* NULL szPathBuf */
8456 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
8457 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8458 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8460 /* NULL pcchPathBuf */
8461 lstrcpyA(path
, "kiwi");
8462 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
8463 ok(r
== ERROR_INVALID_PARAMETER
,
8464 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
8465 ok(!lstrcmpA(path
, "kiwi"),
8466 "Expected path to be unchanged, got \"%s\"\n", path
);
8468 /* pcchPathBuf is 0 */
8470 lstrcpyA(path
, "kiwi");
8471 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8472 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
8473 ok(!lstrcmpA(path
, "kiwi"),
8474 "Expected path to be unchanged, got \"%s\"\n", path
);
8475 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8477 /* pcchPathBuf does not have room for NULL terminator */
8478 size
= lstrlenA(cwd
);
8479 lstrcpyA(path
, "kiwi");
8480 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8481 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
8482 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
8483 "Expected path with no backslash, got \"%s\"\n", path
);
8484 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8486 /* pcchPathBuf has room for NULL terminator */
8487 size
= lstrlenA(cwd
) + 1;
8488 lstrcpyA(path
, "kiwi");
8489 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8490 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8491 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8492 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8494 MsiCloseHandle(hpkg
);
8496 /* compressed source */
8498 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
8499 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8501 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
8503 hpkg
= package_from_db(hdb
);
8504 ok(hpkg
, "failed to create package\n");
8506 r
= MsiDoAction(hpkg
, "CostInitialize");
8507 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8508 r
= MsiDoAction(hpkg
, "FileCost");
8509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8510 r
= MsiDoAction(hpkg
, "CostFinalize");
8511 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8513 /* try TARGETDIR after CostFinalize */
8515 lstrcpyA(path
, "kiwi");
8516 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
8517 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8518 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8519 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8521 /* try SourceDir after CostFinalize */
8523 lstrcpyA(path
, "kiwi");
8524 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
8525 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8526 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8527 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8529 /* try SOURCEDIR after CostFinalize */
8531 lstrcpyA(path
, "kiwi");
8532 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
8535 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8536 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8537 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8540 /* try SubDir after CostFinalize */
8542 lstrcpyA(path
, "kiwi");
8543 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8544 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8545 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8546 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8548 /* try SubDir2 after CostFinalize */
8550 lstrcpyA(path
, "kiwi");
8551 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8552 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8553 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
8554 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
8556 MsiCloseHandle(hpkg
);
8557 DeleteFile(msifile
);
8560 static void test_shortlongsource(void)
8562 MSIHANDLE hdb
, hpkg
;
8563 CHAR path
[MAX_PATH
];
8565 CHAR subsrc
[MAX_PATH
];
8569 lstrcpyA(cwd
, CURR_DIR
);
8570 lstrcatA(cwd
, "\\");
8572 lstrcpyA(subsrc
, cwd
);
8573 lstrcatA(subsrc
, "long");
8574 lstrcatA(subsrc
, "\\");
8576 /* long file names */
8578 hdb
= create_package_db();
8579 ok( hdb
, "failed to create database\n");
8581 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
8583 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
8584 ok(r
== S_OK
, "failed\n");
8586 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
8587 ok(r
== S_OK
, "failed\n");
8589 /* CostInitialize:short */
8590 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
8591 ok(r
== S_OK
, "failed\n");
8593 /* CostInitialize:long */
8594 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
8595 ok(r
== S_OK
, "failed\n");
8597 /* FileCost:short */
8598 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
8599 ok(r
== S_OK
, "failed\n");
8602 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
8603 ok(r
== S_OK
, "failed\n");
8605 /* CostFinalize:short */
8606 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
8607 ok(r
== S_OK
, "failed\n");
8609 /* CostFinalize:long */
8610 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
8611 ok(r
== S_OK
, "failed\n");
8613 MsiDatabaseCommit(hdb
);
8615 hpkg
= package_from_db(hdb
);
8616 ok(hpkg
, "failed to create package\n");
8618 MsiCloseHandle(hdb
);
8620 CreateDirectoryA("one", NULL
);
8621 CreateDirectoryA("four", NULL
);
8623 r
= MsiDoAction(hpkg
, "CostInitialize");
8624 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8626 CreateDirectory("five", NULL
);
8627 CreateDirectory("eight", NULL
);
8629 r
= MsiDoAction(hpkg
, "FileCost");
8630 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8632 CreateDirectory("nine", NULL
);
8633 CreateDirectory("twelve", NULL
);
8635 r
= MsiDoAction(hpkg
, "CostFinalize");
8636 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8638 /* neither short nor long source directories exist */
8640 lstrcpyA(path
, "kiwi");
8641 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8642 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8643 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8644 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8646 CreateDirectoryA("short", NULL
);
8648 /* short source directory exists */
8650 lstrcpyA(path
, "kiwi");
8651 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8652 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8653 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8654 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8656 CreateDirectoryA("long", NULL
);
8658 /* both short and long source directories exist */
8660 lstrcpyA(path
, "kiwi");
8661 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8663 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8664 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8666 lstrcpyA(subsrc
, cwd
);
8667 lstrcatA(subsrc
, "two");
8668 lstrcatA(subsrc
, "\\");
8670 /* short dir exists before CostInitialize */
8672 lstrcpyA(path
, "kiwi");
8673 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8674 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8675 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8676 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8678 lstrcpyA(subsrc
, cwd
);
8679 lstrcatA(subsrc
, "four");
8680 lstrcatA(subsrc
, "\\");
8682 /* long dir exists before CostInitialize */
8684 lstrcpyA(path
, "kiwi");
8685 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
8686 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8687 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8688 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8690 lstrcpyA(subsrc
, cwd
);
8691 lstrcatA(subsrc
, "six");
8692 lstrcatA(subsrc
, "\\");
8694 /* short dir exists before FileCost */
8696 lstrcpyA(path
, "kiwi");
8697 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
8698 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8699 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8700 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8702 lstrcpyA(subsrc
, cwd
);
8703 lstrcatA(subsrc
, "eight");
8704 lstrcatA(subsrc
, "\\");
8706 /* long dir exists before FileCost */
8708 lstrcpyA(path
, "kiwi");
8709 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
8710 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8711 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8712 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8714 lstrcpyA(subsrc
, cwd
);
8715 lstrcatA(subsrc
, "ten");
8716 lstrcatA(subsrc
, "\\");
8718 /* short dir exists before CostFinalize */
8720 lstrcpyA(path
, "kiwi");
8721 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
8722 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8723 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8724 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8726 lstrcpyA(subsrc
, cwd
);
8727 lstrcatA(subsrc
, "twelve");
8728 lstrcatA(subsrc
, "\\");
8730 /* long dir exists before CostFinalize */
8732 lstrcpyA(path
, "kiwi");
8733 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
8734 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8735 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8736 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8738 MsiCloseHandle(hpkg
);
8739 RemoveDirectoryA("short");
8740 RemoveDirectoryA("long");
8741 RemoveDirectoryA("one");
8742 RemoveDirectoryA("four");
8743 RemoveDirectoryA("five");
8744 RemoveDirectoryA("eight");
8745 RemoveDirectoryA("nine");
8746 RemoveDirectoryA("twelve");
8748 /* short file names */
8750 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
8751 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8753 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
8755 hpkg
= package_from_db(hdb
);
8756 ok(hpkg
, "failed to create package\n");
8758 MsiCloseHandle(hdb
);
8760 CreateDirectoryA("one", NULL
);
8761 CreateDirectoryA("four", NULL
);
8763 r
= MsiDoAction(hpkg
, "CostInitialize");
8764 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8766 CreateDirectory("five", NULL
);
8767 CreateDirectory("eight", NULL
);
8769 r
= MsiDoAction(hpkg
, "FileCost");
8770 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8772 CreateDirectory("nine", NULL
);
8773 CreateDirectory("twelve", NULL
);
8775 r
= MsiDoAction(hpkg
, "CostFinalize");
8776 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8778 lstrcpyA(subsrc
, cwd
);
8779 lstrcatA(subsrc
, "short");
8780 lstrcatA(subsrc
, "\\");
8782 /* neither short nor long source directories exist */
8784 lstrcpyA(path
, "kiwi");
8785 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8787 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8788 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8790 CreateDirectoryA("short", NULL
);
8792 /* short source directory exists */
8794 lstrcpyA(path
, "kiwi");
8795 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8796 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8797 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8798 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8800 CreateDirectoryA("long", NULL
);
8802 /* both short and long source directories exist */
8804 lstrcpyA(path
, "kiwi");
8805 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
8806 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8807 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8808 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8810 lstrcpyA(subsrc
, cwd
);
8811 lstrcatA(subsrc
, "one");
8812 lstrcatA(subsrc
, "\\");
8814 /* short dir exists before CostInitialize */
8816 lstrcpyA(path
, "kiwi");
8817 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
8818 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8819 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8820 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8822 lstrcpyA(subsrc
, cwd
);
8823 lstrcatA(subsrc
, "three");
8824 lstrcatA(subsrc
, "\\");
8826 /* long dir exists before CostInitialize */
8828 lstrcpyA(path
, "kiwi");
8829 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
8830 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8831 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8832 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8834 lstrcpyA(subsrc
, cwd
);
8835 lstrcatA(subsrc
, "five");
8836 lstrcatA(subsrc
, "\\");
8838 /* short dir exists before FileCost */
8840 lstrcpyA(path
, "kiwi");
8841 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
8842 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8843 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8844 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8846 lstrcpyA(subsrc
, cwd
);
8847 lstrcatA(subsrc
, "seven");
8848 lstrcatA(subsrc
, "\\");
8850 /* long dir exists before FileCost */
8852 lstrcpyA(path
, "kiwi");
8853 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
8854 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8855 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8856 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8858 lstrcpyA(subsrc
, cwd
);
8859 lstrcatA(subsrc
, "nine");
8860 lstrcatA(subsrc
, "\\");
8862 /* short dir exists before CostFinalize */
8864 lstrcpyA(path
, "kiwi");
8865 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
8866 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8867 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8868 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8870 lstrcpyA(subsrc
, cwd
);
8871 lstrcatA(subsrc
, "eleven");
8872 lstrcatA(subsrc
, "\\");
8874 /* long dir exists before CostFinalize */
8876 lstrcpyA(path
, "kiwi");
8877 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
8878 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8879 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
8880 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
8882 MsiCloseHandle(hpkg
);
8883 RemoveDirectoryA("short");
8884 RemoveDirectoryA("long");
8885 RemoveDirectoryA("one");
8886 RemoveDirectoryA("four");
8887 RemoveDirectoryA("five");
8888 RemoveDirectoryA("eight");
8889 RemoveDirectoryA("nine");
8890 RemoveDirectoryA("twelve");
8891 DeleteFileA(msifile
);
8894 static void test_sourcedir(void)
8896 MSIHANDLE hdb
, hpkg
;
8898 CHAR path
[MAX_PATH
];
8900 CHAR subsrc
[MAX_PATH
];
8904 lstrcpyA(cwd
, CURR_DIR
);
8905 lstrcatA(cwd
, "\\");
8907 lstrcpyA(subsrc
, cwd
);
8908 lstrcatA(subsrc
, "long");
8909 lstrcatA(subsrc
, "\\");
8911 hdb
= create_package_db();
8912 ok( hdb
, "failed to create database\n");
8914 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
8915 ok(r
== S_OK
, "failed\n");
8917 sprintf(package
, "#%li", hdb
);
8918 r
= MsiOpenPackage(package
, &hpkg
);
8919 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8921 /* properties only */
8923 /* SourceDir prop */
8925 lstrcpyA(path
, "kiwi");
8926 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
8927 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8928 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8929 ok(size
== 0, "Expected 0, got %d\n", size
);
8931 /* SOURCEDIR prop */
8933 lstrcpyA(path
, "kiwi");
8934 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
8935 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8936 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8937 ok(size
== 0, "Expected 0, got %d\n", size
);
8939 r
= MsiDoAction(hpkg
, "CostInitialize");
8940 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8942 /* SourceDir after CostInitialize */
8944 lstrcpyA(path
, "kiwi");
8945 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
8946 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8947 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8948 ok(size
== 0, "Expected 0, got %d\n", size
);
8950 /* SOURCEDIR after CostInitialize */
8952 lstrcpyA(path
, "kiwi");
8953 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
8954 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8955 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8956 ok(size
== 0, "Expected 0, got %d\n", size
);
8958 r
= MsiDoAction(hpkg
, "FileCost");
8959 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8961 /* SourceDir after FileCost */
8963 lstrcpyA(path
, "kiwi");
8964 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
8965 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8966 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8967 ok(size
== 0, "Expected 0, got %d\n", size
);
8969 /* SOURCEDIR after FileCost */
8971 lstrcpyA(path
, "kiwi");
8972 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
8973 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8974 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8975 ok(size
== 0, "Expected 0, got %d\n", size
);
8977 r
= MsiDoAction(hpkg
, "CostFinalize");
8978 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8980 /* SourceDir after CostFinalize */
8982 lstrcpyA(path
, "kiwi");
8983 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
8984 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8985 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8986 ok(size
== 0, "Expected 0, got %d\n", size
);
8988 /* SOURCEDIR after CostFinalize */
8990 lstrcpyA(path
, "kiwi");
8991 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
8992 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8993 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
8994 ok(size
== 0, "Expected 0, got %d\n", size
);
8996 r
= MsiDoAction(hpkg
, "ResolveSource");
8997 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
8999 /* SourceDir after ResolveSource */
9001 lstrcpyA(path
, "kiwi");
9002 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9003 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9004 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9005 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9007 /* SOURCEDIR after ResolveSource */
9009 lstrcpyA(path
, "kiwi");
9010 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9011 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9012 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9013 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9017 lstrcpyA(path
, "kiwi");
9018 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
9019 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9020 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9021 ok(size
== 0, "Expected 0, got %d\n", size
);
9023 MsiCloseHandle(hpkg
);
9025 /* reset the package state */
9026 sprintf(package
, "#%li", hdb
);
9027 r
= MsiOpenPackage(package
, &hpkg
);
9028 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9030 /* test how MsiGetSourcePath affects the properties */
9032 /* SourceDir prop */
9034 lstrcpyA(path
, "kiwi");
9035 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9036 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9039 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9040 ok(size
== 0, "Expected 0, got %d\n", size
);
9044 lstrcpyA(path
, "kiwi");
9045 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9046 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9047 ok(!lstrcmpA(path
, "kiwi"),
9048 "Expected path to be unchanged, got \"%s\"\n", path
);
9049 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9051 /* SourceDir after MsiGetSourcePath */
9053 lstrcpyA(path
, "kiwi");
9054 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9055 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9058 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9059 ok(size
== 0, "Expected 0, got %d\n", size
);
9062 /* SOURCEDIR prop */
9064 lstrcpyA(path
, "kiwi");
9065 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9069 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9070 ok(size
== 0, "Expected 0, got %d\n", size
);
9074 lstrcpyA(path
, "kiwi");
9075 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9076 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9077 ok(!lstrcmpA(path
, "kiwi"),
9078 "Expected path to be unchanged, got \"%s\"\n", path
);
9079 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9081 /* SOURCEDIR prop after MsiGetSourcePath */
9083 lstrcpyA(path
, "kiwi");
9084 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9085 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9088 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9089 ok(size
== 0, "Expected 0, got %d\n", size
);
9092 r
= MsiDoAction(hpkg
, "CostInitialize");
9093 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9095 /* SourceDir after CostInitialize */
9097 lstrcpyA(path
, "kiwi");
9098 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9099 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9102 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9103 ok(size
== 0, "Expected 0, got %d\n", size
);
9107 lstrcpyA(path
, "kiwi");
9108 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9109 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9110 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9111 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9113 /* SourceDir after MsiGetSourcePath */
9115 lstrcpyA(path
, "kiwi");
9116 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9117 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9118 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9119 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9121 /* SOURCEDIR after CostInitialize */
9123 lstrcpyA(path
, "kiwi");
9124 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9125 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9126 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9127 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9129 /* SOURCEDIR source path still does not exist */
9131 lstrcpyA(path
, "kiwi");
9132 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9133 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9134 ok(!lstrcmpA(path
, "kiwi"),
9135 "Expected path to be unchanged, got \"%s\"\n", path
);
9136 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9138 r
= MsiDoAction(hpkg
, "FileCost");
9139 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9141 /* SourceDir after FileCost */
9143 lstrcpyA(path
, "kiwi");
9144 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9145 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9146 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9147 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9149 /* SOURCEDIR after FileCost */
9151 lstrcpyA(path
, "kiwi");
9152 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9153 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9154 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9155 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9157 /* SOURCEDIR source path still does not exist */
9159 lstrcpyA(path
, "kiwi");
9160 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9161 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9162 ok(!lstrcmpA(path
, "kiwi"),
9163 "Expected path to be unchanged, got \"%s\"\n", path
);
9164 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9166 r
= MsiDoAction(hpkg
, "CostFinalize");
9167 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9169 /* SourceDir after CostFinalize */
9171 lstrcpyA(path
, "kiwi");
9172 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9173 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9174 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9175 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9177 /* SOURCEDIR after CostFinalize */
9179 lstrcpyA(path
, "kiwi");
9180 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9181 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9182 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9183 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9185 /* SOURCEDIR source path still does not exist */
9187 lstrcpyA(path
, "kiwi");
9188 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9189 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9190 ok(!lstrcmpA(path
, "kiwi"),
9191 "Expected path to be unchanged, got \"%s\"\n", path
);
9192 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9194 r
= MsiDoAction(hpkg
, "ResolveSource");
9195 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9197 /* SourceDir after ResolveSource */
9199 lstrcpyA(path
, "kiwi");
9200 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
9201 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9202 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9203 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9205 /* SOURCEDIR after ResolveSource */
9207 lstrcpyA(path
, "kiwi");
9208 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9209 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9210 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9211 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9213 /* SOURCEDIR source path still does not exist */
9215 lstrcpyA(path
, "kiwi");
9216 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9217 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9218 ok(!lstrcmpA(path
, "kiwi"),
9219 "Expected path to be unchanged, got \"%s\"\n", path
);
9220 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9222 MsiCloseHandle(hdb
);
9223 MsiCloseHandle(hpkg
);
9224 DeleteFileA(msifile
);
9234 static const struct access_res create
[16] =
9236 { TRUE
, ERROR_SUCCESS
, TRUE
},
9237 { TRUE
, ERROR_SUCCESS
, TRUE
},
9238 { TRUE
, ERROR_SUCCESS
, FALSE
},
9239 { TRUE
, ERROR_SUCCESS
, FALSE
},
9240 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9241 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9242 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9243 { TRUE
, ERROR_SUCCESS
, FALSE
},
9244 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9245 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9246 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9247 { TRUE
, ERROR_SUCCESS
, TRUE
},
9248 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9249 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9250 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9251 { TRUE
, ERROR_SUCCESS
, TRUE
}
9254 static const struct access_res create_commit
[16] =
9256 { TRUE
, ERROR_SUCCESS
, TRUE
},
9257 { TRUE
, ERROR_SUCCESS
, TRUE
},
9258 { TRUE
, ERROR_SUCCESS
, FALSE
},
9259 { TRUE
, ERROR_SUCCESS
, FALSE
},
9260 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9261 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9262 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9263 { TRUE
, ERROR_SUCCESS
, FALSE
},
9264 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9265 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9266 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9267 { TRUE
, ERROR_SUCCESS
, TRUE
},
9268 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9269 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9270 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
9271 { TRUE
, ERROR_SUCCESS
, TRUE
}
9274 static const struct access_res create_close
[16] =
9276 { TRUE
, ERROR_SUCCESS
, FALSE
},
9277 { TRUE
, ERROR_SUCCESS
, FALSE
},
9278 { TRUE
, ERROR_SUCCESS
, FALSE
},
9279 { TRUE
, ERROR_SUCCESS
, FALSE
},
9280 { TRUE
, ERROR_SUCCESS
, FALSE
},
9281 { TRUE
, ERROR_SUCCESS
, FALSE
},
9282 { TRUE
, ERROR_SUCCESS
, FALSE
},
9283 { TRUE
, ERROR_SUCCESS
, FALSE
},
9284 { TRUE
, ERROR_SUCCESS
, FALSE
},
9285 { TRUE
, ERROR_SUCCESS
, FALSE
},
9286 { TRUE
, ERROR_SUCCESS
, FALSE
},
9287 { TRUE
, ERROR_SUCCESS
, FALSE
},
9288 { TRUE
, ERROR_SUCCESS
, FALSE
},
9289 { TRUE
, ERROR_SUCCESS
, FALSE
},
9290 { TRUE
, ERROR_SUCCESS
, FALSE
},
9291 { TRUE
, ERROR_SUCCESS
}
9294 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
9296 DWORD access
= 0, share
= 0;
9301 for (i
= 0; i
< 4; i
++)
9303 if (i
== 0) access
= 0;
9304 if (i
== 1) access
= GENERIC_READ
;
9305 if (i
== 2) access
= GENERIC_WRITE
;
9306 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
9308 for (j
= 0; j
< 4; j
++)
9310 if (ares
[idx
].ignore
)
9313 if (j
== 0) share
= 0;
9314 if (j
== 1) share
= FILE_SHARE_READ
;
9315 if (j
== 2) share
= FILE_SHARE_WRITE
;
9316 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
9318 SetLastError(0xdeadbeef);
9319 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
9320 FILE_ATTRIBUTE_NORMAL
, 0);
9321 lasterr
= GetLastError();
9323 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
9324 "(%d, handle, %d): Expected %d, got %d\n",
9325 line
, idx
, ares
[idx
].gothandle
,
9326 (hfile
!= INVALID_HANDLE_VALUE
));
9328 ok(lasterr
== ares
[idx
].lasterr
||
9329 lasterr
== 0xdeadbeef, /* win9x */
9330 "(%d, lasterr, %d): Expected %d, got %d\n",
9331 line
, idx
, ares
[idx
].lasterr
, lasterr
);
9339 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
9341 static void test_access(void)
9346 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
9347 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9349 test_file_access(msifile
, create
);
9351 r
= MsiDatabaseCommit(hdb
);
9352 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9354 test_file_access(msifile
, create_commit
);
9356 MsiCloseHandle(hdb
);
9358 test_file_access(msifile
, create_close
);
9360 DeleteFileA(msifile
);
9362 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
9363 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9365 test_file_access(msifile
, create
);
9367 r
= MsiDatabaseCommit(hdb
);
9368 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9370 test_file_access(msifile
, create_commit
);
9372 MsiCloseHandle(hdb
);
9374 test_file_access(msifile
, create_close
);
9376 DeleteFileA(msifile
);
9379 static void test_emptypackage(void)
9381 MSIHANDLE hpkg
, hdb
, hsuminfo
;
9382 MSIHANDLE hview
, hrec
;
9383 MSICONDITION condition
;
9384 CHAR buffer
[MAX_PATH
];
9388 r
= MsiOpenPackageA("", &hpkg
);
9391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9394 hdb
= MsiGetActiveDatabase(hpkg
);
9397 ok(hdb
!= 0, "Expected a valid database handle\n");
9400 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Tables`", &hview
);
9403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9405 r
= MsiViewExecute(hview
, 0);
9408 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9411 r
= MsiViewFetch(hview
, &hrec
);
9414 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9418 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
9421 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9422 ok(!lstrcmpA(buffer
, "_Property"),
9423 "Expected \"_Property\", got \"%s\"\n", buffer
);
9426 MsiCloseHandle(hrec
);
9428 r
= MsiViewFetch(hview
, &hrec
);
9431 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9435 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
9438 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9439 ok(!lstrcmpA(buffer
, "#_FolderCache"),
9440 "Expected \"_Property\", got \"%s\"\n", buffer
);
9443 MsiCloseHandle(hrec
);
9444 MsiViewClose(hview
);
9445 MsiCloseHandle(hview
);
9447 condition
= MsiDatabaseIsTablePersistentA(hdb
, "_Property");
9450 ok(condition
== MSICONDITION_FALSE
,
9451 "Expected MSICONDITION_FALSE, got %d\n", condition
);
9454 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
9457 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9459 r
= MsiViewExecute(hview
, 0);
9462 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9465 /* _Property table is not empty */
9466 r
= MsiViewFetch(hview
, &hrec
);
9469 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9472 MsiCloseHandle(hrec
);
9473 MsiViewClose(hview
);
9474 MsiCloseHandle(hview
);
9476 condition
= MsiDatabaseIsTablePersistentA(hdb
, "#_FolderCache");
9479 ok(condition
== MSICONDITION_FALSE
,
9480 "Expected MSICONDITION_FALSE, got %d\n", condition
);
9483 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `#_FolderCache`", &hview
);
9486 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9488 r
= MsiViewExecute(hview
, 0);
9491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9494 /* #_FolderCache is not empty */
9495 r
= MsiViewFetch(hview
, &hrec
);
9498 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9501 MsiCloseHandle(hrec
);
9502 MsiViewClose(hview
);
9503 MsiCloseHandle(hview
);
9505 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Streams`", &hview
);
9508 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
9509 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
9512 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Storages`", &hview
);
9515 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
9516 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
9519 r
= MsiGetSummaryInformationA(hdb
, NULL
, 0, &hsuminfo
);
9522 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
9523 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
9526 MsiCloseHandle(hsuminfo
);
9528 r
= MsiDatabaseCommit(hdb
);
9531 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9534 MsiCloseHandle(hdb
);
9535 MsiCloseHandle(hpkg
);
9540 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
9542 test_createpackage();
9544 test_gettargetpath_bad();
9545 test_settargetpath();
9547 test_property_table();
9550 test_formatrecord2();
9555 test_appsearch_complocator();
9556 test_appsearch_reglocator();
9557 test_appsearch_inilocator();
9558 test_appsearch_drlocator();
9559 test_featureparents();
9560 test_installprops();
9561 test_launchconditions();
9564 test_MsiGetSourcePath();
9565 test_shortlongsource();
9568 test_emptypackage();