2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <srrestoreptapi.h>
31 #include "wine/test.h"
33 static const char msifile
[] = "winetest-package.msi";
34 char CURR_DIR
[MAX_PATH
];
36 static UINT (WINAPI
*pMsiApplyMultiplePatchesA
)(LPCSTR
, LPCSTR
, LPCSTR
);
38 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
39 static BOOL (WINAPI
*pGetTokenInformation
)( HANDLE
, TOKEN_INFORMATION_CLASS
, LPVOID
, DWORD
, PDWORD
);
40 static BOOL (WINAPI
*pOpenProcessToken
)( HANDLE
, DWORD
, PHANDLE
);
41 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
42 static LONG (WINAPI
*pRegDeleteKeyExW
)(HKEY
, LPCWSTR
, REGSAM
, DWORD
);
43 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
45 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
46 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
48 static void init_functionpointers(void)
50 HMODULE hmsi
= GetModuleHandleA("msi.dll");
51 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
52 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
55 #define GET_PROC(mod, func) \
56 p ## func = (void*)GetProcAddress(mod, #func);
58 GET_PROC(hmsi
, MsiApplyMultiplePatchesA
);
60 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
61 GET_PROC(hadvapi32
, GetTokenInformation
);
62 GET_PROC(hadvapi32
, OpenProcessToken
);
63 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
64 GET_PROC(hadvapi32
, RegDeleteKeyExW
)
65 GET_PROC(hkernel32
, IsWow64Process
)
67 hsrclient
= LoadLibraryA("srclient.dll");
68 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
69 GET_PROC(hsrclient
, SRSetRestorePointA
);
73 static BOOL
is_process_limited(void)
77 if (!pOpenProcessToken
|| !pGetTokenInformation
) return FALSE
;
79 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
82 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
85 ret
= pGetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
87 return (ret
&& type
== TokenElevationTypeLimited
);
92 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
95 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
96 return RegDeleteKeyA( key
, subkey
);
99 static LPSTR
get_user_sid(LPSTR
*usersid
)
106 if (!pConvertSidToStringSidA
)
108 win_skip("ConvertSidToStringSidA is not available\n");
113 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
115 GetTokenInformation(token
, TokenUser
, buf
, size
, &size
);
116 user
= (PTOKEN_USER
)buf
;
117 pConvertSidToStringSidA(user
->User
.Sid
, usersid
);
118 ok(*usersid
!= NULL
, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
123 /* RegDeleteTreeW from dlls/advapi32/registry.c */
124 static LSTATUS
package_RegDeleteTreeW(HKEY hKey
, LPCWSTR lpszSubKey
, REGSAM access
)
127 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
128 DWORD dwMaxLen
, dwSize
;
129 WCHAR szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
134 ret
= RegOpenKeyExW(hKey
, lpszSubKey
, 0, access
, &hSubKey
);
138 ret
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, NULL
,
139 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
140 if (ret
) goto cleanup
;
144 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
145 if (dwMaxLen
> sizeof(szNameBuf
)/sizeof(WCHAR
))
147 /* Name too big: alloc a buffer for it */
148 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
*sizeof(WCHAR
))))
150 ret
= ERROR_NOT_ENOUGH_MEMORY
;
155 /* Recursively delete all the subkeys */
159 if (RegEnumKeyExW(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
160 NULL
, NULL
, NULL
)) break;
162 ret
= package_RegDeleteTreeW(hSubKey
, lpszName
, access
);
163 if (ret
) goto cleanup
;
168 if (pRegDeleteKeyExW
)
169 ret
= pRegDeleteKeyExW(hKey
, lpszSubKey
, access
, 0);
171 ret
= RegDeleteKeyW(hKey
, lpszSubKey
);
177 if (RegEnumValueW(hKey
, 0, lpszName
, &dwSize
,
178 NULL
, NULL
, NULL
, NULL
)) break;
180 ret
= RegDeleteValueW(hKey
, lpszName
);
181 if (ret
) goto cleanup
;
185 if (lpszName
!= szNameBuf
)
186 HeapFree(GetProcessHeap(), 0, lpszName
);
188 RegCloseKey(hSubKey
);
192 static BOOL
squash_guid(LPCWSTR in
, LPWSTR out
)
197 if (FAILED(CLSIDFromString((LPCOLESTR
)in
, &guid
)))
211 out
[17+i
*2] = in
[n
++];
212 out
[16+i
*2] = in
[n
++];
217 out
[17+i
*2] = in
[n
++];
218 out
[16+i
*2] = in
[n
++];
224 static void create_test_guid(LPSTR prodcode
, LPSTR squashed
)
226 WCHAR guidW
[MAX_PATH
];
227 WCHAR squashedW
[MAX_PATH
];
232 hr
= CoCreateGuid(&guid
);
233 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
235 size
= StringFromGUID2(&guid
, guidW
, MAX_PATH
);
236 ok(size
== 39, "Expected 39, got %d\n", hr
);
238 WideCharToMultiByte(CP_ACP
, 0, guidW
, size
, prodcode
, MAX_PATH
, NULL
, NULL
);
239 squash_guid(guidW
, squashedW
);
240 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
243 static void set_component_path(LPCSTR filename
, MSIINSTALLCONTEXT context
,
244 LPCSTR guid
, LPSTR usersid
, BOOL dir
)
246 WCHAR guidW
[MAX_PATH
];
247 WCHAR squashedW
[MAX_PATH
];
248 CHAR squashed
[MAX_PATH
];
249 CHAR comppath
[MAX_PATH
];
250 CHAR prodpath
[MAX_PATH
];
254 REGSAM access
= KEY_ALL_ACCESS
;
257 if (pIsWow64Process
&& pIsWow64Process(GetCurrentProcess(), &wow64
) && wow64
)
258 access
|= KEY_WOW64_64KEY
;
260 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
261 squash_guid(guidW
, squashedW
);
262 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
264 if (context
== MSIINSTALLCONTEXT_MACHINE
)
266 prod
= "3D0DAE300FACA1300AD792060BCDAA92";
268 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
269 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
271 "SOFTWARE\\Classes\\Installer\\"
272 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
274 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
276 prod
= "7D2F387510109040002000060BECB6AB";
278 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
279 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
281 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
282 "Installer\\%s\\Installer\\Products\\"
283 "7D2F387510109040002000060BECB6AB", usersid
);
285 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
287 prod
= "7D2F387510109040002000060BECB6AB";
289 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
290 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
292 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
293 "Installer\\Managed\\%s\\Installer\\Products\\"
294 "7D2F387510109040002000060BECB6AB", usersid
);
297 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, comppath
, 0, NULL
, 0, access
, NULL
, &hkey
, NULL
);
299 lstrcpyA(path
, CURR_DIR
);
300 lstrcatA(path
, "\\");
301 if (!dir
) lstrcatA(path
, filename
);
303 RegSetValueExA(hkey
, prod
, 0, REG_SZ
, (LPBYTE
)path
, lstrlenA(path
));
306 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, prodpath
, 0, NULL
, 0, access
, NULL
, &hkey
, NULL
);
310 static void delete_component_path(LPCSTR guid
, MSIINSTALLCONTEXT context
, LPSTR usersid
)
312 WCHAR guidW
[MAX_PATH
];
313 WCHAR squashedW
[MAX_PATH
];
314 WCHAR substrW
[MAX_PATH
];
315 CHAR squashed
[MAX_PATH
];
316 CHAR comppath
[MAX_PATH
];
317 CHAR prodpath
[MAX_PATH
];
318 REGSAM access
= KEY_ALL_ACCESS
;
321 if (pIsWow64Process
&& pIsWow64Process(GetCurrentProcess(), &wow64
) && wow64
)
322 access
|= KEY_WOW64_64KEY
;
324 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
325 squash_guid(guidW
, squashedW
);
326 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
328 if (context
== MSIINSTALLCONTEXT_MACHINE
)
331 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
332 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
334 "SOFTWARE\\Classes\\Installer\\"
335 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
337 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
340 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
341 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
343 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
344 "Installer\\%s\\Installer\\Products\\"
345 "7D2F387510109040002000060BECB6AB", usersid
);
347 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
350 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
351 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
353 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
354 "Installer\\Managed\\%s\\Installer\\Products\\"
355 "7D2F387510109040002000060BECB6AB", usersid
);
358 MultiByteToWideChar(CP_ACP
, 0, comppath
, -1, substrW
, MAX_PATH
);
359 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
, access
);
361 MultiByteToWideChar(CP_ACP
, 0, prodpath
, -1, substrW
, MAX_PATH
);
362 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
, access
);
365 static UINT
do_query(MSIHANDLE hdb
, const char *query
, MSIHANDLE
*phrec
)
370 /* open a select query */
371 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
372 if (r
!= ERROR_SUCCESS
)
374 r
= MsiViewExecute(hview
, 0);
375 if (r
!= ERROR_SUCCESS
)
377 ret
= MsiViewFetch(hview
, phrec
);
378 r
= MsiViewClose(hview
);
379 if (r
!= ERROR_SUCCESS
)
381 r
= MsiCloseHandle(hview
);
382 if (r
!= ERROR_SUCCESS
)
387 static UINT
run_query( MSIHANDLE hdb
, const char *query
)
392 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
393 if( r
!= ERROR_SUCCESS
)
396 r
= MsiViewExecute(hview
, 0);
397 if( r
== ERROR_SUCCESS
)
398 r
= MsiViewClose(hview
);
399 MsiCloseHandle(hview
);
403 static UINT
create_component_table( MSIHANDLE hdb
)
405 return run_query( hdb
,
406 "CREATE TABLE `Component` ( "
407 "`Component` CHAR(72) NOT NULL, "
408 "`ComponentId` CHAR(38), "
409 "`Directory_` CHAR(72) NOT NULL, "
410 "`Attributes` SHORT NOT NULL, "
411 "`Condition` CHAR(255), "
412 "`KeyPath` CHAR(72) "
413 "PRIMARY KEY `Component`)" );
416 static UINT
create_feature_table( MSIHANDLE hdb
)
418 return run_query( hdb
,
419 "CREATE TABLE `Feature` ( "
420 "`Feature` CHAR(38) NOT NULL, "
421 "`Feature_Parent` CHAR(38), "
423 "`Description` CHAR(255), "
424 "`Display` SHORT NOT NULL, "
425 "`Level` SHORT NOT NULL, "
426 "`Directory_` CHAR(72), "
427 "`Attributes` SHORT NOT NULL "
428 "PRIMARY KEY `Feature`)" );
431 static UINT
create_feature_components_table( MSIHANDLE hdb
)
433 return run_query( hdb
,
434 "CREATE TABLE `FeatureComponents` ( "
435 "`Feature_` CHAR(38) NOT NULL, "
436 "`Component_` CHAR(72) NOT NULL "
437 "PRIMARY KEY `Feature_`, `Component_` )" );
440 static UINT
create_file_table( MSIHANDLE hdb
)
442 return run_query( hdb
,
443 "CREATE TABLE `File` ("
444 "`File` CHAR(72) NOT NULL, "
445 "`Component_` CHAR(72) NOT NULL, "
446 "`FileName` CHAR(255) NOT NULL, "
447 "`FileSize` LONG NOT NULL, "
448 "`Version` CHAR(72), "
449 "`Language` CHAR(20), "
450 "`Attributes` SHORT, "
451 "`Sequence` SHORT NOT NULL "
452 "PRIMARY KEY `File`)" );
455 static UINT
create_remove_file_table( MSIHANDLE hdb
)
457 return run_query( hdb
,
458 "CREATE TABLE `RemoveFile` ("
459 "`FileKey` CHAR(72) NOT NULL, "
460 "`Component_` CHAR(72) NOT NULL, "
461 "`FileName` CHAR(255) LOCALIZABLE, "
462 "`DirProperty` CHAR(72) NOT NULL, "
463 "`InstallMode` SHORT NOT NULL "
464 "PRIMARY KEY `FileKey`)" );
467 static UINT
create_appsearch_table( MSIHANDLE hdb
)
469 return run_query( hdb
,
470 "CREATE TABLE `AppSearch` ("
471 "`Property` CHAR(72) NOT NULL, "
472 "`Signature_` CHAR(72) NOT NULL "
473 "PRIMARY KEY `Property`, `Signature_`)" );
476 static UINT
create_reglocator_table( MSIHANDLE hdb
)
478 return run_query( hdb
,
479 "CREATE TABLE `RegLocator` ("
480 "`Signature_` CHAR(72) NOT NULL, "
481 "`Root` SHORT NOT NULL, "
482 "`Key` CHAR(255) NOT NULL, "
485 "PRIMARY KEY `Signature_`)" );
488 static UINT
create_signature_table( MSIHANDLE hdb
)
490 return run_query( hdb
,
491 "CREATE TABLE `Signature` ("
492 "`Signature` CHAR(72) NOT NULL, "
493 "`FileName` CHAR(255) NOT NULL, "
494 "`MinVersion` CHAR(20), "
495 "`MaxVersion` CHAR(20), "
500 "`Languages` CHAR(255) "
501 "PRIMARY KEY `Signature`)" );
504 static UINT
create_launchcondition_table( MSIHANDLE hdb
)
506 return run_query( hdb
,
507 "CREATE TABLE `LaunchCondition` ("
508 "`Condition` CHAR(255) NOT NULL, "
509 "`Description` CHAR(255) NOT NULL "
510 "PRIMARY KEY `Condition`)" );
513 static UINT
create_property_table( MSIHANDLE hdb
)
515 return run_query( hdb
,
516 "CREATE TABLE `Property` ("
517 "`Property` CHAR(72) NOT NULL, "
519 "PRIMARY KEY `Property`)" );
522 static UINT
create_install_execute_sequence_table( MSIHANDLE hdb
)
524 return run_query( hdb
,
525 "CREATE TABLE `InstallExecuteSequence` ("
526 "`Action` CHAR(72) NOT NULL, "
527 "`Condition` CHAR(255), "
529 "PRIMARY KEY `Action`)" );
532 static UINT
create_media_table( MSIHANDLE hdb
)
534 return run_query( hdb
,
535 "CREATE TABLE `Media` ("
536 "`DiskId` SHORT NOT NULL, "
537 "`LastSequence` SHORT NOT NULL, "
538 "`DiskPrompt` CHAR(64), "
539 "`Cabinet` CHAR(255), "
540 "`VolumeLabel` CHAR(32), "
542 "PRIMARY KEY `DiskId`)" );
545 static UINT
create_ccpsearch_table( MSIHANDLE hdb
)
547 return run_query( hdb
,
548 "CREATE TABLE `CCPSearch` ("
549 "`Signature_` CHAR(72) NOT NULL "
550 "PRIMARY KEY `Signature_`)" );
553 static UINT
create_drlocator_table( MSIHANDLE hdb
)
555 return run_query( hdb
,
556 "CREATE TABLE `DrLocator` ("
557 "`Signature_` CHAR(72) NOT NULL, "
558 "`Parent` CHAR(72), "
561 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
564 static UINT
create_complocator_table( MSIHANDLE hdb
)
566 return run_query( hdb
,
567 "CREATE TABLE `CompLocator` ("
568 "`Signature_` CHAR(72) NOT NULL, "
569 "`ComponentId` CHAR(38) NOT NULL, "
571 "PRIMARY KEY `Signature_`)" );
574 static UINT
create_inilocator_table( MSIHANDLE hdb
)
576 return run_query( hdb
,
577 "CREATE TABLE `IniLocator` ("
578 "`Signature_` CHAR(72) NOT NULL, "
579 "`FileName` CHAR(255) NOT NULL, "
580 "`Section` CHAR(96)NOT NULL, "
581 "`Key` CHAR(128)NOT NULL, "
584 "PRIMARY KEY `Signature_`)" );
587 #define make_add_entry(type, qtext) \
588 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
590 char insert[] = qtext; \
593 sz = strlen(values) + sizeof insert; \
594 query = HeapAlloc(GetProcessHeap(),0,sz); \
595 sprintf(query,insert,values); \
596 r = run_query( hdb, query ); \
597 HeapFree(GetProcessHeap(), 0, query); \
601 make_add_entry(component
,
602 "INSERT INTO `Component` "
603 "(`Component`, `ComponentId`, `Directory_`, "
604 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
606 make_add_entry(directory
,
607 "INSERT INTO `Directory` "
608 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
610 make_add_entry(feature
,
611 "INSERT INTO `Feature` "
612 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
613 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
615 make_add_entry(feature_components
,
616 "INSERT INTO `FeatureComponents` "
617 "(`Feature_`, `Component_`) VALUES( %s )")
620 "INSERT INTO `File` "
621 "(`File`, `Component_`, `FileName`, `FileSize`, "
622 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
624 make_add_entry(appsearch
,
625 "INSERT INTO `AppSearch` "
626 "(`Property`, `Signature_`) VALUES( %s )")
628 make_add_entry(reglocator
,
629 "INSERT INTO `RegLocator` "
630 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
632 make_add_entry(signature
,
633 "INSERT INTO `Signature` "
634 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
635 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
638 make_add_entry(launchcondition
,
639 "INSERT INTO `LaunchCondition` "
640 "(`Condition`, `Description`) VALUES( %s )")
642 make_add_entry(property
,
643 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
645 make_add_entry(install_execute_sequence
,
646 "INSERT INTO `InstallExecuteSequence` "
647 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
649 make_add_entry(media
,
650 "INSERT INTO `Media` "
651 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
652 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
654 make_add_entry(ccpsearch
,
655 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
657 make_add_entry(drlocator
,
658 "INSERT INTO `DrLocator` "
659 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
661 make_add_entry(complocator
,
662 "INSERT INTO `CompLocator` "
663 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
665 make_add_entry(inilocator
,
666 "INSERT INTO `IniLocator` "
667 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
670 static UINT
set_summary_info(MSIHANDLE hdb
)
675 /* build summary info */
676 res
= MsiGetSummaryInformation(hdb
, NULL
, 7, &suminfo
);
677 ok( res
== ERROR_SUCCESS
, "Failed to open summaryinfo\n" );
679 res
= MsiSummaryInfoSetProperty(suminfo
,2, VT_LPSTR
, 0,NULL
,
680 "Installation Database");
681 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
683 res
= MsiSummaryInfoSetProperty(suminfo
,3, VT_LPSTR
, 0,NULL
,
684 "Installation Database");
685 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
687 res
= MsiSummaryInfoSetProperty(suminfo
,4, VT_LPSTR
, 0,NULL
,
689 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
691 res
= MsiSummaryInfoSetProperty(suminfo
,7, VT_LPSTR
, 0,NULL
,
693 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
695 res
= MsiSummaryInfoSetProperty(suminfo
,9, VT_LPSTR
, 0,NULL
,
696 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
697 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
699 res
= MsiSummaryInfoSetProperty(suminfo
, 14, VT_I4
, 100, NULL
, NULL
);
700 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
702 res
= MsiSummaryInfoSetProperty(suminfo
, 15, VT_I4
, 0, NULL
, NULL
);
703 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
705 res
= MsiSummaryInfoPersist(suminfo
);
706 ok( res
== ERROR_SUCCESS
, "Failed to make summary info persist\n" );
708 res
= MsiCloseHandle( suminfo
);
709 ok( res
== ERROR_SUCCESS
, "Failed to close suminfo\n" );
715 static MSIHANDLE
create_package_db(void)
722 /* create an empty database */
723 res
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
724 ok( res
== ERROR_SUCCESS
, "Failed to create database %u\n", res
);
725 if( res
!= ERROR_SUCCESS
)
728 res
= MsiDatabaseCommit( hdb
);
729 ok( res
== ERROR_SUCCESS
, "Failed to commit database\n" );
731 res
= set_summary_info(hdb
);
733 res
= run_query( hdb
,
734 "CREATE TABLE `Directory` ( "
735 "`Directory` CHAR(255) NOT NULL, "
736 "`Directory_Parent` CHAR(255), "
737 "`DefaultDir` CHAR(255) NOT NULL "
738 "PRIMARY KEY `Directory`)" );
739 ok( res
== ERROR_SUCCESS
, "Failed to create directory table\n" );
744 static UINT
package_from_db(MSIHANDLE hdb
, MSIHANDLE
*handle
)
750 sprintf(szPackage
, "#%u", hdb
);
751 res
= MsiOpenPackage(szPackage
, &hPackage
);
752 if (res
!= ERROR_SUCCESS
)
758 res
= MsiCloseHandle(hdb
);
759 if (res
!= ERROR_SUCCESS
)
761 MsiCloseHandle(hPackage
);
766 return ERROR_SUCCESS
;
769 static void create_test_file(const CHAR
*name
)
774 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
775 ok(file
!= INVALID_HANDLE_VALUE
, "Failure to open file %s\n", name
);
776 WriteFile(file
, name
, strlen(name
), &written
, NULL
);
777 WriteFile(file
, "\n", strlen("\n"), &written
, NULL
);
781 typedef struct _tagVS_VERSIONINFO
788 VS_FIXEDFILEINFO Value
;
793 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
794 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
796 static BOOL
create_file_with_version(const CHAR
*name
, LONG ms
, LONG ls
)
798 VS_VERSIONINFO
*pVerInfo
;
799 VS_FIXEDFILEINFO
*pFixedInfo
;
806 GetSystemDirectory(path
, MAX_PATH
);
807 /* Some dlls can't be updated on Vista/W2K8 */
808 lstrcatA(path
, "\\version.dll");
810 CopyFileA(path
, name
, FALSE
);
812 size
= GetFileVersionInfoSize(path
, &handle
);
813 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
815 GetFileVersionInfoA(path
, 0, size
, buffer
);
817 pVerInfo
= (VS_VERSIONINFO
*)buffer
;
818 ofs
= (BYTE
*)&pVerInfo
->szKey
[lstrlenW(pVerInfo
->szKey
) + 1];
819 pFixedInfo
= (VS_FIXEDFILEINFO
*)roundpos(pVerInfo
, ofs
, 4);
821 pFixedInfo
->dwFileVersionMS
= ms
;
822 pFixedInfo
->dwFileVersionLS
= ls
;
823 pFixedInfo
->dwProductVersionMS
= ms
;
824 pFixedInfo
->dwProductVersionLS
= ls
;
826 resource
= BeginUpdateResource(name
, FALSE
);
830 if (!UpdateResource(resource
, RT_VERSION
, MAKEINTRESOURCE(VS_VERSION_INFO
),
831 MAKELANGID(LANG_NEUTRAL
, SUBLANG_NEUTRAL
), buffer
, size
))
834 if (!EndUpdateResource(resource
, FALSE
))
840 HeapFree(GetProcessHeap(), 0, buffer
);
844 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
846 RESTOREPOINTINFOA spec
;
848 spec
.dwEventType
= event_type
;
849 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
850 spec
.llSequenceNumber
= status
->llSequenceNumber
;
851 lstrcpyA(spec
.szDescription
, "msitest restore point");
853 return pSRSetRestorePointA(&spec
, status
);
856 static void remove_restore_point(DWORD seq_number
)
860 res
= pSRRemoveRestorePoint(seq_number
);
861 if (res
!= ERROR_SUCCESS
)
862 trace("Failed to remove the restore point : %08x\n", res
);
865 static void test_createpackage(void)
867 MSIHANDLE hPackage
= 0;
870 res
= package_from_db(create_package_db(), &hPackage
);
871 if (res
== ERROR_INSTALL_PACKAGE_REJECTED
)
873 skip("Not enough rights to perform tests\n");
877 ok( res
== ERROR_SUCCESS
, " Failed to create package %u\n", res
);
879 res
= MsiCloseHandle( hPackage
);
880 ok( res
== ERROR_SUCCESS
, "Failed to close package\n" );
884 static void test_doaction( void )
889 r
= MsiDoAction( -1, NULL
);
890 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
892 r
= package_from_db(create_package_db(), &hpkg
);
893 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
895 skip("Not enough rights to perform tests\n");
899 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
901 r
= MsiDoAction(hpkg
, NULL
);
902 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
904 r
= MsiDoAction(0, "boo");
905 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
907 r
= MsiDoAction(hpkg
, "boo");
908 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "wrong return val\n");
910 MsiCloseHandle( hpkg
);
914 static void test_gettargetpath_bad(void)
916 static const WCHAR boo
[] = {'b','o','o',0};
917 static const WCHAR empty
[] = {0};
924 r
= package_from_db(create_package_db(), &hpkg
);
925 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
927 skip("Not enough rights to perform tests\n");
931 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
933 r
= MsiGetTargetPath( 0, NULL
, NULL
, NULL
);
934 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
936 r
= MsiGetTargetPath( 0, NULL
, NULL
, &sz
);
937 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
939 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
940 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
942 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
943 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
945 r
= MsiGetTargetPath( hpkg
, "boo", NULL
, NULL
);
946 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
948 r
= MsiGetTargetPath( hpkg
, "boo", buffer
, NULL
);
949 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
952 r
= MsiGetTargetPath( hpkg
, "", buffer
, &sz
);
953 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
955 r
= MsiGetTargetPathW( 0, NULL
, NULL
, NULL
);
956 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
958 r
= MsiGetTargetPathW( 0, NULL
, NULL
, &sz
);
959 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
961 r
= MsiGetTargetPathW( 0, boo
, NULL
, NULL
);
962 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
964 r
= MsiGetTargetPathW( 0, boo
, NULL
, NULL
);
965 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
967 r
= MsiGetTargetPathW( hpkg
, boo
, NULL
, NULL
);
968 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
970 r
= MsiGetTargetPathW( hpkg
, boo
, bufferW
, NULL
);
971 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
974 r
= MsiGetTargetPathW( hpkg
, empty
, bufferW
, &sz
);
975 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
977 MsiCloseHandle( hpkg
);
981 static void query_file_path(MSIHANDLE hpkg
, LPCSTR file
, LPSTR buff
)
987 rec
= MsiCreateRecord( 1 );
988 ok(rec
, "MsiCreate record failed\n");
990 r
= MsiRecordSetString( rec
, 0, file
);
991 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
994 r
= MsiFormatRecord( hpkg
, rec
, buff
, &size
);
995 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
997 MsiCloseHandle( rec
);
1000 static void test_settargetpath(void)
1002 char tempdir
[MAX_PATH
+8], buffer
[MAX_PATH
], file
[MAX_PATH
];
1008 hdb
= create_package_db();
1009 ok ( hdb
, "failed to create package database\n" );
1011 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
1012 ok( r
== S_OK
, "failed to add directory entry: %d\n" , r
);
1014 r
= create_component_table( hdb
);
1015 ok( r
== S_OK
, "cannot create Component table: %d\n", r
);
1017 r
= add_component_entry( hdb
, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1018 ok( r
== S_OK
, "cannot add dummy component: %d\n", r
);
1020 r
= add_component_entry( hdb
, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1021 ok( r
== S_OK
, "cannot add test component: %d\n", r
);
1023 r
= create_feature_table( hdb
);
1024 ok( r
== S_OK
, "cannot create Feature table: %d\n", r
);
1026 r
= add_feature_entry( hdb
, "'TestFeature', '', '', '', 0, 1, '', 0" );
1027 ok( r
== ERROR_SUCCESS
, "cannot add TestFeature to Feature table: %d\n", r
);
1029 r
= create_feature_components_table( hdb
);
1030 ok( r
== S_OK
, "cannot create FeatureComponents table: %d\n", r
);
1032 r
= add_feature_components_entry( hdb
, "'TestFeature', 'RootComp'" );
1033 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
1035 r
= add_feature_components_entry( hdb
, "'TestFeature', 'TestComp'" );
1036 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
1038 add_directory_entry( hdb
, "'TestParent', 'TARGETDIR', 'TestParent'" );
1039 add_directory_entry( hdb
, "'TestDir', 'TestParent', 'TestDir'" );
1041 r
= create_file_table( hdb
);
1042 ok( r
== S_OK
, "cannot create File table: %d\n", r
);
1044 r
= add_file_entry( hdb
, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1045 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
1047 r
= add_file_entry( hdb
, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1048 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
1050 r
= package_from_db( hdb
, &hpkg
);
1051 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
1053 skip("Not enough rights to perform tests\n");
1054 DeleteFile(msifile
);
1057 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
1059 r
= MsiDoAction( hpkg
, "CostInitialize");
1060 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
1062 r
= MsiDoAction( hpkg
, "FileCost");
1063 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
1065 r
= MsiDoAction( hpkg
, "CostFinalize");
1066 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
1068 r
= MsiSetTargetPath( 0, NULL
, NULL
);
1069 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1071 r
= MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1072 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1074 r
= MsiSetTargetPath( hpkg
, "boo", NULL
);
1075 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1077 r
= MsiSetTargetPath( hpkg
, "boo", "c:\\bogusx" );
1078 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
1080 sz
= sizeof tempdir
- 1;
1081 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", tempdir
, &sz
);
1082 sprintf( file
, "%srootfile.txt", tempdir
);
1084 query_file_path( hpkg
, "[#RootFile]", buffer
);
1085 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1086 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
1088 GetTempFileName( tempdir
, "_wt", 0, buffer
);
1089 sprintf( tempdir
, "%s\\subdir", buffer
);
1091 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
1092 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
1093 "MsiSetTargetPath on file returned %d\n", r
);
1095 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
1096 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
1097 "MsiSetTargetPath on 'subdir' of file returned %d\n", r
);
1099 DeleteFile( buffer
);
1101 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
1102 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1104 r
= GetFileAttributes( buffer
);
1105 ok ( r
== INVALID_FILE_ATTRIBUTES
, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r
);
1107 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
1108 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath on subsubdir returned %d\n", r
);
1110 sz
= sizeof buffer
- 1;
1111 lstrcat( tempdir
, "\\" );
1112 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", buffer
, &sz
);
1113 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1114 ok( !lstrcmp(buffer
, tempdir
), "Expected %s, got %s\n", tempdir
, buffer
);
1116 sprintf( file
, "%srootfile.txt", tempdir
);
1117 query_file_path( hpkg
, "[#RootFile]", buffer
);
1118 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
1120 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two" );
1121 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1123 query_file_path( hpkg
, "[#TestFile]", buffer
);
1124 ok( !lstrcmpi(buffer
, "C:\\one\\two\\TestDir\\testfile.txt"),
1125 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer
);
1127 sz
= sizeof buffer
- 1;
1128 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
1129 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1130 ok( !lstrcmpi(buffer
, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer
);
1132 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two\\three" );
1133 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1135 sz
= sizeof buffer
- 1;
1136 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
1137 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1138 ok( !lstrcmpi(buffer
, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer
);
1140 MsiCloseHandle( hpkg
);
1143 static void test_condition(void)
1148 r
= package_from_db(create_package_db(), &hpkg
);
1149 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
1151 skip("Not enough rights to perform tests\n");
1152 DeleteFile(msifile
);
1155 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
1157 r
= MsiEvaluateCondition(0, NULL
);
1158 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1160 r
= MsiEvaluateCondition(hpkg
, NULL
);
1161 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1163 r
= MsiEvaluateCondition(hpkg
, "");
1164 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1166 r
= MsiEvaluateCondition(hpkg
, "1");
1167 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1169 r
= MsiEvaluateCondition(hpkg
, "0");
1170 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1172 r
= MsiEvaluateCondition(hpkg
, "-1");
1173 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1175 r
= MsiEvaluateCondition(hpkg
, "0 = 0");
1176 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1178 r
= MsiEvaluateCondition(hpkg
, "0 <> 0");
1179 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1181 r
= MsiEvaluateCondition(hpkg
, "0 = 1");
1182 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1184 r
= MsiEvaluateCondition(hpkg
, "0 > 1");
1185 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1187 r
= MsiEvaluateCondition(hpkg
, "0 ~> 1");
1188 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1190 r
= MsiEvaluateCondition(hpkg
, "1 > 1");
1191 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1193 r
= MsiEvaluateCondition(hpkg
, "1 ~> 1");
1194 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1196 r
= MsiEvaluateCondition(hpkg
, "0 >= 1");
1197 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1199 r
= MsiEvaluateCondition(hpkg
, "0 ~>= 1");
1200 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1202 r
= MsiEvaluateCondition(hpkg
, "1 >= 1");
1203 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1205 r
= MsiEvaluateCondition(hpkg
, "1 ~>= 1");
1206 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1208 r
= MsiEvaluateCondition(hpkg
, "0 < 1");
1209 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1211 r
= MsiEvaluateCondition(hpkg
, "0 ~< 1");
1212 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1214 r
= MsiEvaluateCondition(hpkg
, "1 < 1");
1215 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1217 r
= MsiEvaluateCondition(hpkg
, "1 ~< 1");
1218 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1220 r
= MsiEvaluateCondition(hpkg
, "0 <= 1");
1221 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1223 r
= MsiEvaluateCondition(hpkg
, "0 ~<= 1");
1224 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1226 r
= MsiEvaluateCondition(hpkg
, "1 <= 1");
1227 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1229 r
= MsiEvaluateCondition(hpkg
, "1 ~<= 1");
1230 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1232 r
= MsiEvaluateCondition(hpkg
, "0 >=");
1233 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1235 r
= MsiEvaluateCondition(hpkg
, " ");
1236 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1238 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"1\"");
1239 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1241 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"0\"");
1242 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1244 r
= MsiEvaluateCondition(hpkg
, "LicView <> LicView");
1245 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1247 r
= MsiEvaluateCondition(hpkg
, "not 0");
1248 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1250 r
= MsiEvaluateCondition(hpkg
, "not LicView");
1251 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1253 r
= MsiEvaluateCondition(hpkg
, "\"Testing\" ~<< \"Testing\"");
1254 ok (r
== MSICONDITION_TRUE
, "wrong return val\n");
1256 r
= MsiEvaluateCondition(hpkg
, "LicView ~<< \"Testing\"");
1257 ok (r
== MSICONDITION_FALSE
, "wrong return val\n");
1259 r
= MsiEvaluateCondition(hpkg
, "Not LicView ~<< \"Testing\"");
1260 ok (r
== MSICONDITION_TRUE
, "wrong return val\n");
1262 r
= MsiEvaluateCondition(hpkg
, "not \"A\"");
1263 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1265 r
= MsiEvaluateCondition(hpkg
, "~not \"A\"");
1266 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1268 r
= MsiEvaluateCondition(hpkg
, "\"0\"");
1269 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1271 r
= MsiEvaluateCondition(hpkg
, "1 and 2");
1272 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1274 r
= MsiEvaluateCondition(hpkg
, "not 0 and 3");
1275 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1277 r
= MsiEvaluateCondition(hpkg
, "not 0 and 0");
1278 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1280 r
= MsiEvaluateCondition(hpkg
, "not 0 or 1");
1281 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1283 r
= MsiEvaluateCondition(hpkg
, "(0)");
1284 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1286 r
= MsiEvaluateCondition(hpkg
, "(((((1))))))");
1287 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1289 r
= MsiEvaluateCondition(hpkg
, "(((((1)))))");
1290 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1292 r
= MsiEvaluateCondition(hpkg
, " \"A\" < \"B\" ");
1293 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1295 r
= MsiEvaluateCondition(hpkg
, " \"A\" > \"B\" ");
1296 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1298 r
= MsiEvaluateCondition(hpkg
, " \"1\" > \"12\" ");
1299 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1301 r
= MsiEvaluateCondition(hpkg
, " \"100\" < \"21\" ");
1302 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1304 r
= MsiEvaluateCondition(hpkg
, "0 < > 0");
1305 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1307 r
= MsiEvaluateCondition(hpkg
, "(1<<1) == 2");
1308 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1310 r
= MsiEvaluateCondition(hpkg
, " \"A\" = \"a\" ");
1311 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1313 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~ = \"a\" ");
1314 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1316 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= \"a\" ");
1317 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1319 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= 1 ");
1320 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1322 r
= MsiEvaluateCondition(hpkg
, " \"A\" = 1 ");
1323 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1325 r
= MsiEvaluateCondition(hpkg
, " 1 ~= 1 ");
1326 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1328 r
= MsiEvaluateCondition(hpkg
, " 1 ~= \"1\" ");
1329 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1331 r
= MsiEvaluateCondition(hpkg
, " 1 = \"1\" ");
1332 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1334 r
= MsiEvaluateCondition(hpkg
, " 0 = \"1\" ");
1335 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1337 r
= MsiEvaluateCondition(hpkg
, " 0 < \"100\" ");
1338 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1340 r
= MsiEvaluateCondition(hpkg
, " 100 > \"0\" ");
1341 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1343 r
= MsiEvaluateCondition(hpkg
, "1 XOR 1");
1344 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1346 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1");
1347 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1349 r
= MsiEvaluateCondition(hpkg
, "1 IMP 0");
1350 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1352 r
= MsiEvaluateCondition(hpkg
, "0 IMP 0");
1353 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1355 r
= MsiEvaluateCondition(hpkg
, "0 EQV 0");
1356 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1358 r
= MsiEvaluateCondition(hpkg
, "0 EQV 1");
1359 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1361 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1 OR 0");
1362 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1364 r
= MsiEvaluateCondition(hpkg
, "1 IMPL 1");
1365 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1367 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" >< \"S\" ");
1368 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1370 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"s\" ");
1371 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1373 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"\" ");
1374 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1376 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"sss\" ");
1377 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1379 MsiSetProperty(hpkg
, "mm", "5" );
1381 r
= MsiEvaluateCondition(hpkg
, "mm = 5");
1382 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1384 r
= MsiEvaluateCondition(hpkg
, "mm < 6");
1385 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1387 r
= MsiEvaluateCondition(hpkg
, "mm <= 5");
1388 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1390 r
= MsiEvaluateCondition(hpkg
, "mm > 4");
1391 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1393 r
= MsiEvaluateCondition(hpkg
, "mm < 12");
1394 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1396 r
= MsiEvaluateCondition(hpkg
, "mm = \"5\"");
1397 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1399 r
= MsiEvaluateCondition(hpkg
, "0 = \"\"");
1400 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1402 r
= MsiEvaluateCondition(hpkg
, "0 AND \"\"");
1403 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1405 r
= MsiEvaluateCondition(hpkg
, "1 AND \"\"");
1406 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1408 r
= MsiEvaluateCondition(hpkg
, "1 AND \"1\"");
1409 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1411 r
= MsiEvaluateCondition(hpkg
, "3 >< 1");
1412 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1414 r
= MsiEvaluateCondition(hpkg
, "3 >< 4");
1415 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1417 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 0");
1418 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1420 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1");
1421 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1423 r
= MsiEvaluateCondition(hpkg
, "NOT 1 OR 0");
1424 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1426 r
= MsiEvaluateCondition(hpkg
, "0 AND 1 OR 1");
1427 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1429 r
= MsiEvaluateCondition(hpkg
, "0 AND 0 OR 1");
1430 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1432 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1 OR 0");
1433 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1435 r
= MsiEvaluateCondition(hpkg
, "_1 = _1");
1436 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1438 r
= MsiEvaluateCondition(hpkg
, "( 1 AND 1 ) = 2");
1439 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1441 r
= MsiEvaluateCondition(hpkg
, "NOT ( 1 AND 1 )");
1442 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1444 r
= MsiEvaluateCondition(hpkg
, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1445 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1447 r
= MsiEvaluateCondition(hpkg
, "Installed<>\"\"");
1448 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1450 r
= MsiEvaluateCondition(hpkg
, "NOT 1 AND 0");
1451 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1453 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1454 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1456 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1457 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1459 r
= MsiEvaluateCondition(hpkg
, "bandalmael<0");
1460 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1462 r
= MsiEvaluateCondition(hpkg
, "bandalmael>0");
1463 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1465 r
= MsiEvaluateCondition(hpkg
, "bandalmael>=0");
1466 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1468 r
= MsiEvaluateCondition(hpkg
, "bandalmael<=0");
1469 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1471 r
= MsiEvaluateCondition(hpkg
, "bandalmael~<>0");
1472 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1474 MsiSetProperty(hpkg
, "bandalmael", "0" );
1475 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1476 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1478 MsiSetProperty(hpkg
, "bandalmael", "" );
1479 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1480 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1482 MsiSetProperty(hpkg
, "bandalmael", "asdf" );
1483 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1484 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1486 MsiSetProperty(hpkg
, "bandalmael", "0asdf" );
1487 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1488 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1490 MsiSetProperty(hpkg
, "bandalmael", "0 " );
1491 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1492 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1494 MsiSetProperty(hpkg
, "bandalmael", "-0" );
1495 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1496 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1498 MsiSetProperty(hpkg
, "bandalmael", "0000000000000" );
1499 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1500 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1502 MsiSetProperty(hpkg
, "bandalmael", "--0" );
1503 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1504 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1506 MsiSetProperty(hpkg
, "bandalmael", "0x00" );
1507 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1508 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1510 MsiSetProperty(hpkg
, "bandalmael", "-" );
1511 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1512 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1514 MsiSetProperty(hpkg
, "bandalmael", "+0" );
1515 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1516 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1518 MsiSetProperty(hpkg
, "bandalmael", "0.0" );
1519 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1520 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1521 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1522 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1524 MsiSetProperty(hpkg
, "one", "hi");
1525 MsiSetProperty(hpkg
, "two", "hithere");
1526 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1527 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1529 MsiSetProperty(hpkg
, "one", "hithere");
1530 MsiSetProperty(hpkg
, "two", "hi");
1531 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1532 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1534 MsiSetProperty(hpkg
, "one", "hello");
1535 MsiSetProperty(hpkg
, "two", "hi");
1536 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1537 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1539 MsiSetProperty(hpkg
, "one", "hellohithere");
1540 MsiSetProperty(hpkg
, "two", "hi");
1541 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1542 ok( r
== MSICONDITION_TRUE
, "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", "hi");
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", "one 1234");
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", "hi");
1571 r
= MsiEvaluateCondition(hpkg
, "one << two");
1572 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1574 MsiSetProperty(hpkg
, "one", "hi");
1575 MsiSetProperty(hpkg
, "two", "hithere");
1576 r
= MsiEvaluateCondition(hpkg
, "one << two");
1577 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1579 MsiSetProperty(hpkg
, "one", "hi");
1580 MsiSetProperty(hpkg
, "two", "hi");
1581 r
= MsiEvaluateCondition(hpkg
, "one << two");
1582 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1584 MsiSetProperty(hpkg
, "one", "abcdhithere");
1585 MsiSetProperty(hpkg
, "two", "hi");
1586 r
= MsiEvaluateCondition(hpkg
, "one << two");
1587 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1589 MsiSetProperty(hpkg
, "one", "");
1590 MsiSetProperty(hpkg
, "two", "hi");
1591 r
= MsiEvaluateCondition(hpkg
, "one << two");
1592 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1594 MsiSetProperty(hpkg
, "one", "hithere");
1595 MsiSetProperty(hpkg
, "two", "");
1596 r
= MsiEvaluateCondition(hpkg
, "one << two");
1597 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1599 MsiSetProperty(hpkg
, "one", "");
1600 MsiSetProperty(hpkg
, "two", "");
1601 r
= MsiEvaluateCondition(hpkg
, "one << two");
1602 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1604 MsiSetProperty(hpkg
, "one", "1234");
1605 MsiSetProperty(hpkg
, "two", "1");
1606 r
= MsiEvaluateCondition(hpkg
, "one << two");
1607 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1609 MsiSetProperty(hpkg
, "one", "1234 one");
1610 MsiSetProperty(hpkg
, "two", "1");
1611 r
= MsiEvaluateCondition(hpkg
, "one << two");
1612 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1614 MsiSetProperty(hpkg
, "one", "hithere");
1615 MsiSetProperty(hpkg
, "two", "there");
1616 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1617 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1619 MsiSetProperty(hpkg
, "one", "hithere");
1620 MsiSetProperty(hpkg
, "two", "hi");
1621 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1622 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1624 MsiSetProperty(hpkg
, "one", "there");
1625 MsiSetProperty(hpkg
, "two", "hithere");
1626 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1627 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1629 MsiSetProperty(hpkg
, "one", "there");
1630 MsiSetProperty(hpkg
, "two", "there");
1631 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1632 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1634 MsiSetProperty(hpkg
, "one", "abcdhithere");
1635 MsiSetProperty(hpkg
, "two", "hi");
1636 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1637 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1639 MsiSetProperty(hpkg
, "one", "");
1640 MsiSetProperty(hpkg
, "two", "there");
1641 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1642 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1644 MsiSetProperty(hpkg
, "one", "there");
1645 MsiSetProperty(hpkg
, "two", "");
1646 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1647 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1649 MsiSetProperty(hpkg
, "one", "");
1650 MsiSetProperty(hpkg
, "two", "");
1651 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1652 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1654 MsiSetProperty(hpkg
, "one", "1234");
1655 MsiSetProperty(hpkg
, "two", "4");
1656 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1657 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1659 MsiSetProperty(hpkg
, "one", "one 1234");
1660 MsiSetProperty(hpkg
, "two", "4");
1661 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1662 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1664 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", NULL
); /* make sure it's empty */
1666 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1667 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1669 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport > \"1.1.4322\"");
1670 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1672 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport >= \"1.1.4322\"");
1673 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1675 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <= \"1.1.4322\"");
1676 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1678 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <> \"1.1.4322\"");
1679 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1681 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1682 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1684 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"abcd\"");
1685 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1687 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a1.1.4322\"");
1688 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1690 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322a\"");
1691 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1693 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1694 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1696 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1697 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1699 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1700 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1702 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1");
1703 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1705 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1\"");
1706 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1708 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"12.1\"");
1709 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1711 r
= MsiEvaluateCondition(hpkg
, "\"02.1\" < \"2.11\"");
1712 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1714 r
= MsiEvaluateCondition(hpkg
, "\"02.1.1\" < \"2.1\"");
1715 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1717 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1718 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1720 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1721 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1723 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0\"");
1724 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1726 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"-1\"");
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 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1733 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1735 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1736 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1738 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"/\"");
1739 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1741 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \" \"");
1742 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1744 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"azAZ_\"");
1745 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1747 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]\"");
1748 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1750 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]a\"");
1751 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1753 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]\"");
1754 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1756 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]a\"");
1757 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1759 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a}\"");
1760 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1762 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a\"");
1763 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1765 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a\"");
1766 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1768 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a{\"");
1769 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1771 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a]\"");
1772 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1774 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"A\"");
1775 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1777 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", "1.1.4322");
1778 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1779 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1781 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.14322\"");
1782 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1784 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.5\"");
1785 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1787 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1788 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1790 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1791 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1793 MsiSetProperty(hpkg
, "one", "1");
1794 r
= MsiEvaluateCondition(hpkg
, "one < \"1\"");
1795 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1797 MsiSetProperty(hpkg
, "X", "5.0");
1799 r
= MsiEvaluateCondition(hpkg
, "X != \"\"");
1800 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1802 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\"");
1803 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1805 r
= MsiEvaluateCondition(hpkg
, "X =\"5.1\"");
1806 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1808 r
= MsiEvaluateCondition(hpkg
, "X =\"6.0\"");
1809 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1811 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1812 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1814 r
= MsiEvaluateCondition(hpkg
, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1815 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1817 r
= MsiEvaluateCondition(hpkg
, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1818 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1820 /* feature doesn't exist */
1821 r
= MsiEvaluateCondition(hpkg
, "&nofeature");
1822 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1824 MsiSetProperty(hpkg
, "A", "2");
1825 MsiSetProperty(hpkg
, "X", "50");
1827 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1828 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1830 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1831 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1833 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1834 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1836 MsiSetProperty(hpkg
, "X", "50val");
1838 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1839 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1841 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1842 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1844 MsiSetProperty(hpkg
, "A", "7");
1845 MsiSetProperty(hpkg
, "X", "50");
1847 r
= MsiEvaluateCondition(hpkg
, "7 <= X");
1848 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1850 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1851 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1853 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1854 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1856 MsiSetProperty(hpkg
, "X", "50val");
1858 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1859 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1861 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1862 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1864 MsiCloseHandle( hpkg
);
1865 DeleteFile(msifile
);
1868 static BOOL
check_prop_empty( MSIHANDLE hpkg
, const char * prop
)
1876 r
= MsiGetProperty( hpkg
, prop
, buffer
, &sz
);
1877 return r
== ERROR_SUCCESS
&& buffer
[0] == 0 && sz
== 0;
1880 static void test_props(void)
1882 MSIHANDLE hpkg
, hdb
;
1887 hdb
= create_package_db();
1889 "CREATE TABLE `Property` ( "
1890 "`Property` CHAR(255) NOT NULL, "
1891 "`Value` CHAR(255) "
1892 "PRIMARY KEY `Property`)" );
1893 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1896 "INSERT INTO `Property` "
1897 "(`Property`, `Value`) "
1898 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1899 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1901 r
= package_from_db( hdb
, &hpkg
);
1902 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
1904 skip("Not enough rights to perform tests\n");
1905 DeleteFile(msifile
);
1908 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
1910 /* test invalid values */
1911 r
= MsiGetProperty( 0, NULL
, NULL
, NULL
);
1912 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1914 r
= MsiGetProperty( hpkg
, NULL
, NULL
, NULL
);
1915 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1917 r
= MsiGetProperty( hpkg
, "boo", NULL
, NULL
);
1918 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1920 r
= MsiGetProperty( hpkg
, "boo", buffer
, NULL
);
1921 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1923 /* test retrieving an empty/nonexistent property */
1925 r
= MsiGetProperty( hpkg
, "boo", NULL
, &sz
);
1926 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1927 ok( sz
== 0, "wrong size returned\n");
1929 check_prop_empty( hpkg
, "boo");
1932 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1933 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1934 ok( !strcmp(buffer
,"x"), "buffer was changed\n");
1935 ok( sz
== 0, "wrong size returned\n");
1939 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1940 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1941 ok( buffer
[0] == 0, "buffer was not changed\n");
1942 ok( sz
== 0, "wrong size returned\n");
1944 /* set the property to something */
1945 r
= MsiSetProperty( 0, NULL
, NULL
);
1946 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1948 r
= MsiSetProperty( hpkg
, NULL
, NULL
);
1949 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1951 r
= MsiSetProperty( hpkg
, "", NULL
);
1952 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1954 /* try set and get some illegal property identifiers */
1955 r
= MsiSetProperty( hpkg
, "", "asdf" );
1956 ok( r
== ERROR_FUNCTION_FAILED
, "wrong return val\n");
1958 r
= MsiSetProperty( hpkg
, "=", "asdf" );
1959 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1961 r
= MsiSetProperty( hpkg
, " ", "asdf" );
1962 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1964 r
= MsiSetProperty( hpkg
, "'", "asdf" );
1965 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1969 r
= MsiGetProperty( hpkg
, "'", buffer
, &sz
);
1970 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1971 ok( !strcmp(buffer
,"asdf"), "buffer was not changed\n");
1973 /* set empty values */
1974 r
= MsiSetProperty( hpkg
, "boo", NULL
);
1975 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1976 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1978 r
= MsiSetProperty( hpkg
, "boo", "" );
1979 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1980 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1982 /* set a non-empty value */
1983 r
= MsiSetProperty( hpkg
, "boo", "xyz" );
1984 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1988 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1989 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1990 ok( buffer
[0] == 0, "buffer was not changed\n");
1991 ok( sz
== 3, "wrong size returned\n");
1995 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1996 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1997 ok( !strcmp(buffer
,"xyz"), "buffer was not changed\n");
1998 ok( sz
== 3, "wrong size returned\n");
2002 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
2003 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
2004 ok( !strcmp(buffer
,"xy"), "buffer was not changed\n");
2005 ok( sz
== 3, "wrong size returned\n");
2007 r
= MsiSetProperty(hpkg
, "SourceDir", "foo");
2008 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2011 r
= MsiGetProperty(hpkg
, "SOURCEDIR", buffer
, &sz
);
2012 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2013 ok( !strcmp(buffer
,""), "buffer wrong\n");
2014 ok( sz
== 0, "wrong size returned\n");
2017 r
= MsiGetProperty(hpkg
, "SOMERANDOMNAME", buffer
, &sz
);
2018 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2019 ok( !strcmp(buffer
,""), "buffer wrong\n");
2020 ok( sz
== 0, "wrong size returned\n");
2023 r
= MsiGetProperty(hpkg
, "SourceDir", buffer
, &sz
);
2024 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2025 ok( !strcmp(buffer
,"foo"), "buffer wrong\n");
2026 ok( sz
== 3, "wrong size returned\n");
2028 r
= MsiSetProperty(hpkg
, "MetadataCompName", "Photoshop.dll");
2029 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2032 r
= MsiGetProperty(hpkg
, "MetadataCompName", NULL
, &sz
);
2033 ok( r
== ERROR_SUCCESS
, "return wrong\n");
2034 ok( sz
== 13, "size wrong (%d)\n", sz
);
2037 r
= MsiGetProperty(hpkg
, "MetadataCompName", buffer
, &sz
);
2038 ok( r
== ERROR_MORE_DATA
, "return wrong\n");
2039 ok( !strcmp(buffer
,"Photoshop.dl"), "buffer wrong\n");
2041 r
= MsiSetProperty(hpkg
, "property", "value");
2042 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2045 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
2046 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2047 ok( !strcmp(buffer
, "value"), "Expected value, got %s\n", buffer
);
2049 r
= MsiSetProperty(hpkg
, "property", NULL
);
2050 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2053 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
2054 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2055 ok( !strlen(buffer
), "Expected empty string, got %s\n", buffer
);
2057 MsiCloseHandle( hpkg
);
2058 DeleteFile(msifile
);
2061 static BOOL
find_prop_in_property(MSIHANDLE hdb
, LPCSTR prop
, LPCSTR val
)
2063 MSIHANDLE hview
, hrec
;
2065 CHAR buffer
[MAX_PATH
];
2069 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
2070 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2071 r
= MsiViewExecute(hview
, 0);
2072 ok(r
== ERROR_SUCCESS
, "MsiViewExecute failed\n");
2075 while (r
== ERROR_SUCCESS
&& !found
)
2077 r
= MsiViewFetch(hview
, &hrec
);
2078 if (r
!= ERROR_SUCCESS
) break;
2081 r
= MsiRecordGetString(hrec
, 1, buffer
, &sz
);
2082 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, prop
))
2085 r
= MsiRecordGetString(hrec
, 2, buffer
, &sz
);
2086 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, val
))
2090 MsiCloseHandle(hrec
);
2093 MsiViewClose(hview
);
2094 MsiCloseHandle(hview
);
2099 static void test_property_table(void)
2103 MSIHANDLE hpkg
, hdb
, hrec
;
2104 char buffer
[MAX_PATH
], package
[10];
2108 hdb
= create_package_db();
2109 ok( hdb
, "failed to create package\n");
2111 r
= package_from_db(hdb
, &hpkg
);
2112 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2114 skip("Not enough rights to perform tests\n");
2115 DeleteFile(msifile
);
2118 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2120 MsiCloseHandle(hdb
);
2122 hdb
= MsiGetActiveDatabase(hpkg
);
2124 query
= "CREATE TABLE `_Property` ( "
2125 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2126 r
= run_query(hdb
, query
);
2127 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
2129 MsiCloseHandle(hdb
);
2130 MsiCloseHandle(hpkg
);
2131 DeleteFile(msifile
);
2133 hdb
= create_package_db();
2134 ok( hdb
, "failed to create package\n");
2136 query
= "CREATE TABLE `_Property` ( "
2137 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2138 r
= run_query(hdb
, query
);
2139 ok(r
== ERROR_SUCCESS
, "failed to create table\n");
2141 query
= "ALTER `_Property` ADD `foo` INTEGER";
2142 r
= run_query(hdb
, query
);
2143 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
2145 query
= "ALTER TABLE `_Property` ADD `foo` INTEGER";
2146 r
= run_query(hdb
, query
);
2147 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
2149 query
= "ALTER TABLE `_Property` ADD `extra` INTEGER";
2150 r
= run_query(hdb
, query
);
2151 ok(r
== ERROR_SUCCESS
, "failed to add column\n");
2153 sprintf(package
, "#%i", hdb
);
2154 r
= MsiOpenPackage(package
, &hpkg
);
2155 todo_wine
ok(r
!= ERROR_SUCCESS
, "MsiOpenPackage succeeded\n");
2156 if (r
== ERROR_SUCCESS
)
2157 MsiCloseHandle(hpkg
);
2159 r
= MsiCloseHandle(hdb
);
2160 ok(r
== ERROR_SUCCESS
, "MsiCloseHandle failed %u\n", r
);
2162 hdb
= create_package_db();
2163 ok (hdb
, "failed to create package database\n");
2165 r
= create_property_table(hdb
);
2166 ok(r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2168 r
= add_property_entry(hdb
, "'prop', 'val'");
2169 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2171 r
= package_from_db(hdb
, &hpkg
);
2172 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2174 MsiCloseHandle(hdb
);
2177 r
= MsiGetProperty(hpkg
, "prop", buffer
, &sz
);
2178 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2179 ok(!lstrcmp(buffer
, "val"), "Expected val, got %s\n", buffer
);
2181 hdb
= MsiGetActiveDatabase(hpkg
);
2183 found
= find_prop_in_property(hdb
, "prop", "val");
2184 ok(found
, "prop should be in the _Property table\n");
2186 r
= add_property_entry(hdb
, "'dantes', 'mercedes'");
2187 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2189 query
= "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2190 r
= do_query(hdb
, query
, &hrec
);
2191 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
2193 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2194 ok(found
== FALSE
, "dantes should not be in the _Property table\n");
2197 lstrcpy(buffer
, "aaa");
2198 r
= MsiGetProperty(hpkg
, "dantes", buffer
, &sz
);
2199 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2200 ok(lstrlenA(buffer
) == 0, "Expected empty string, got %s\n", buffer
);
2202 r
= MsiSetProperty(hpkg
, "dantes", "mercedes");
2203 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2205 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2206 ok(found
== TRUE
, "dantes should be in the _Property table\n");
2208 MsiCloseHandle(hdb
);
2209 MsiCloseHandle(hpkg
);
2210 DeleteFile(msifile
);
2213 static UINT
try_query_param( MSIHANDLE hdb
, LPCSTR szQuery
, MSIHANDLE hrec
)
2218 res
= MsiDatabaseOpenView( hdb
, szQuery
, &htab
);
2219 if( res
== ERROR_SUCCESS
)
2223 r
= MsiViewExecute( htab
, hrec
);
2224 if( r
!= ERROR_SUCCESS
)
2227 fprintf(stderr
,"MsiViewExecute failed %08x\n", res
);
2230 r
= MsiViewClose( htab
);
2231 if( r
!= ERROR_SUCCESS
)
2234 r
= MsiCloseHandle( htab
);
2235 if( r
!= ERROR_SUCCESS
)
2241 static UINT
try_query( MSIHANDLE hdb
, LPCSTR szQuery
)
2243 return try_query_param( hdb
, szQuery
, 0 );
2246 static void set_summary_str(MSIHANDLE hdb
, DWORD pid
, LPCSTR value
)
2251 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2252 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2254 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_LPSTR
, 0, NULL
, value
);
2255 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2257 r
= MsiSummaryInfoPersist(summary
);
2258 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2260 MsiCloseHandle(summary
);
2263 static void set_summary_dword(MSIHANDLE hdb
, DWORD pid
, DWORD value
)
2268 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2269 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2271 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_I4
, value
, NULL
, NULL
);
2272 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2274 r
= MsiSummaryInfoPersist(summary
);
2275 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2277 MsiCloseHandle(summary
);
2280 static void test_msipackage(void)
2282 MSIHANDLE hdb
= 0, hpack
= 100;
2287 /* NULL szPackagePath */
2288 r
= MsiOpenPackage(NULL
, &hpack
);
2289 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2291 /* empty szPackagePath */
2292 r
= MsiOpenPackage("", &hpack
);
2293 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2295 skip("Not enough rights to perform tests\n");
2300 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2303 if (r
== ERROR_SUCCESS
)
2304 MsiCloseHandle(hpack
);
2306 /* nonexistent szPackagePath */
2307 r
= MsiOpenPackage("nonexistent", &hpack
);
2308 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r
);
2311 r
= MsiOpenPackage(msifile
, NULL
);
2312 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2316 r
= MsiOpenPackage(name
, &hpack
);
2317 ok(r
== ERROR_INVALID_HANDLE
, "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
2319 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2322 /* database exists, but is emtpy */
2323 sprintf(name
, "#%d", hdb
);
2324 r
= MsiOpenPackage(name
, &hpack
);
2325 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2326 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2328 query
= "CREATE TABLE `Property` ( "
2329 "`Property` CHAR(72), `Value` CHAR(0) "
2330 "PRIMARY KEY `Property`)";
2331 r
= try_query(hdb
, query
);
2332 ok(r
== ERROR_SUCCESS
, "failed to create Properties table\n");
2334 query
= "CREATE TABLE `InstallExecuteSequence` ("
2335 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2336 "PRIMARY KEY `Action`)";
2337 r
= try_query(hdb
, query
);
2338 ok(r
== ERROR_SUCCESS
, "failed to create InstallExecuteSequence table\n");
2340 /* a few key tables exist */
2341 sprintf(name
, "#%d", hdb
);
2342 r
= MsiOpenPackage(name
, &hpack
);
2343 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2344 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2346 MsiCloseHandle(hdb
);
2347 DeleteFile(msifile
);
2349 /* start with a clean database to show what constitutes a valid package */
2350 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2351 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2353 sprintf(name
, "#%d", hdb
);
2355 /* The following summary information props must exist:
2360 set_summary_dword(hdb
, PID_PAGECOUNT
, 100);
2361 r
= MsiOpenPackage(name
, &hpack
);
2362 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2363 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2365 set_summary_str(hdb
, PID_REVNUMBER
, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2366 r
= MsiOpenPackage(name
, &hpack
);
2367 ok(r
== ERROR_SUCCESS
,
2368 "Expected ERROR_SUCCESS, got %d\n", r
);
2370 MsiCloseHandle(hpack
);
2371 MsiCloseHandle(hdb
);
2372 DeleteFile(msifile
);
2375 static void test_formatrecord2(void)
2377 MSIHANDLE hpkg
, hrec
;
2382 r
= package_from_db(create_package_db(), &hpkg
);
2383 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2385 skip("Not enough rights to perform tests\n");
2386 DeleteFile(msifile
);
2389 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2391 r
= MsiSetProperty(hpkg
, "Manufacturer", " " );
2392 ok( r
== ERROR_SUCCESS
, "set property failed\n");
2394 hrec
= MsiCreateRecord(2);
2395 ok(hrec
, "create record failed\n");
2397 r
= MsiRecordSetString( hrec
, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2398 ok( r
== ERROR_SUCCESS
, "format record failed\n");
2402 r
= MsiFormatRecord( hpkg
, hrec
, buffer
, &sz
);
2404 r
= MsiRecordSetString(hrec
, 0, "[foo][1]");
2405 r
= MsiRecordSetString(hrec
, 1, "hoo");
2407 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2408 ok( sz
== 3, "size wrong\n");
2409 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2410 ok( r
== ERROR_SUCCESS
, "format failed\n");
2412 r
= MsiRecordSetString(hrec
, 0, "x[~]x");
2414 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2415 ok( sz
== 3, "size wrong\n");
2416 ok( 0 == strcmp(buffer
,"x"), "wrong output %s\n",buffer
);
2417 ok( r
== ERROR_SUCCESS
, "format failed\n");
2419 r
= MsiRecordSetString(hrec
, 0, "[foo.$%}][1]");
2420 r
= MsiRecordSetString(hrec
, 1, "hoo");
2422 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2423 ok( sz
== 3, "size wrong\n");
2424 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2425 ok( r
== ERROR_SUCCESS
, "format failed\n");
2427 r
= MsiRecordSetString(hrec
, 0, "[\\[]");
2429 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2430 ok( sz
== 1, "size wrong\n");
2431 ok( 0 == strcmp(buffer
,"["), "wrong output %s\n",buffer
);
2432 ok( r
== ERROR_SUCCESS
, "format failed\n");
2434 SetEnvironmentVariable("FOO", "BAR");
2435 r
= MsiRecordSetString(hrec
, 0, "[%FOO]");
2437 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2438 ok( sz
== 3, "size wrong\n");
2439 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2440 ok( r
== ERROR_SUCCESS
, "format failed\n");
2442 r
= MsiRecordSetString(hrec
, 0, "[[1]]");
2443 r
= MsiRecordSetString(hrec
, 1, "%FOO");
2445 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2446 ok( sz
== 3, "size wrong\n");
2447 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2448 ok( r
== ERROR_SUCCESS
, "format failed\n");
2450 MsiCloseHandle( hrec
);
2451 MsiCloseHandle( hpkg
);
2452 DeleteFile(msifile
);
2455 static void test_states(void)
2460 INSTALLSTATE state
, action
;
2462 static const CHAR msifile2
[] = "winetest2-package.msi";
2463 static const CHAR msifile3
[] = "winetest3-package.msi";
2464 static const CHAR msifile4
[] = "winetest4-package.msi";
2466 if (is_process_limited())
2468 skip("process is limited\n");
2472 hdb
= create_package_db();
2473 ok ( hdb
, "failed to create package database\n" );
2475 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
2476 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
2478 r
= create_property_table( hdb
);
2479 ok( r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2481 r
= add_property_entry( hdb
, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2482 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2484 r
= add_property_entry( hdb
, "'ProductLanguage', '1033'" );
2485 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2487 r
= add_property_entry( hdb
, "'ProductName', 'MSITEST'" );
2488 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2490 r
= add_property_entry( hdb
, "'ProductVersion', '1.1.1'" );
2491 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2493 r
= create_install_execute_sequence_table( hdb
);
2494 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table: %d\n", r
);
2496 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
2497 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2499 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
2500 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2502 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
2503 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2505 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1400'" );
2506 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2508 r
= add_install_execute_sequence_entry( hdb
, "'InstallInitialize', '', '1500'" );
2509 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2511 r
= add_install_execute_sequence_entry( hdb
, "'ProcessComponents', '', '1600'" );
2512 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2514 r
= add_install_execute_sequence_entry( hdb
, "'UnpublishFeatures', '', '1800'" );
2515 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2517 r
= add_install_execute_sequence_entry( hdb
, "'RegisterProduct', '', '6100'" );
2518 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2520 r
= add_install_execute_sequence_entry( hdb
, "'PublishFeatures', '', '6300'" );
2521 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2523 r
= add_install_execute_sequence_entry( hdb
, "'PublishProduct', '', '6400'" );
2524 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2526 r
= add_install_execute_sequence_entry( hdb
, "'InstallFinalize', '', '6600'" );
2527 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2529 r
= create_media_table( hdb
);
2530 ok( r
== ERROR_SUCCESS
, "cannot create media table: %d\n", r
);
2532 r
= add_media_entry( hdb
, "'1', '3', '', '', 'DISK1', ''");
2533 ok( r
== ERROR_SUCCESS
, "cannot add media entry: %d\n", r
);
2535 r
= create_feature_table( hdb
);
2536 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
2538 r
= create_component_table( hdb
);
2539 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
2541 /* msidbFeatureAttributesFavorLocal */
2542 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
2543 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2545 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2546 r
= add_component_entry( hdb
, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2547 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2549 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2550 r
= add_component_entry( hdb
, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2551 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2553 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2554 r
= add_component_entry( hdb
, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2555 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2557 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2558 r
= add_component_entry( hdb
, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2559 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2561 /* msidbFeatureAttributesFavorSource */
2562 r
= add_feature_entry( hdb
, "'two', '', '', '', 2, 1, '', 1" );
2563 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2565 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2566 r
= add_component_entry( hdb
, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2567 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2569 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2570 r
= add_component_entry( hdb
, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2571 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2573 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2574 r
= add_component_entry( hdb
, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2575 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2577 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2578 r
= add_component_entry( hdb
, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2579 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2581 /* msidbFeatureAttributesFavorSource */
2582 r
= add_feature_entry( hdb
, "'three', '', '', '', 2, 1, '', 1" );
2583 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2585 /* msidbFeatureAttributesFavorLocal */
2586 r
= add_feature_entry( hdb
, "'four', '', '', '', 2, 1, '', 0" );
2587 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2590 r
= add_feature_entry( hdb
, "'five', '', '', '', 2, 0, '', 1" );
2591 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2593 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2594 r
= add_component_entry( hdb
, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2595 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2597 /* no feature parent:msidbComponentAttributesLocalOnly */
2598 r
= add_component_entry( hdb
, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2599 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2601 /* msidbFeatureAttributesFavorLocal:removed */
2602 r
= add_feature_entry( hdb
, "'six', '', '', '', 2, 1, '', 0" );
2603 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2605 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2606 r
= add_component_entry( hdb
, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2607 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2609 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2610 r
= add_component_entry( hdb
, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2611 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2613 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2614 r
= add_component_entry( hdb
, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2615 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2617 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2618 r
= add_component_entry( hdb
, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2619 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2621 /* msidbFeatureAttributesFavorSource:removed */
2622 r
= add_feature_entry( hdb
, "'seven', '', '', '', 2, 1, '', 1" );
2623 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2625 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2626 r
= add_component_entry( hdb
, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2627 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2629 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2630 r
= add_component_entry( hdb
, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2631 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2633 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2634 r
= add_component_entry( hdb
, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2635 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2637 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2638 r
= add_component_entry( hdb
, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2639 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2641 /* msidbFeatureAttributesFavorLocal */
2642 r
= add_feature_entry( hdb
, "'eight', '', '', '', 2, 1, '', 0" );
2643 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2645 r
= add_component_entry( hdb
, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2646 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2648 /* msidbFeatureAttributesFavorSource */
2649 r
= add_feature_entry( hdb
, "'nine', '', '', '', 2, 1, '', 1" );
2650 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2652 r
= add_component_entry( hdb
, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2653 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2655 /* msidbFeatureAttributesFavorAdvertise */
2656 r
= add_feature_entry( hdb
, "'ten', '', '', '', 2, 1, '', 4" );
2657 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2659 r
= add_component_entry( hdb
, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2660 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2662 r
= create_feature_components_table( hdb
);
2663 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
2665 r
= add_feature_components_entry( hdb
, "'one', 'alpha'" );
2666 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2668 r
= add_feature_components_entry( hdb
, "'one', 'beta'" );
2669 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2671 r
= add_feature_components_entry( hdb
, "'one', 'gamma'" );
2672 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2674 r
= add_feature_components_entry( hdb
, "'one', 'theta'" );
2675 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2677 r
= add_feature_components_entry( hdb
, "'two', 'delta'" );
2678 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2680 r
= add_feature_components_entry( hdb
, "'two', 'epsilon'" );
2681 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2683 r
= add_feature_components_entry( hdb
, "'two', 'zeta'" );
2684 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2686 r
= add_feature_components_entry( hdb
, "'two', 'iota'" );
2687 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2689 r
= add_feature_components_entry( hdb
, "'three', 'eta'" );
2690 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2692 r
= add_feature_components_entry( hdb
, "'four', 'eta'" );
2693 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2695 r
= add_feature_components_entry( hdb
, "'five', 'eta'" );
2696 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2698 r
= add_feature_components_entry( hdb
, "'six', 'lambda'" );
2699 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2701 r
= add_feature_components_entry( hdb
, "'six', 'mu'" );
2702 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2704 r
= add_feature_components_entry( hdb
, "'six', 'nu'" );
2705 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2707 r
= add_feature_components_entry( hdb
, "'six', 'xi'" );
2708 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2710 r
= add_feature_components_entry( hdb
, "'seven', 'omicron'" );
2711 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2713 r
= add_feature_components_entry( hdb
, "'seven', 'pi'" );
2714 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2716 r
= add_feature_components_entry( hdb
, "'seven', 'rho'" );
2717 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2719 r
= add_feature_components_entry( hdb
, "'seven', 'sigma'" );
2720 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2722 r
= add_feature_components_entry( hdb
, "'eight', 'tau'" );
2723 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2725 r
= add_feature_components_entry( hdb
, "'nine', 'phi'" );
2726 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2728 r
= add_feature_components_entry( hdb
, "'ten', 'chi'" );
2729 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2731 r
= create_file_table( hdb
);
2732 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
2734 r
= add_file_entry( hdb
, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2735 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2737 r
= add_file_entry( hdb
, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2738 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2740 r
= add_file_entry( hdb
, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2741 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2743 r
= add_file_entry( hdb
, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2744 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2746 r
= add_file_entry( hdb
, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2747 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2749 r
= add_file_entry( hdb
, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2750 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2752 r
= add_file_entry( hdb
, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2753 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2755 r
= add_file_entry( hdb
, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2756 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2758 /* compressed file */
2759 r
= add_file_entry( hdb
, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2760 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2762 r
= add_file_entry( hdb
, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2763 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2765 r
= add_file_entry( hdb
, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2766 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2768 r
= add_file_entry( hdb
, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2769 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2771 r
= add_file_entry( hdb
, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2772 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2774 r
= add_file_entry( hdb
, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2775 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2777 r
= add_file_entry( hdb
, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2778 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2780 r
= add_file_entry( hdb
, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2781 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2783 r
= add_file_entry( hdb
, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2784 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2786 r
= add_file_entry( hdb
, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2787 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2789 r
= add_file_entry( hdb
, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2790 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2792 r
= add_file_entry( hdb
, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2793 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2795 r
= add_file_entry( hdb
, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2796 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2798 MsiDatabaseCommit(hdb
);
2800 /* these properties must not be in the saved msi file */
2801 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
2802 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2804 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
2805 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2807 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
2808 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2810 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine,ten'");
2811 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2813 r
= add_property_entry( hdb
, "'REINSTALLMODE', 'omus'");
2814 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2816 r
= package_from_db( hdb
, &hpkg
);
2817 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2819 skip("Not enough rights to perform tests\n");
2820 DeleteFile(msifile
);
2823 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2825 MsiCloseHandle(hdb
);
2827 CopyFileA(msifile
, msifile2
, FALSE
);
2828 CopyFileA(msifile
, msifile3
, FALSE
);
2829 CopyFileA(msifile
, msifile4
, FALSE
);
2833 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2834 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, 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
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2841 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, 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
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2848 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, 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
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2855 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, 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
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2862 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, 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
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2869 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, 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
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2876 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2877 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2878 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2882 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
2883 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2884 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2885 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2889 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
2890 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2891 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2892 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2896 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
2897 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2898 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2899 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2903 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2904 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2905 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2906 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2910 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2911 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2912 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2913 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2917 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2918 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2919 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2920 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2924 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2925 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2926 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2927 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2931 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2932 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2933 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2934 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2938 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2939 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2940 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2941 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2945 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2946 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2947 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2948 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2952 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2953 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2954 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2955 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2959 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2960 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2961 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2962 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2966 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2967 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2968 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2969 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2973 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2974 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2975 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2976 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2980 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2981 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2982 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2983 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2987 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2988 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2989 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2990 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2994 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2995 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2996 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2997 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3001 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3002 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3003 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3004 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3008 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3009 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3010 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3011 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3015 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3016 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3017 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3018 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3022 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3023 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3024 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3025 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3029 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3030 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3031 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3032 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3036 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3037 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3038 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3039 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3043 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3044 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3045 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3046 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3048 r
= MsiDoAction( hpkg
, "CostInitialize");
3049 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3053 r
= MsiGetFeatureState(hpkg
, "one", &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
);
3060 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3061 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3062 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3063 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3067 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3068 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3069 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3070 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3074 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3075 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3076 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3077 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3081 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3082 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3083 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3084 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3088 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3089 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3090 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3091 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3095 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3096 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3097 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3098 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3102 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3103 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3104 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3105 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3109 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3110 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3111 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3112 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3116 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3117 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3118 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3119 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3123 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3124 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3125 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3126 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3130 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3131 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3132 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3133 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3137 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3138 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3139 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3140 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3144 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3145 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3146 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3147 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3151 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3152 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3153 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3154 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3158 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3159 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3160 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3161 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3165 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3166 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3167 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3168 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3172 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3173 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3174 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3175 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3179 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3180 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3181 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3182 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3186 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3187 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3188 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3189 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3193 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3194 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3195 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3196 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3200 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3201 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3202 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3203 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3207 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3208 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3209 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3210 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3214 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3215 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3216 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3217 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3221 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3222 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3223 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3224 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3228 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3229 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3230 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3231 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3235 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3236 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3237 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3238 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3242 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3243 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3244 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3245 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3249 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3250 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3251 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3252 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3256 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3257 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3258 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3259 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3263 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3264 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3265 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3266 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3268 r
= MsiDoAction( hpkg
, "FileCost");
3269 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3273 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3274 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3275 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3276 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3280 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3281 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3282 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3283 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3287 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3288 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3289 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3290 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3294 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3295 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3296 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3297 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3301 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3302 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3303 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3304 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3308 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3309 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3310 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3311 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3315 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3316 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3317 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3318 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3322 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3323 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3324 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3325 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3329 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3330 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3331 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3332 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3336 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3337 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3338 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3339 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3343 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3344 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3345 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3346 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3350 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3351 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3352 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3353 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3357 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3358 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3359 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3360 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3364 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3365 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3366 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3367 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3371 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3372 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3373 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3374 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3378 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3379 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3380 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3381 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3385 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3386 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3387 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3388 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3392 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3393 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3394 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3395 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3399 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3400 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3401 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3402 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3406 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3407 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3408 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3409 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3413 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3414 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3415 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3416 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3420 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3421 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3422 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3423 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3427 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3428 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3429 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3430 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3434 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3435 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3436 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3437 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3441 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3442 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3443 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3444 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3448 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3449 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3450 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3451 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3455 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3456 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3457 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3458 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3462 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3463 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3464 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3465 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3469 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3470 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3471 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3472 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3476 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3477 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3478 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3479 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3483 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3484 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3485 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3486 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3488 r
= MsiDoAction( hpkg
, "CostFinalize");
3489 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3493 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3494 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3495 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3496 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3500 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3501 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3502 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3503 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3507 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3508 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3509 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3510 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3514 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3515 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3516 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3517 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3521 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3522 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3523 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3524 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3528 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3529 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3530 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3531 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3535 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3536 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3537 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3538 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3542 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3543 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3544 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3545 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3549 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3550 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3551 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3552 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3556 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3557 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3558 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3559 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3563 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3564 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3565 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3566 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3570 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3571 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3572 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3573 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3577 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3578 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3579 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3580 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3584 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3585 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3586 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3587 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3591 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3592 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3593 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3594 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3598 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3599 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3600 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3601 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3605 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3606 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3607 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3608 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3612 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3613 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3614 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3615 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3619 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3620 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3621 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3622 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3626 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3627 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3628 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3629 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3633 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3634 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3635 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3636 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3640 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3641 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3642 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3643 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3647 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3648 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3649 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3650 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3654 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3655 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3656 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3657 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3661 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3662 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3663 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3664 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3668 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3669 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3670 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3671 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3675 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3676 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3677 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3678 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3682 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3683 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3684 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3685 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3689 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3690 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3691 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3692 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3696 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3697 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3698 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3699 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3703 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3704 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3705 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3706 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3708 MsiCloseHandle( hpkg
);
3710 /* publish the features and components */
3711 r
= MsiInstallProduct(msifile
, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3714 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
3715 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3717 /* these properties must not be in the saved msi file */
3718 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
3719 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3721 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
3722 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3724 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
3725 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3727 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine,ten'");
3728 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3730 r
= package_from_db( hdb
, &hpkg
);
3731 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
3733 MsiCloseHandle(hdb
);
3737 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3738 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3739 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3740 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3744 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3745 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3746 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3747 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3751 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3752 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3753 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3754 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3758 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3759 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3760 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3761 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3765 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3766 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3767 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3768 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3772 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3773 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3774 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3775 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3779 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3780 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3781 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3782 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3786 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3787 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3788 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3789 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3793 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3794 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3795 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3796 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3800 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3801 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3802 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3803 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3807 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3808 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3809 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3810 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3814 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3815 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3816 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3817 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3821 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3822 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3823 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3824 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3828 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3829 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3830 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3831 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3835 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3836 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3837 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3838 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3842 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3843 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3844 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3845 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3849 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3850 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3851 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3852 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3856 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3857 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3858 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3859 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3863 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3864 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3865 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3866 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3870 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3871 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3872 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3873 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3877 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3878 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3879 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3880 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3884 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3885 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3886 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3887 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3891 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3892 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3893 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3894 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3898 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3899 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3900 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3901 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3905 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3906 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3907 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3908 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3912 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3913 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3914 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3915 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3919 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3920 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3921 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3922 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3926 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3927 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3928 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3929 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3933 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3934 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3935 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3936 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3940 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3941 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3942 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3943 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3947 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3948 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3949 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3950 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3952 r
= MsiDoAction( hpkg
, "CostInitialize");
3953 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3957 r
= MsiGetFeatureState(hpkg
, "one", &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
= MsiGetFeatureState(hpkg
, "two", &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
);
3971 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3972 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3973 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3974 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3978 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3979 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3980 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3981 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3985 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3986 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3987 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3988 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3992 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3993 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3994 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3995 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3999 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4000 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4001 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4002 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4006 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4007 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4008 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4009 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4013 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4014 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4015 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4016 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4020 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4021 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4022 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4023 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4027 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4028 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4029 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4030 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4034 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4035 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4036 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4037 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4041 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4042 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4043 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4044 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4048 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4049 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4050 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4051 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4055 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4056 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4057 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4058 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4062 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4063 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4064 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4065 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4069 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4070 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4071 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4072 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4076 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4077 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4078 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4079 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4083 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4084 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4085 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4086 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4090 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4091 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4092 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4093 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4097 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4098 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4099 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4100 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4104 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4105 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4106 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4107 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4111 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4112 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4113 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4114 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4118 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4119 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4120 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4121 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4125 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4126 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4127 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4128 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4132 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4133 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4134 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4135 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4139 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4140 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4141 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4142 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4146 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4147 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4148 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4149 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4153 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4154 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4155 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4156 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4160 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4161 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4162 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4163 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4167 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4168 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4169 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4170 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4172 r
= MsiDoAction( hpkg
, "FileCost");
4173 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
4177 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4178 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4179 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4180 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4184 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4185 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4186 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4187 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4191 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4192 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4193 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4194 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4198 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4199 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4200 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4201 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4205 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4206 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4207 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4208 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4212 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4213 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4214 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4215 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4219 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4220 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4221 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4222 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4226 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4227 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4228 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4229 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4233 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4234 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4235 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4236 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4240 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4241 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4242 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4243 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4247 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4248 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4249 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4250 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4254 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4255 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4256 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4257 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4261 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4262 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4263 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4264 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4268 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4269 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4270 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4271 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4275 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4276 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4277 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4278 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4282 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4283 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4284 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4285 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4289 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4290 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4291 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4292 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4296 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4297 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4298 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4299 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4303 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4304 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4305 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4306 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4310 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4311 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4312 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4313 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4317 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4318 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4319 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4320 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4324 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4325 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4326 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4327 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4331 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4332 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4333 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4334 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4338 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4339 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4340 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4341 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4345 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4346 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4347 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4348 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4352 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4353 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4354 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4355 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4359 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4360 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4361 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4362 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4366 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4367 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4368 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4369 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4373 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4374 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4375 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4376 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4380 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4381 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4382 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4383 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4385 r
= MsiDoAction( hpkg
, "CostFinalize");
4386 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4390 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4391 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4392 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4393 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4397 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4398 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4399 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4400 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4404 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4405 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4406 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4407 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4411 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4412 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4413 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4414 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4418 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4419 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4420 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4421 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4425 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4426 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4427 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4428 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4432 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4433 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4434 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4435 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4439 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4440 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4441 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4442 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4446 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4447 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4448 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4449 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4453 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4454 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4455 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4456 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4460 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4461 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4462 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4463 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4467 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4468 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4469 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4470 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4474 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4475 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4476 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4477 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4481 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4482 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4483 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4484 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4488 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4489 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4490 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4491 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4495 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4496 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4497 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4498 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4502 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4503 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4504 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4505 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4509 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4510 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4511 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4512 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4516 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4517 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4518 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4519 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4523 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4524 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4525 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4526 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4530 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4531 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4532 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4533 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4537 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4538 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4539 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4540 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4544 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4545 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4546 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4547 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4551 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4552 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4553 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4554 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4558 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4559 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4560 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4561 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4565 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4566 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4567 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4568 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4572 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4573 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4574 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4575 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4579 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4580 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4581 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4582 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4586 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4587 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4588 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4589 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4593 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4594 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4595 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4596 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4600 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4601 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4602 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4603 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4605 MsiCloseHandle(hpkg
);
4607 /* uninstall the product */
4608 r
= MsiInstallProduct(msifile
, "REMOVE=ALL");
4609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4611 /* all features installed locally */
4612 r
= MsiInstallProduct(msifile2
, "ADDLOCAL=ALL");
4613 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4615 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_DIRECT
, &hdb
);
4616 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4618 /* these properties must not be in the saved msi file */
4619 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4620 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4622 r
= package_from_db( hdb
, &hpkg
);
4623 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
4627 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4628 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4629 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4630 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4634 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4635 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4636 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4637 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4641 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4642 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4643 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4644 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4648 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4649 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4650 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4651 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4655 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4656 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4657 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4658 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4662 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4663 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4664 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4665 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4669 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4670 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4671 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4672 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4676 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4677 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4678 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4679 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4683 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4684 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4685 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4686 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4690 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4691 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4692 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4693 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4697 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4698 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4699 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4700 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4704 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4705 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4706 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4707 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4711 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4712 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4713 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4714 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4718 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4719 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4720 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4721 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4725 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4726 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4727 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4728 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4732 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4733 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4734 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4735 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4739 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4740 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4741 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4742 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4746 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4747 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4748 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4749 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4753 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4754 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4755 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4756 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4760 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4761 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4762 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4763 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4767 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4768 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4769 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4770 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4774 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4775 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4776 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4777 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4781 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4782 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4783 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4784 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4788 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4789 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4790 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4791 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4795 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4796 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4797 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4798 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4802 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4803 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4804 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4805 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4809 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4810 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4811 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4812 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4816 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4817 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4818 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4819 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4823 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4824 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4825 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4826 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4830 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4831 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4832 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4833 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4837 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4838 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4839 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4840 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4842 r
= MsiDoAction( hpkg
, "CostInitialize");
4843 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4847 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4848 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4849 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4850 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4854 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4855 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4856 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4857 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4861 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4862 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4863 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4864 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4868 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4869 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4870 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4871 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4875 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4876 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4877 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4878 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4882 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4883 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4884 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4885 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4889 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4890 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4891 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4892 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4896 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4897 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4898 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4899 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4903 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4904 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4905 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4906 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4910 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4911 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4912 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4913 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4917 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4918 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4919 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4920 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4924 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4925 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4926 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4927 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4931 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4932 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4933 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4934 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4938 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4939 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4940 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4941 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4945 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4946 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4947 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4948 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4952 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4953 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4954 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4955 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4959 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4960 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4961 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4962 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4966 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4967 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4968 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4969 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4973 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4974 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4975 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4976 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4980 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4981 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4982 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4983 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4987 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4988 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4989 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4990 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4994 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4995 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4996 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4997 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5001 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5002 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5003 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5004 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5008 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5009 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5010 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5011 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5015 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5016 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5017 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5018 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5022 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5023 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5024 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5025 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5029 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5030 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5031 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5032 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5036 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5037 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5038 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5039 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5043 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5044 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5045 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5046 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5050 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5051 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5052 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5053 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5057 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5058 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5059 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5060 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5062 r
= MsiDoAction( hpkg
, "FileCost");
5063 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5067 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5068 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5069 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5070 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5074 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5075 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5076 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5077 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5081 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5082 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5083 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5084 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5088 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5089 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5090 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5091 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5095 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5096 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5097 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5098 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5102 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5103 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5104 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5105 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5109 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5110 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5111 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5112 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5116 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5117 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5118 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5119 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5123 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5124 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5125 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5126 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5130 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5131 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5132 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5133 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5137 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5138 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5139 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5140 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5144 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5145 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5146 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5147 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5151 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5152 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5153 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5154 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5158 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5159 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5160 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5161 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5165 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5166 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5167 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5168 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5172 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5173 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5174 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5175 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5179 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5180 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5181 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5182 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5186 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5187 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5188 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5189 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5193 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5194 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5195 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5196 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5200 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5201 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5202 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5203 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5207 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5208 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5209 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5210 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5214 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5215 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5216 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5217 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5221 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5222 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5223 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5224 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5228 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5229 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5230 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5231 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5235 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5236 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5237 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5238 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5242 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5243 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5244 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5245 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5249 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5250 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5251 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5252 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5256 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5257 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5258 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5259 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5263 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5264 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5265 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5266 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5270 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5271 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5272 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5273 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5277 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5278 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5279 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5280 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5282 r
= MsiDoAction( hpkg
, "CostFinalize");
5283 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5287 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5288 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5289 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5290 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5294 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5295 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5296 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5297 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5301 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5302 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5303 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5304 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5308 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5309 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5310 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5311 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5315 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5316 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5317 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5318 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5322 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5323 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5324 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5325 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5329 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5330 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5331 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5332 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5336 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5337 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5338 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5339 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5343 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5344 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5345 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5346 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5350 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5351 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5352 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5353 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5357 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5358 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5359 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5360 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5364 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5365 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5366 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5367 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5371 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5372 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5373 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5374 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5378 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5379 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5380 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5381 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5385 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5386 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5387 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5388 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5392 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5393 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5394 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5395 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5399 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5400 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5401 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5402 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5406 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5407 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5408 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5409 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5413 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5414 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5415 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5416 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5420 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5421 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5422 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5423 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5427 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5428 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5429 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5430 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5434 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5435 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5436 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5437 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5441 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5442 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5443 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5444 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5448 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5449 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5450 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5451 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5455 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5456 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5457 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5458 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5462 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5463 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5464 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5465 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5469 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5470 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5471 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5472 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5476 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5477 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5478 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5479 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5483 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5484 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5485 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5486 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5490 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5491 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5492 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5493 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5497 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5498 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5499 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5500 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5502 MsiCloseHandle(hpkg
);
5504 /* uninstall the product */
5505 r
= MsiInstallProduct(msifile2
, "REMOVE=ALL");
5506 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5508 /* all features installed from source */
5509 r
= MsiInstallProduct(msifile3
, "ADDSOURCE=ALL");
5510 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5512 r
= MsiOpenDatabase(msifile3
, MSIDBOPEN_DIRECT
, &hdb
);
5513 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
5515 /* this property must not be in the saved msi file */
5516 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5517 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
5519 r
= package_from_db( hdb
, &hpkg
);
5520 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
5524 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5525 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5526 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5527 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5531 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5532 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5533 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5534 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5538 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5539 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5540 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5541 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5545 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5546 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5547 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5548 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5552 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5553 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5554 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5555 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5559 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5560 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5561 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5562 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5566 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5567 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5568 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5569 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5573 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5574 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5575 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5576 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5580 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5581 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5582 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5583 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5587 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5588 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5589 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5590 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5594 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5595 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5596 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5597 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5601 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5602 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5603 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5604 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5608 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5609 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5610 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5611 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5615 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5616 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5617 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5618 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5622 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5623 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5624 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5625 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5629 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5630 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5631 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5632 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5636 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5637 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5638 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5639 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5643 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5644 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5645 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5646 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5650 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5651 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5652 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5653 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5657 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5658 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5659 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5660 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5664 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5665 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5666 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5667 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5671 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5672 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5673 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5674 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5678 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5679 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5680 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5681 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5685 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5686 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5687 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5688 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5692 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5693 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5694 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5695 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5699 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5700 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5701 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5702 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5706 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5707 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5708 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5709 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5713 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5714 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5715 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5716 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5720 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5721 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5722 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5723 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5727 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5728 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5729 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5730 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5734 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5735 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5736 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5737 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5739 r
= MsiDoAction( hpkg
, "CostInitialize");
5740 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5744 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5745 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5746 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5747 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5751 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5752 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5753 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5754 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5758 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5759 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5760 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5761 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5765 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5766 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5767 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5768 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5772 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5773 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5774 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5775 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5779 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5780 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5781 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5782 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5786 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5787 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5788 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5789 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5793 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5794 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5795 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5796 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5800 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5801 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5802 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5803 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5807 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5808 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5809 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5810 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5814 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5815 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5816 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5817 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5821 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5822 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5823 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5824 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5828 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5829 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5830 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5831 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5835 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5836 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5837 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5838 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5842 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5843 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5844 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5845 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5849 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5850 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5851 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5852 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5856 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5857 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5858 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5859 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5863 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5864 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5865 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5866 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5870 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5871 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5872 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5873 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5877 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5878 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5879 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5880 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5884 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5885 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5886 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5887 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5891 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5892 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5893 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5894 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5898 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5899 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5900 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5901 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5905 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5906 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5907 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5908 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5912 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5913 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5914 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5915 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5919 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5920 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5921 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5922 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5926 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5927 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5928 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5929 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5933 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5934 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5935 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5936 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5940 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5941 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5942 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5943 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5947 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5948 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5949 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5950 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5954 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5955 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5956 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5957 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5959 r
= MsiDoAction( hpkg
, "FileCost");
5960 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5964 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5965 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5966 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5967 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5971 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5972 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5973 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5974 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5978 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5979 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5980 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5981 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5985 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5986 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5987 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5988 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5992 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5993 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5994 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5995 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5999 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6000 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6001 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6002 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6006 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6007 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6008 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6009 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6013 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6014 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6015 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6016 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6020 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6021 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6022 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6023 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6027 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6028 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6029 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6030 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6034 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6035 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6036 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6037 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6041 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6042 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6043 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6044 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6048 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6049 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6050 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6051 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6055 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6056 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6057 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6058 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6062 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6063 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6064 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6065 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6069 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6070 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6071 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6072 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6076 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6077 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6078 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6079 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6083 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6084 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6085 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6086 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6090 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6091 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6092 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6093 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6097 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6098 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6099 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6100 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6104 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6105 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6106 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6107 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6111 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6112 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6113 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6114 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6118 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6119 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6120 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6121 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6125 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6126 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6127 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6128 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6132 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6133 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6134 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6135 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6139 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6140 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6141 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6142 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6146 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6147 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6148 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6149 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6153 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6154 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6155 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6156 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6160 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6161 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6162 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6163 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6167 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6168 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6169 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6170 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6174 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6175 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6176 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6177 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6179 r
= MsiDoAction( hpkg
, "CostFinalize");
6180 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
6184 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6185 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6186 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6187 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6191 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6192 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6193 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6194 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6198 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6199 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6200 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6201 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6205 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6206 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6207 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6208 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6212 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6213 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6214 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6215 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6219 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6220 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6221 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6222 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6226 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6227 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6228 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6229 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6233 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6234 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6235 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6236 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6240 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6241 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6242 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6243 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6247 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6248 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6249 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6250 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6254 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6255 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6256 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6257 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6261 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6262 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6263 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6264 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6268 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6269 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6270 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6271 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6275 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6276 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6277 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6278 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6282 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6283 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6284 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6285 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6289 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6290 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6291 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6292 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6296 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6297 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6298 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6299 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6303 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6304 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6305 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6306 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6310 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6311 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6312 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6313 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6317 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6318 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6319 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6320 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6324 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6325 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6326 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6327 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6331 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6332 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6333 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6334 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6338 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6339 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6340 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6341 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6345 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6346 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6347 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6348 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6352 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6353 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6354 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6355 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6359 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6360 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6361 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6362 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6366 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6367 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6368 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6369 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6373 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6374 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6375 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6376 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6380 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6381 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6382 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6383 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6387 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6388 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6389 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6390 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6394 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6395 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6396 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6397 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6399 MsiCloseHandle(hpkg
);
6401 /* reinstall the product */
6402 r
= MsiInstallProduct(msifile3
, "REINSTALL=ALL");
6403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6405 r
= MsiOpenDatabase(msifile4
, MSIDBOPEN_DIRECT
, &hdb
);
6406 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
6408 /* this property must not be in the saved msi file */
6409 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6410 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
6412 r
= package_from_db( hdb
, &hpkg
);
6413 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
6417 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6418 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6419 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6420 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6424 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6425 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6426 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6427 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6431 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6432 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6433 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6434 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6438 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6439 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6440 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6441 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6445 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6446 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6447 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6448 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6452 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6453 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6454 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6455 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6459 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6460 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6461 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6462 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6466 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6467 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6468 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6469 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6473 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6474 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6475 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6476 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6480 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6481 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6482 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6483 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6487 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6488 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6489 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6490 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6494 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6495 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6496 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6497 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6501 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6502 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6503 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6504 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6508 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6509 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6510 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6511 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6515 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6516 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6517 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6518 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6522 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6523 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6524 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6525 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6529 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6530 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6531 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6532 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6536 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6537 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6538 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6539 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6543 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6544 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6545 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6546 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6550 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6551 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6552 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6553 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6557 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6558 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6559 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6560 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6564 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6565 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6566 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6567 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6571 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6572 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6573 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6574 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6578 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6579 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6580 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6581 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6585 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6586 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6587 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6588 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6592 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6593 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6594 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6595 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6599 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6600 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6601 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6602 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6606 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6607 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6608 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6609 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6613 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6614 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6615 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6616 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6620 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6621 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6622 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6623 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6627 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6628 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6629 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6630 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6632 r
= MsiDoAction( hpkg
, "CostInitialize");
6633 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
6637 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6638 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6639 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6640 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6644 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6645 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6646 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6647 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6651 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6652 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6653 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6654 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6658 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6659 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6660 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6661 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6665 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6666 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6667 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6668 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6672 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6673 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6674 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6675 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6679 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6680 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6681 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6682 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6686 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6687 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6688 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6689 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6693 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6694 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6695 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6696 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6700 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6701 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6702 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6703 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6707 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6708 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6709 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6710 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6714 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6715 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6716 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6717 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6721 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6722 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6723 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6724 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6728 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6729 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6730 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6731 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6735 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6736 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6737 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6738 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6742 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6743 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6744 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6745 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6749 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6750 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6751 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6752 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6756 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6757 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6758 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6759 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6763 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6764 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6765 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6766 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6770 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6771 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6772 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6773 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6777 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6778 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6779 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6780 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6784 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6785 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6786 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6787 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6791 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6792 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6793 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6794 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6798 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6799 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6800 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6801 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6805 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6806 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6807 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6808 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6812 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6813 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6814 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6815 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6819 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6820 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6821 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6822 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6826 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6827 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6828 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6829 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6833 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6834 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6835 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6836 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6840 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6841 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6842 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6843 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6847 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6848 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6849 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6850 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6852 r
= MsiDoAction( hpkg
, "FileCost");
6853 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
6857 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6858 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6859 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6860 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6864 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6865 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6866 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6867 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6871 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6872 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6873 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6874 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6878 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6879 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6880 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6881 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6885 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6886 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6887 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6888 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6892 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6893 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6894 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6895 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6899 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6900 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6901 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6902 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6906 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6907 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6908 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6909 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6913 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6914 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6915 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6916 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6920 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6921 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6922 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6923 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6927 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6928 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6929 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6930 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6934 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6935 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6936 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6937 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6941 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6942 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6943 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6944 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6948 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6949 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6950 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6951 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6955 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6956 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6957 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6958 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6962 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6963 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6964 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6965 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6969 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6970 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6971 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6972 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6976 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6977 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6978 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6979 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6983 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6984 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6985 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6986 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6990 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6991 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6992 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6993 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6997 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6998 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6999 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7000 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7004 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
7005 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7006 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7007 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7011 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
7012 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7013 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7014 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7018 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
7019 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7020 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7021 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7025 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
7026 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7027 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7028 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7032 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
7033 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7034 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7035 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7039 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
7040 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7041 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7042 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7046 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
7047 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7048 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7049 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7053 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
7054 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7055 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7056 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7060 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
7061 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7062 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7063 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7067 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
7068 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7069 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7070 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7072 r
= MsiDoAction( hpkg
, "CostFinalize");
7073 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
7077 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
7078 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7079 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7080 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7084 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
7085 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7086 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7087 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7091 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
7092 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7093 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7094 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7098 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
7099 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7100 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7101 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7105 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
7106 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7107 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7108 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7112 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
7113 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7114 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7115 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7119 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
7120 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7121 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7122 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7126 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
7127 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7128 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7129 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7133 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
7134 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7135 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7136 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7140 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
7141 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7142 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7143 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7147 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
7148 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7149 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7150 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7154 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
7155 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7156 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7157 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7161 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
7162 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7163 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7164 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7168 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
7169 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7170 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7171 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7175 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
7176 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7177 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7178 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7182 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
7183 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7184 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7185 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7189 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
7190 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7191 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7192 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7196 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
7197 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7198 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7199 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7203 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
7204 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7205 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7206 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7210 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
7211 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7212 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7213 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7217 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
7218 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7219 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7220 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7224 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
7225 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7226 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7227 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7231 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
7232 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7233 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7234 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7238 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
7239 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7240 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7241 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7245 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
7246 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7247 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7248 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7252 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
7253 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7254 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7255 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7259 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
7260 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7261 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7262 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7266 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
7267 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7268 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7269 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7273 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
7274 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7275 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7276 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7280 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
7281 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7282 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7283 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7287 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
7288 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7289 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7290 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7292 MsiCloseHandle(hpkg
);
7294 /* uninstall the product */
7295 r
= MsiInstallProduct(msifile4
, "REMOVE=ALL");
7296 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7298 DeleteFileA(msifile
);
7299 DeleteFileA(msifile2
);
7300 DeleteFileA(msifile3
);
7301 DeleteFileA(msifile4
);
7304 static void test_getproperty(void)
7306 MSIHANDLE hPackage
= 0;
7308 static CHAR empty
[] = "";
7312 r
= package_from_db(create_package_db(), &hPackage
);
7313 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
7315 skip("Not enough rights to perform tests\n");
7316 DeleteFile(msifile
);
7319 ok( r
== ERROR_SUCCESS
, "Failed to create package %u\n", r
);
7321 /* set the property */
7322 r
= MsiSetProperty(hPackage
, "Name", "Value");
7323 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7325 /* retrieve the size, NULL pointer */
7327 r
= MsiGetProperty(hPackage
, "Name", NULL
, &size
);
7328 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7329 ok( size
== 5, "Expected 5, got %d\n", size
);
7331 /* retrieve the size, empty string */
7333 r
= MsiGetProperty(hPackage
, "Name", empty
, &size
);
7334 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7335 ok( size
== 5, "Expected 5, got %d\n", size
);
7337 /* don't change size */
7338 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
7339 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7340 ok( size
== 5, "Expected 5, got %d\n", size
);
7341 ok( !lstrcmp(prop
, "Valu"), "Expected Valu, got %s\n", prop
);
7343 /* increase the size by 1 */
7345 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
7346 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7347 ok( size
== 5, "Expected 5, got %d\n", size
);
7348 ok( !lstrcmp(prop
, "Value"), "Expected Value, got %s\n", prop
);
7350 r
= MsiCloseHandle( hPackage
);
7351 ok( r
== ERROR_SUCCESS
, "Failed to close package\n" );
7352 DeleteFile(msifile
);
7355 static void test_removefiles(void)
7361 hdb
= create_package_db();
7362 ok ( hdb
, "failed to create package database\n" );
7364 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
7365 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
7367 r
= create_feature_table( hdb
);
7368 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
7370 r
= create_component_table( hdb
);
7371 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
7373 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
7374 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7376 r
= add_component_entry( hdb
, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7377 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7379 r
= add_component_entry( hdb
, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7380 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7382 r
= add_component_entry( hdb
, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7383 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7385 r
= add_component_entry( hdb
, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7386 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7388 r
= add_component_entry( hdb
, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7389 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7391 r
= add_component_entry( hdb
, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7392 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7394 r
= create_feature_components_table( hdb
);
7395 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
7397 r
= add_feature_components_entry( hdb
, "'one', 'hydrogen'" );
7398 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7400 r
= add_feature_components_entry( hdb
, "'one', 'helium'" );
7401 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7403 r
= add_feature_components_entry( hdb
, "'one', 'lithium'" );
7404 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7406 r
= add_feature_components_entry( hdb
, "'one', 'beryllium'" );
7407 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7409 r
= add_feature_components_entry( hdb
, "'one', 'boron'" );
7410 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7412 r
= add_feature_components_entry( hdb
, "'one', 'carbon'" );
7413 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7415 r
= create_file_table( hdb
);
7416 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
7418 r
= add_file_entry( hdb
, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7419 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7421 r
= add_file_entry( hdb
, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7422 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7424 r
= add_file_entry( hdb
, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7425 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7427 r
= add_file_entry( hdb
, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7428 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7430 r
= add_file_entry( hdb
, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7431 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7433 r
= add_file_entry( hdb
, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7434 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7436 r
= create_remove_file_table( hdb
);
7437 ok( r
== ERROR_SUCCESS
, "cannot create Remove File table: %d\n", r
);
7439 r
= package_from_db( hdb
, &hpkg
);
7440 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
7442 skip("Not enough rights to perform tests\n");
7443 DeleteFile(msifile
);
7446 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
7448 MsiCloseHandle( hdb
);
7450 create_test_file( "hydrogen.txt" );
7451 create_test_file( "helium.txt" );
7452 create_test_file( "lithium.txt" );
7453 create_test_file( "beryllium.txt" );
7454 create_test_file( "boron.txt" );
7455 create_test_file( "carbon.txt" );
7457 r
= MsiSetProperty( hpkg
, "TARGETDIR", CURR_DIR
);
7458 ok( r
== ERROR_SUCCESS
, "set property failed\n");
7460 r
= MsiDoAction( hpkg
, "CostInitialize");
7461 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
7463 r
= MsiDoAction( hpkg
, "FileCost");
7464 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7466 r
= MsiDoAction( hpkg
, "CostFinalize");
7467 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7469 r
= MsiDoAction( hpkg
, "InstallValidate");
7470 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7472 r
= MsiSetComponentState( hpkg
, "hydrogen", INSTALLSTATE_ABSENT
);
7473 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7475 r
= MsiSetComponentState( hpkg
, "helium", INSTALLSTATE_LOCAL
);
7476 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7478 r
= MsiSetComponentState( hpkg
, "lithium", INSTALLSTATE_SOURCE
);
7479 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7481 r
= MsiSetComponentState( hpkg
, "beryllium", INSTALLSTATE_ABSENT
);
7482 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7484 r
= MsiSetComponentState( hpkg
, "boron", INSTALLSTATE_LOCAL
);
7485 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7487 r
= MsiSetComponentState( hpkg
, "carbon", INSTALLSTATE_SOURCE
);
7488 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7490 r
= MsiDoAction( hpkg
, "RemoveFiles");
7491 ok( r
== ERROR_SUCCESS
, "remove files failed\n");
7493 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7494 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7495 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7496 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7497 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7498 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7500 MsiCloseHandle( hpkg
);
7501 DeleteFileA(msifile
);
7504 static void test_appsearch(void)
7509 CHAR prop
[MAX_PATH
];
7512 hdb
= create_package_db();
7513 ok ( hdb
, "failed to create package database\n" );
7515 r
= create_appsearch_table( hdb
);
7516 ok( r
== ERROR_SUCCESS
, "cannot create AppSearch table: %d\n", r
);
7518 r
= add_appsearch_entry( hdb
, "'WEBBROWSERPROG', 'NewSignature1'" );
7519 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
7521 r
= add_appsearch_entry( hdb
, "'NOTEPAD', 'NewSignature2'" );
7522 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
7524 r
= create_reglocator_table( hdb
);
7525 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7527 r
= add_reglocator_entry( hdb
, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7528 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7530 r
= create_drlocator_table( hdb
);
7531 ok( r
== ERROR_SUCCESS
, "cannot create DrLocator table: %d\n", r
);
7533 r
= add_drlocator_entry( hdb
, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7534 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7536 r
= create_signature_table( hdb
);
7537 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
7539 r
= add_signature_entry( hdb
, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7540 ok( r
== ERROR_SUCCESS
, "cannot add signature: %d\n", r
);
7542 r
= add_signature_entry( hdb
, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7543 ok( r
== ERROR_SUCCESS
, "cannot add signature: %d\n", r
);
7545 r
= package_from_db( hdb
, &hpkg
);
7546 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
7548 skip("Not enough rights to perform tests\n");
7549 DeleteFile(msifile
);
7552 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
7553 MsiCloseHandle( hdb
);
7554 if (r
!= ERROR_SUCCESS
)
7557 r
= MsiDoAction( hpkg
, "AppSearch" );
7558 ok( r
== ERROR_SUCCESS
, "AppSearch failed: %d\n", r
);
7560 size
= sizeof(prop
);
7561 r
= MsiGetPropertyA( hpkg
, "WEBBROWSERPROG", prop
, &size
);
7562 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
7565 ok( lstrlenA(prop
) != 0, "Expected non-zero length\n");
7568 size
= sizeof(prop
);
7569 r
= MsiGetPropertyA( hpkg
, "NOTEPAD", prop
, &size
);
7570 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
7573 MsiCloseHandle( hpkg
);
7574 DeleteFileA(msifile
);
7577 static void test_appsearch_complocator(void)
7579 MSIHANDLE hpkg
, hdb
;
7580 CHAR path
[MAX_PATH
];
7581 CHAR prop
[MAX_PATH
];
7586 if (!get_user_sid(&usersid
))
7589 if (is_process_limited())
7591 skip("process is limited\n");
7595 create_test_file("FileName1");
7596 create_test_file("FileName4");
7597 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE
,
7598 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL
, FALSE
);
7600 create_test_file("FileName2");
7601 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED
,
7602 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid
, FALSE
);
7604 create_test_file("FileName3");
7605 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED
,
7606 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid
, FALSE
);
7608 create_test_file("FileName5");
7609 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE
,
7610 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL
, TRUE
);
7612 create_test_file("FileName6");
7613 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE
,
7614 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL
, TRUE
);
7616 create_test_file("FileName7");
7617 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE
,
7618 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL
, FALSE
);
7620 /* dir is FALSE, but we're pretending it's a directory */
7621 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE
,
7622 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL
, FALSE
);
7624 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7625 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE
,
7626 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL
, FALSE
);
7628 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7629 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE
,
7630 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL
, FALSE
);
7632 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7633 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE
,
7634 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL
, FALSE
);
7636 hdb
= create_package_db();
7637 ok(hdb
, "Expected a valid database handle\n");
7639 r
= create_appsearch_table(hdb
);
7640 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7642 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
7643 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7645 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
7646 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7648 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
7649 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7651 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
7652 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7654 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
7655 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7657 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
7658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7660 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
7661 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7663 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
7664 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7666 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
7667 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7669 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
7670 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7672 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
7673 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7675 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
7676 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7678 r
= create_complocator_table(hdb
);
7679 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7681 /* published component, machine, file, signature, misdbLocatorTypeFile */
7682 r
= add_complocator_entry(hdb
, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7683 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7685 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7686 r
= add_complocator_entry(hdb
, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7687 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7689 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7690 r
= add_complocator_entry(hdb
, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7691 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7693 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7694 r
= add_complocator_entry(hdb
, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7695 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7697 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7698 r
= add_complocator_entry(hdb
, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7699 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7701 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7702 r
= add_complocator_entry(hdb
, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7703 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7705 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7706 r
= add_complocator_entry(hdb
, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7709 /* unpublished component, no signature, misdbLocatorTypeDir */
7710 r
= add_complocator_entry(hdb
, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7711 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7713 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7714 r
= add_complocator_entry(hdb
, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7715 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7717 /* published component, signature w/ ver, misdbLocatorTypeFile */
7718 r
= add_complocator_entry(hdb
, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7719 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7721 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7722 r
= add_complocator_entry(hdb
, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7723 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7725 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7726 r
= add_complocator_entry(hdb
, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7727 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7729 r
= create_signature_table(hdb
);
7730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7732 r
= add_signature_entry(hdb
, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7733 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7735 r
= add_signature_entry(hdb
, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7736 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7738 r
= add_signature_entry(hdb
, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7739 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7741 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7742 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7744 r
= add_signature_entry(hdb
, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7745 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7747 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7750 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7751 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7753 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7754 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7756 r
= package_from_db(hdb
, &hpkg
);
7757 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
7759 skip("Not enough rights to perform tests\n");
7762 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
7764 r
= MsiSetPropertyA(hpkg
, "SIGPROP8", "october");
7765 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7767 r
= MsiDoAction(hpkg
, "AppSearch");
7768 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7771 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7772 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
7773 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7774 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7777 sprintf(path
, "%s\\FileName2", CURR_DIR
);
7778 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
7779 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7780 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7783 sprintf(path
, "%s\\FileName3", CURR_DIR
);
7784 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
7785 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7786 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7789 sprintf(path
, "%s\\FileName4", CURR_DIR
);
7790 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
7791 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7792 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7795 sprintf(path
, "%s\\FileName5", CURR_DIR
);
7796 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
7797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7798 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7801 sprintf(path
, "%s\\", CURR_DIR
);
7802 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
7803 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7804 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7807 sprintf(path
, "%s\\", CURR_DIR
);
7808 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
7809 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7810 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7813 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
7814 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7815 ok(!lstrcmpA(prop
, "october"), "Expected \"october\", got \"%s\"\n", prop
);
7818 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
7819 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7820 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7823 sprintf(path
, "%s\\FileName8.dll", CURR_DIR
);
7824 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
7825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7826 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7829 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
7830 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7831 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7834 sprintf(path
, "%s\\FileName10.dll", CURR_DIR
);
7835 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
7836 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7837 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7839 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7840 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7841 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7842 MSIINSTALLCONTEXT_USERUNMANAGED
, usersid
);
7843 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7844 MSIINSTALLCONTEXT_USERMANAGED
, usersid
);
7845 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7846 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7847 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7848 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7849 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7850 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7851 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7852 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7853 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7854 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7855 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7856 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7857 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7858 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7860 MsiCloseHandle(hpkg
);
7863 DeleteFileA("FileName1");
7864 DeleteFileA("FileName2");
7865 DeleteFileA("FileName3");
7866 DeleteFileA("FileName4");
7867 DeleteFileA("FileName5");
7868 DeleteFileA("FileName6");
7869 DeleteFileA("FileName7");
7870 DeleteFileA("FileName8.dll");
7871 DeleteFileA("FileName9.dll");
7872 DeleteFileA("FileName10.dll");
7873 DeleteFileA(msifile
);
7877 static void test_appsearch_reglocator(void)
7879 MSIHANDLE hpkg
, hdb
;
7880 CHAR path
[MAX_PATH
], prop
[MAX_PATH
];
7881 DWORD binary
[2], size
, val
;
7882 BOOL space
, version
;
7883 HKEY hklm
, classes
, hkcu
, users
;
7884 LPSTR pathdata
, pathvar
, ptr
;
7890 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7893 DeleteFileA("test.dll");
7895 res
= RegCreateKeyA(HKEY_CLASSES_ROOT
, "Software\\Wine", &classes
);
7896 if (res
== ERROR_ACCESS_DENIED
)
7898 skip("Not enough rights to perform tests\n");
7901 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7903 res
= RegSetValueExA(classes
, "Value1", 0, REG_SZ
,
7904 (const BYTE
*)"regszdata", 10);
7905 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7907 res
= RegCreateKeyA(HKEY_CURRENT_USER
, "Software\\Wine", &hkcu
);
7908 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7910 res
= RegSetValueExA(hkcu
, "Value1", 0, REG_SZ
,
7911 (const BYTE
*)"regszdata", 10);
7912 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7915 res
= RegCreateKeyA(HKEY_USERS
, "S-1-5-18\\Software\\Wine", &users
);
7916 ok(res
== ERROR_SUCCESS
||
7917 broken(res
== ERROR_INVALID_PARAMETER
),
7918 "Expected ERROR_SUCCESS, got %d\n", res
);
7920 if (res
== ERROR_SUCCESS
)
7922 res
= RegSetValueExA(users
, "Value1", 0, REG_SZ
,
7923 (const BYTE
*)"regszdata", 10);
7924 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7927 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine", &hklm
);
7928 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7930 res
= RegSetValueA(hklm
, NULL
, REG_SZ
, "defvalue", 8);
7931 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7933 res
= RegSetValueExA(hklm
, "Value1", 0, REG_SZ
,
7934 (const BYTE
*)"regszdata", 10);
7935 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7938 res
= RegSetValueExA(hklm
, "Value2", 0, REG_DWORD
,
7939 (const BYTE
*)&val
, sizeof(DWORD
));
7940 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7943 res
= RegSetValueExA(hklm
, "Value3", 0, REG_DWORD
,
7944 (const BYTE
*)&val
, sizeof(DWORD
));
7945 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7947 res
= RegSetValueExA(hklm
, "Value4", 0, REG_EXPAND_SZ
,
7948 (const BYTE
*)"%PATH%", 7);
7949 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7951 res
= RegSetValueExA(hklm
, "Value5", 0, REG_EXPAND_SZ
,
7952 (const BYTE
*)"my%NOVAR%", 10);
7953 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7955 res
= RegSetValueExA(hklm
, "Value6", 0, REG_MULTI_SZ
,
7956 (const BYTE
*)"one\0two\0", 9);
7957 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7959 binary
[0] = 0x1234abcd;
7960 binary
[1] = 0x567890ef;
7961 res
= RegSetValueExA(hklm
, "Value7", 0, REG_BINARY
,
7962 (const BYTE
*)binary
, sizeof(binary
));
7963 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7965 res
= RegSetValueExA(hklm
, "Value8", 0, REG_SZ
,
7966 (const BYTE
*)"#regszdata", 11);
7967 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7969 create_test_file("FileName1");
7970 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7971 res
= RegSetValueExA(hklm
, "Value9", 0, REG_SZ
,
7972 (const BYTE
*)path
, lstrlenA(path
) + 1);
7973 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7975 sprintf(path
, "%s\\FileName2", CURR_DIR
);
7976 res
= RegSetValueExA(hklm
, "Value10", 0, REG_SZ
,
7977 (const BYTE
*)path
, lstrlenA(path
) + 1);
7978 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7980 lstrcpyA(path
, CURR_DIR
);
7981 res
= RegSetValueExA(hklm
, "Value11", 0, REG_SZ
,
7982 (const BYTE
*)path
, lstrlenA(path
) + 1);
7983 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7985 res
= RegSetValueExA(hklm
, "Value12", 0, REG_SZ
,
7986 (const BYTE
*)"", 1);
7987 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7989 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7990 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
7991 res
= RegSetValueExA(hklm
, "Value13", 0, REG_SZ
,
7992 (const BYTE
*)path
, lstrlenA(path
) + 1);
7993 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7995 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7996 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
7997 res
= RegSetValueExA(hklm
, "Value14", 0, REG_SZ
,
7998 (const BYTE
*)path
, lstrlenA(path
) + 1);
7999 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8001 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8002 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
8003 res
= RegSetValueExA(hklm
, "Value15", 0, REG_SZ
,
8004 (const BYTE
*)path
, lstrlenA(path
) + 1);
8005 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8007 sprintf(path
, "\"%s\\FileName1\" -option", CURR_DIR
);
8008 res
= RegSetValueExA(hklm
, "value16", 0, REG_SZ
,
8009 (const BYTE
*)path
, lstrlenA(path
) + 1);
8011 space
= (strchr(CURR_DIR
, ' ')) ? TRUE
: FALSE
;
8012 sprintf(path
, "%s\\FileName1 -option", CURR_DIR
);
8013 res
= RegSetValueExA(hklm
, "value17", 0, REG_SZ
,
8014 (const BYTE
*)path
, lstrlenA(path
) + 1);
8016 hdb
= create_package_db();
8017 ok(hdb
, "Expected a valid database handle\n");
8019 r
= create_appsearch_table(hdb
);
8020 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8022 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8023 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8025 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8026 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8028 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8029 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8031 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8032 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8034 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8035 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8037 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8038 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8040 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8041 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8043 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8044 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8046 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8047 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8049 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8050 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8052 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8053 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8055 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
8056 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8058 r
= add_appsearch_entry(hdb
, "'SIGPROP13', 'NewSignature13'");
8059 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8061 r
= add_appsearch_entry(hdb
, "'SIGPROP14', 'NewSignature14'");
8062 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8064 r
= add_appsearch_entry(hdb
, "'SIGPROP15', 'NewSignature15'");
8065 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8067 r
= add_appsearch_entry(hdb
, "'SIGPROP16', 'NewSignature16'");
8068 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8070 r
= add_appsearch_entry(hdb
, "'SIGPROP17', 'NewSignature17'");
8071 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8073 r
= add_appsearch_entry(hdb
, "'SIGPROP18', 'NewSignature18'");
8074 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8076 r
= add_appsearch_entry(hdb
, "'SIGPROP19', 'NewSignature19'");
8077 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8079 r
= add_appsearch_entry(hdb
, "'SIGPROP20', 'NewSignature20'");
8080 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8082 r
= add_appsearch_entry(hdb
, "'SIGPROP21', 'NewSignature21'");
8083 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8085 r
= add_appsearch_entry(hdb
, "'SIGPROP22', 'NewSignature22'");
8086 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8088 r
= add_appsearch_entry(hdb
, "'SIGPROP23', 'NewSignature23'");
8089 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8091 r
= add_appsearch_entry(hdb
, "'SIGPROP24', 'NewSignature24'");
8092 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8094 r
= add_appsearch_entry(hdb
, "'SIGPROP25', 'NewSignature25'");
8095 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8097 r
= add_appsearch_entry(hdb
, "'SIGPROP26', 'NewSignature26'");
8098 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8100 r
= add_appsearch_entry(hdb
, "'SIGPROP27', 'NewSignature27'");
8101 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8103 r
= add_appsearch_entry(hdb
, "'SIGPROP28', 'NewSignature28'");
8104 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8106 r
= add_appsearch_entry(hdb
, "'SIGPROP29', 'NewSignature29'");
8107 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8109 r
= add_appsearch_entry(hdb
, "'SIGPROP30', 'NewSignature30'");
8110 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8112 r
= create_reglocator_table(hdb
);
8113 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8115 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8116 str
= "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
8117 r
= add_reglocator_entry(hdb
, str
);
8118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8120 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8121 str
= "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
8122 r
= add_reglocator_entry(hdb
, str
);
8123 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8125 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8126 str
= "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
8127 r
= add_reglocator_entry(hdb
, str
);
8128 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8130 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8131 str
= "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
8132 r
= add_reglocator_entry(hdb
, str
);
8133 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8135 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8136 str
= "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
8137 r
= add_reglocator_entry(hdb
, str
);
8138 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8140 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8141 str
= "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
8142 r
= add_reglocator_entry(hdb
, str
);
8143 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8145 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8146 str
= "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
8147 r
= add_reglocator_entry(hdb
, str
);
8148 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8150 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8151 str
= "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
8152 r
= add_reglocator_entry(hdb
, str
);
8153 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8155 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8156 str
= "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
8157 r
= add_reglocator_entry(hdb
, str
);
8158 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8160 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8161 str
= "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
8162 r
= add_reglocator_entry(hdb
, str
);
8163 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8165 /* HKLM, msidbLocatorTypeFileName, no signature */
8166 str
= "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
8167 r
= add_reglocator_entry(hdb
, str
);
8168 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8170 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8171 str
= "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
8172 r
= add_reglocator_entry(hdb
, str
);
8173 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8175 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8176 str
= "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
8177 r
= add_reglocator_entry(hdb
, str
);
8178 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8180 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8181 str
= "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
8182 r
= add_reglocator_entry(hdb
, str
);
8183 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8185 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8186 str
= "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
8187 r
= add_reglocator_entry(hdb
, str
);
8188 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8190 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8191 str
= "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
8192 r
= add_reglocator_entry(hdb
, str
);
8193 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8195 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8196 str
= "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
8197 r
= add_reglocator_entry(hdb
, str
);
8198 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8200 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8201 str
= "'NewSignature18', 2, 'Software\\Wine', '', 2";
8202 r
= add_reglocator_entry(hdb
, str
);
8203 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8205 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8206 str
= "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
8207 r
= add_reglocator_entry(hdb
, str
);
8208 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8210 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8211 str
= "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
8212 r
= add_reglocator_entry(hdb
, str
);
8213 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8215 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8216 str
= "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
8217 r
= add_reglocator_entry(hdb
, str
);
8218 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8220 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8221 str
= "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
8222 r
= add_reglocator_entry(hdb
, str
);
8223 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8225 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8226 str
= "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
8227 r
= add_reglocator_entry(hdb
, str
);
8228 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8230 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8231 str
= "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
8232 r
= add_reglocator_entry(hdb
, str
);
8233 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8235 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8236 str
= "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
8237 r
= add_reglocator_entry(hdb
, str
);
8238 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8240 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8241 str
= "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
8242 r
= add_reglocator_entry(hdb
, str
);
8243 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8245 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8246 str
= "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
8247 r
= add_reglocator_entry(hdb
, str
);
8248 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8250 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8251 str
= "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
8252 r
= add_reglocator_entry(hdb
, str
);
8253 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8255 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8256 str
= "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
8257 r
= add_reglocator_entry(hdb
, str
);
8258 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8260 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8261 str
= "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
8262 r
= add_reglocator_entry(hdb
, str
);
8263 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8265 r
= create_signature_table(hdb
);
8266 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8268 str
= "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8269 r
= add_signature_entry(hdb
, str
);
8270 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8272 str
= "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8273 r
= add_signature_entry(hdb
, str
);
8274 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8276 str
= "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8277 r
= add_signature_entry(hdb
, str
);
8278 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8280 str
= "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8281 r
= add_signature_entry(hdb
, str
);
8282 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8284 str
= "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8285 r
= add_signature_entry(hdb
, str
);
8286 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8288 str
= "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8289 r
= add_signature_entry(hdb
, str
);
8290 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8292 ptr
= strrchr(CURR_DIR
, '\\') + 1;
8293 sprintf(path
, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr
);
8294 r
= add_signature_entry(hdb
, path
);
8295 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8297 str
= "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8298 r
= add_signature_entry(hdb
, str
);
8299 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8301 str
= "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8302 r
= add_signature_entry(hdb
, str
);
8303 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8305 str
= "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8306 r
= add_signature_entry(hdb
, str
);
8307 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8309 r
= package_from_db(hdb
, &hpkg
);
8310 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
8312 r
= MsiDoAction(hpkg
, "AppSearch");
8313 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8316 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8317 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8318 ok(!lstrcmpA(prop
, "regszdata"),
8319 "Expected \"regszdata\", got \"%s\"\n", prop
);
8322 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8323 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8324 ok(!lstrcmpA(prop
, "#42"), "Expected \"#42\", got \"%s\"\n", prop
);
8327 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8328 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8329 ok(!lstrcmpA(prop
, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop
);
8331 size
= ExpandEnvironmentStringsA("%PATH%", NULL
, 0);
8332 if (size
== 0 && GetLastError() == ERROR_INVALID_PARAMETER
)
8334 /* Workaround for Win95 */
8336 size
= ExpandEnvironmentStringsA("%PATH%", tempbuf
, 0);
8338 pathvar
= HeapAlloc(GetProcessHeap(), 0, size
);
8339 ExpandEnvironmentStringsA("%PATH%", pathvar
, size
);
8342 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", NULL
, &size
);
8343 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8345 pathdata
= HeapAlloc(GetProcessHeap(), 0, ++size
);
8346 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", pathdata
, &size
);
8347 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8348 ok(!lstrcmpA(pathdata
, pathvar
),
8349 "Expected \"%s\", got \"%s\"\n", pathvar
, pathdata
);
8351 HeapFree(GetProcessHeap(), 0, pathvar
);
8352 HeapFree(GetProcessHeap(), 0, pathdata
);
8355 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8356 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8358 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop
);
8361 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8362 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8365 ok(!memcmp(prop
, "\0one\0two\0\0", 10),
8366 "Expected \"\\0one\\0two\\0\\0\"\n");
8370 lstrcpyA(path
, "#xCDAB3412EF907856");
8371 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8372 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8373 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8376 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8377 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8378 ok(!lstrcmpA(prop
, "##regszdata"),
8379 "Expected \"##regszdata\", got \"%s\"\n", prop
);
8382 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8383 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8384 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8385 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8388 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8389 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8390 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8393 sprintf(path
, "%s\\", CURR_DIR
);
8394 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8395 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8396 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8399 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
8400 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8401 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8404 sprintf(path
, "%s\\", CURR_DIR
);
8405 r
= MsiGetPropertyA(hpkg
, "SIGPROP13", prop
, &size
);
8406 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8407 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8410 r
= MsiGetPropertyA(hpkg
, "SIGPROP14", prop
, &size
);
8411 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8412 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8415 r
= MsiGetPropertyA(hpkg
, "SIGPROP15", prop
, &size
);
8416 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8417 ok(!lstrcmpA(prop
, "regszdata"),
8418 "Expected \"regszdata\", got \"%s\"\n", prop
);
8421 r
= MsiGetPropertyA(hpkg
, "SIGPROP16", prop
, &size
);
8422 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8423 ok(!lstrcmpA(prop
, "regszdata"),
8424 "Expected \"regszdata\", got \"%s\"\n", prop
);
8429 r
= MsiGetPropertyA(hpkg
, "SIGPROP17", prop
, &size
);
8430 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8431 ok(!lstrcmpA(prop
, "regszdata"),
8432 "Expected \"regszdata\", got \"%s\"\n", prop
);
8436 r
= MsiGetPropertyA(hpkg
, "SIGPROP18", prop
, &size
);
8437 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8438 ok(!lstrcmpA(prop
, "defvalue"),
8439 "Expected \"defvalue\", got \"%s\"\n", prop
);
8442 r
= MsiGetPropertyA(hpkg
, "SIGPROP19", prop
, &size
);
8443 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8444 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8447 r
= MsiGetPropertyA(hpkg
, "SIGPROP20", prop
, &size
);
8448 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8449 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8454 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8455 r
= MsiGetPropertyA(hpkg
, "SIGPROP21", prop
, &size
);
8456 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8457 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8460 r
= MsiGetPropertyA(hpkg
, "SIGPROP22", prop
, &size
);
8461 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8462 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8465 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
8466 r
= MsiGetPropertyA(hpkg
, "SIGPROP23", prop
, &size
);
8467 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8468 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8472 lstrcpyA(path
, CURR_DIR
);
8473 ptr
= strrchr(path
, '\\') + 1;
8475 r
= MsiGetPropertyA(hpkg
, "SIGPROP24", prop
, &size
);
8476 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8477 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8480 sprintf(path
, "%s\\", CURR_DIR
);
8481 r
= MsiGetPropertyA(hpkg
, "SIGPROP25", prop
, &size
);
8482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8483 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8486 r
= MsiGetPropertyA(hpkg
, "SIGPROP26", prop
, &size
);
8487 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8488 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8491 r
= MsiGetPropertyA(hpkg
, "SIGPROP27", prop
, &size
);
8492 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8493 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8496 r
= MsiGetPropertyA(hpkg
, "SIGPROP28", prop
, &size
);
8497 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8498 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8501 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8502 r
= MsiGetPropertyA(hpkg
, "SIGPROP29", prop
, &size
);
8503 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8504 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8507 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8508 r
= MsiGetPropertyA(hpkg
, "SIGPROP30", prop
, &size
);
8509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8511 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8513 todo_wine
ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8515 RegSetValueA(hklm
, NULL
, REG_SZ
, "", 0);
8516 RegDeleteValueA(hklm
, "Value1");
8517 RegDeleteValueA(hklm
, "Value2");
8518 RegDeleteValueA(hklm
, "Value3");
8519 RegDeleteValueA(hklm
, "Value4");
8520 RegDeleteValueA(hklm
, "Value5");
8521 RegDeleteValueA(hklm
, "Value6");
8522 RegDeleteValueA(hklm
, "Value7");
8523 RegDeleteValueA(hklm
, "Value8");
8524 RegDeleteValueA(hklm
, "Value9");
8525 RegDeleteValueA(hklm
, "Value10");
8526 RegDeleteValueA(hklm
, "Value11");
8527 RegDeleteValueA(hklm
, "Value12");
8528 RegDeleteValueA(hklm
, "Value13");
8529 RegDeleteValueA(hklm
, "Value14");
8530 RegDeleteValueA(hklm
, "Value15");
8531 RegDeleteValueA(hklm
, "Value16");
8532 RegDeleteValueA(hklm
, "Value17");
8533 RegDeleteKey(hklm
, "");
8536 RegDeleteValueA(classes
, "Value1");
8537 RegDeleteKeyA(classes
, "");
8538 RegCloseKey(classes
);
8540 RegDeleteValueA(hkcu
, "Value1");
8541 RegDeleteKeyA(hkcu
, "");
8544 RegDeleteValueA(users
, "Value1");
8545 RegDeleteKeyA(users
, "");
8548 DeleteFileA("FileName1");
8549 DeleteFileA("FileName3.dll");
8550 DeleteFileA("FileName4.dll");
8551 DeleteFileA("FileName5.dll");
8552 MsiCloseHandle(hpkg
);
8553 DeleteFileA(msifile
);
8556 static void delete_win_ini(LPCSTR file
)
8558 CHAR path
[MAX_PATH
];
8560 GetWindowsDirectoryA(path
, MAX_PATH
);
8561 lstrcatA(path
, "\\");
8562 lstrcatA(path
, file
);
8567 static void test_appsearch_inilocator(void)
8569 MSIHANDLE hpkg
, hdb
;
8570 CHAR path
[MAX_PATH
];
8571 CHAR prop
[MAX_PATH
];
8579 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8582 DeleteFileA("test.dll");
8584 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8586 create_test_file("FileName1");
8587 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8588 WritePrivateProfileStringA("Section", "Key2", path
, "IniFile.ini");
8590 WritePrivateProfileStringA("Section", "Key3", CURR_DIR
, "IniFile.ini");
8592 sprintf(path
, "%s\\IDontExist", CURR_DIR
);
8593 WritePrivateProfileStringA("Section", "Key4", path
, "IniFile.ini");
8595 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8596 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
8597 WritePrivateProfileStringA("Section", "Key5", path
, "IniFile.ini");
8599 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8600 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8601 WritePrivateProfileStringA("Section", "Key6", path
, "IniFile.ini");
8603 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8604 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
8605 WritePrivateProfileStringA("Section", "Key7", path
, "IniFile.ini");
8607 hdb
= create_package_db();
8608 ok(hdb
, "Expected a valid database handle\n");
8610 r
= create_appsearch_table(hdb
);
8611 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8613 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8614 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8616 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8617 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8619 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8620 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8622 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8623 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8625 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8626 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8628 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8629 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8631 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8632 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8634 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8635 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8637 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8638 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8640 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8641 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8643 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8644 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8646 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
8647 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8649 r
= create_inilocator_table(hdb
);
8650 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8652 /* msidbLocatorTypeRawValue, field 1 */
8653 str
= "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8654 r
= add_inilocator_entry(hdb
, str
);
8655 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8657 /* msidbLocatorTypeRawValue, field 2 */
8658 str
= "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8659 r
= add_inilocator_entry(hdb
, str
);
8660 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8662 /* msidbLocatorTypeRawValue, entire field */
8663 str
= "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8664 r
= add_inilocator_entry(hdb
, str
);
8665 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8667 /* msidbLocatorTypeFile */
8668 str
= "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8669 r
= add_inilocator_entry(hdb
, str
);
8670 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8672 /* msidbLocatorTypeDirectory, file */
8673 str
= "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8674 r
= add_inilocator_entry(hdb
, str
);
8675 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8677 /* msidbLocatorTypeDirectory, directory */
8678 str
= "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8679 r
= add_inilocator_entry(hdb
, str
);
8680 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8682 /* msidbLocatorTypeFile, file, no signature */
8683 str
= "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8684 r
= add_inilocator_entry(hdb
, str
);
8685 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8687 /* msidbLocatorTypeFile, dir, no signature */
8688 str
= "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8689 r
= add_inilocator_entry(hdb
, str
);
8690 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8692 /* msidbLocatorTypeFile, file does not exist */
8693 str
= "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8694 r
= add_inilocator_entry(hdb
, str
);
8695 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8697 /* msidbLocatorTypeFile, signature with version */
8698 str
= "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8699 r
= add_inilocator_entry(hdb
, str
);
8700 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8702 /* msidbLocatorTypeFile, signature with version, ver > max */
8703 str
= "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8704 r
= add_inilocator_entry(hdb
, str
);
8705 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8707 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8708 str
= "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8709 r
= add_inilocator_entry(hdb
, str
);
8710 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8712 r
= create_signature_table(hdb
);
8713 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8715 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8716 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8718 r
= add_signature_entry(hdb
, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8719 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8721 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8722 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8724 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8725 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8727 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8728 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8730 r
= package_from_db(hdb
, &hpkg
);
8731 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
8733 skip("Not enough rights to perform tests\n");
8736 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
8738 r
= MsiDoAction(hpkg
, "AppSearch");
8739 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8742 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8743 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8744 ok(!lstrcmpA(prop
, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop
);
8747 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8749 ok(!lstrcmpA(prop
, "field2"), "Expected \"field2\", got \"%s\"\n", prop
);
8752 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8753 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8754 ok(!lstrcmpA(prop
, "keydata,field2"),
8755 "Expected \"keydata,field2\", got \"%s\"\n", prop
);
8758 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8759 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
8760 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8761 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8764 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8765 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8766 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8769 sprintf(path
, "%s\\", CURR_DIR
);
8770 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8771 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8772 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8775 sprintf(path
, "%s\\", CURR_DIR
);
8776 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8777 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8778 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8781 lstrcpyA(path
, CURR_DIR
);
8782 ptr
= strrchr(path
, '\\');
8784 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8785 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8786 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8789 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8790 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8791 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8796 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
8797 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8799 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8802 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8803 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8804 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8807 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
8808 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
8809 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8810 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8813 MsiCloseHandle(hpkg
);
8816 delete_win_ini("IniFile.ini");
8817 DeleteFileA("FileName1");
8818 DeleteFileA("FileName2.dll");
8819 DeleteFileA("FileName3.dll");
8820 DeleteFileA("FileName4.dll");
8821 DeleteFileA(msifile
);
8825 * MSI AppSearch action on DrLocator table always returns absolute paths.
8826 * If a relative path was set, it returns the first absolute path that
8827 * matches or an empty string if it didn't find anything.
8828 * This helper function replicates this behaviour.
8830 static void search_absolute_directory(LPSTR absolute
, LPCSTR relative
)
8835 size
= lstrlenA(relative
);
8836 drives
= GetLogicalDrives();
8837 lstrcpyA(absolute
, "A:\\");
8838 for (i
= 0; i
< 26; absolute
[0] = '\0', i
++)
8840 if (!(drives
& (1 << i
)))
8843 absolute
[0] = 'A' + i
;
8844 if (GetDriveType(absolute
) != DRIVE_FIXED
)
8847 lstrcpynA(absolute
+ 3, relative
, size
+ 1);
8848 attr
= GetFileAttributesA(absolute
);
8849 if (attr
!= INVALID_FILE_ATTRIBUTES
&&
8850 (attr
& FILE_ATTRIBUTE_DIRECTORY
))
8852 if (absolute
[3 + size
- 1] != '\\')
8853 lstrcatA(absolute
, "\\");
8860 static void test_appsearch_drlocator(void)
8862 MSIHANDLE hpkg
, hdb
;
8863 CHAR path
[MAX_PATH
];
8864 CHAR prop
[MAX_PATH
];
8871 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8874 DeleteFileA("test.dll");
8876 create_test_file("FileName1");
8877 CreateDirectoryA("one", NULL
);
8878 CreateDirectoryA("one\\two", NULL
);
8879 CreateDirectoryA("one\\two\\three", NULL
);
8880 create_test_file("one\\two\\three\\FileName2");
8881 CreateDirectoryA("another", NULL
);
8882 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8883 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8884 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8886 hdb
= create_package_db();
8887 ok(hdb
, "Expected a valid database handle\n");
8889 r
= create_appsearch_table(hdb
);
8890 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8892 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8893 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8895 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8896 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8898 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8899 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8901 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8902 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8904 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8905 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8907 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8908 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8910 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8911 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8913 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8914 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8916 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8917 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8919 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8920 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8922 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8923 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8925 r
= add_appsearch_entry(hdb
, "'SIGPROP13', 'NewSignature13'");
8926 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8928 r
= create_drlocator_table(hdb
);
8929 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8931 /* no parent, full path, depth 0, signature */
8932 sprintf(path
, "'NewSignature1', '', '%s', 0", CURR_DIR
);
8933 r
= add_drlocator_entry(hdb
, path
);
8934 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8936 /* no parent, full path, depth 0, no signature */
8937 sprintf(path
, "'NewSignature2', '', '%s', 0", CURR_DIR
);
8938 r
= add_drlocator_entry(hdb
, path
);
8939 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8941 /* no parent, relative path, depth 0, no signature */
8942 sprintf(path
, "'NewSignature3', '', '%s', 0", CURR_DIR
+ 3);
8943 r
= add_drlocator_entry(hdb
, path
);
8944 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8946 /* no parent, full path, depth 2, signature */
8947 sprintf(path
, "'NewSignature4', '', '%s', 2", CURR_DIR
);
8948 r
= add_drlocator_entry(hdb
, path
);
8949 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8951 /* no parent, full path, depth 3, signature */
8952 sprintf(path
, "'NewSignature5', '', '%s', 3", CURR_DIR
);
8953 r
= add_drlocator_entry(hdb
, path
);
8954 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8956 /* no parent, full path, depth 1, signature is dir */
8957 sprintf(path
, "'NewSignature6', '', '%s', 1", CURR_DIR
);
8958 r
= add_drlocator_entry(hdb
, path
);
8959 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8961 /* parent is in DrLocator, relative path, depth 0, signature */
8962 sprintf(path
, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8963 r
= add_drlocator_entry(hdb
, path
);
8964 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8966 /* no parent, full path, depth 0, signature w/ version */
8967 sprintf(path
, "'NewSignature8', '', '%s', 0", CURR_DIR
);
8968 r
= add_drlocator_entry(hdb
, path
);
8969 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8971 /* no parent, full path, depth 0, signature w/ version, ver > max */
8972 sprintf(path
, "'NewSignature9', '', '%s', 0", CURR_DIR
);
8973 r
= add_drlocator_entry(hdb
, path
);
8974 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8976 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8977 sprintf(path
, "'NewSignature10', '', '%s', 0", CURR_DIR
);
8978 r
= add_drlocator_entry(hdb
, path
);
8979 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8981 /* no parent, relative empty path, depth 0, no signature */
8982 sprintf(path
, "'NewSignature11', '', '', 0");
8983 r
= add_drlocator_entry(hdb
, path
);
8984 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8986 r
= create_reglocator_table(hdb
);
8987 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8990 r
= add_reglocator_entry(hdb
, "'NewSignature12', 2, 'htmlfile\\shell\\open\\nonexistent', '', 1");
8991 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8993 /* parent is in RegLocator, no path, depth 0, no signature */
8994 sprintf(path
, "'NewSignature13', 'NewSignature12', '', 0");
8995 r
= add_drlocator_entry(hdb
, path
);
8996 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8998 r
= create_signature_table(hdb
);
8999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9001 str
= "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9002 r
= add_signature_entry(hdb
, str
);
9003 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9005 str
= "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9006 r
= add_signature_entry(hdb
, str
);
9007 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9009 str
= "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9010 r
= add_signature_entry(hdb
, str
);
9011 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9013 str
= "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9014 r
= add_signature_entry(hdb
, str
);
9015 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9017 str
= "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9018 r
= add_signature_entry(hdb
, str
);
9019 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9021 str
= "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9022 r
= add_signature_entry(hdb
, str
);
9023 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9025 str
= "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9026 r
= add_signature_entry(hdb
, str
);
9027 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9029 str
= "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9030 r
= add_signature_entry(hdb
, str
);
9031 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9033 r
= package_from_db(hdb
, &hpkg
);
9034 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9036 skip("Not enough rights to perform tests\n");
9039 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
9041 r
= MsiDoAction(hpkg
, "AppSearch");
9042 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9045 sprintf(path
, "%s\\FileName1", CURR_DIR
);
9046 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
9047 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9048 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9051 sprintf(path
, "%s\\", CURR_DIR
);
9052 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
9053 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9054 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9057 search_absolute_directory(path
, CURR_DIR
+ 3);
9058 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
9059 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9060 ok(!lstrcmpiA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9063 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
9064 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9065 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9068 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
9069 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
9070 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9071 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9074 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
9075 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9076 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9079 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
9080 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
9081 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9082 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9087 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
9088 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
9089 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9090 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9093 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
9094 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9095 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9098 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
9099 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9100 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9104 search_absolute_directory(path
, "");
9105 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
9106 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9107 ok(!lstrcmpiA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9110 strcpy(path
, "c:\\");
9111 r
= MsiGetPropertyA(hpkg
, "SIGPROP13", prop
, &size
);
9112 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9113 ok(!prop
[0], "Expected \"\", got \"%s\"\n", prop
);
9115 MsiCloseHandle(hpkg
);
9118 DeleteFileA("FileName1");
9119 DeleteFileA("FileName3.dll");
9120 DeleteFileA("FileName4.dll");
9121 DeleteFileA("FileName5.dll");
9122 DeleteFileA("one\\two\\three\\FileName2");
9123 RemoveDirectoryA("one\\two\\three");
9124 RemoveDirectoryA("one\\two");
9125 RemoveDirectoryA("one");
9126 RemoveDirectoryA("another");
9127 DeleteFileA(msifile
);
9130 static void test_featureparents(void)
9135 INSTALLSTATE state
, action
;
9137 hdb
= create_package_db();
9138 ok ( hdb
, "failed to create package database\n" );
9140 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
9141 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
9143 r
= create_feature_table( hdb
);
9144 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
9146 r
= create_component_table( hdb
);
9147 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
9149 r
= create_feature_components_table( hdb
);
9150 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
9152 r
= create_file_table( hdb
);
9153 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
9155 /* msidbFeatureAttributesFavorLocal */
9156 r
= add_feature_entry( hdb
, "'zodiac', '', '', '', 2, 1, '', 0" );
9157 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9159 /* msidbFeatureAttributesFavorSource */
9160 r
= add_feature_entry( hdb
, "'perseus', '', '', '', 2, 1, '', 1" );
9161 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9163 /* msidbFeatureAttributesFavorLocal */
9164 r
= add_feature_entry( hdb
, "'orion', '', '', '', 2, 1, '', 0" );
9165 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9167 /* disabled because of install level */
9168 r
= add_feature_entry( hdb
, "'waters', '', '', '', 15, 101, '', 9" );
9169 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9171 /* child feature of disabled feature */
9172 r
= add_feature_entry( hdb
, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9173 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9175 /* component of disabled feature (install level) */
9176 r
= add_component_entry( hdb
, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9177 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9179 /* component of disabled child feature (install level) */
9180 r
= add_component_entry( hdb
, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9181 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9183 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9184 r
= add_component_entry( hdb
, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9185 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9187 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9188 r
= add_component_entry( hdb
, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9189 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9191 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9192 r
= add_component_entry( hdb
, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9193 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9195 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9196 r
= add_component_entry( hdb
, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9197 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9199 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9200 r
= add_component_entry( hdb
, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9201 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9203 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9204 r
= add_component_entry( hdb
, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9205 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9207 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9208 r
= add_component_entry( hdb
, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9209 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9211 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9212 r
= add_component_entry( hdb
, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9213 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9215 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9216 r
= add_component_entry( hdb
, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9218 r
= add_feature_components_entry( hdb
, "'zodiac', 'leo'" );
9219 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9221 r
= add_feature_components_entry( hdb
, "'zodiac', 'virgo'" );
9222 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9224 r
= add_feature_components_entry( hdb
, "'zodiac', 'libra'" );
9225 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9227 r
= add_feature_components_entry( hdb
, "'perseus', 'cassiopeia'" );
9228 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9230 r
= add_feature_components_entry( hdb
, "'perseus', 'cepheus'" );
9231 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9233 r
= add_feature_components_entry( hdb
, "'perseus', 'andromeda'" );
9234 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9236 r
= add_feature_components_entry( hdb
, "'orion', 'leo'" );
9237 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9239 r
= add_feature_components_entry( hdb
, "'orion', 'virgo'" );
9240 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9242 r
= add_feature_components_entry( hdb
, "'orion', 'libra'" );
9243 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9245 r
= add_feature_components_entry( hdb
, "'orion', 'cassiopeia'" );
9246 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9248 r
= add_feature_components_entry( hdb
, "'orion', 'cepheus'" );
9249 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9251 r
= add_feature_components_entry( hdb
, "'orion', 'andromeda'" );
9252 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9254 r
= add_feature_components_entry( hdb
, "'orion', 'canis'" );
9255 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9257 r
= add_feature_components_entry( hdb
, "'orion', 'monoceros'" );
9258 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9260 r
= add_feature_components_entry( hdb
, "'orion', 'lepus'" );
9261 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9263 r
= add_feature_components_entry( hdb
, "'waters', 'delphinus'" );
9264 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9266 r
= add_feature_components_entry( hdb
, "'bayer', 'hydrus'" );
9267 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9269 r
= add_file_entry( hdb
, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9270 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9272 r
= add_file_entry( hdb
, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9273 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9275 r
= add_file_entry( hdb
, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9276 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9278 r
= add_file_entry( hdb
, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9279 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9281 r
= add_file_entry( hdb
, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9282 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9284 r
= add_file_entry( hdb
, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9285 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9287 r
= add_file_entry( hdb
, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9288 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9290 r
= add_file_entry( hdb
, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9291 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9293 r
= add_file_entry( hdb
, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9294 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9296 r
= add_file_entry( hdb
, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9297 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9299 r
= add_file_entry( hdb
, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9300 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9302 r
= package_from_db( hdb
, &hpkg
);
9303 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9305 skip("Not enough rights to perform tests\n");
9306 DeleteFile(msifile
);
9309 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
9311 MsiCloseHandle( hdb
);
9313 r
= MsiDoAction( hpkg
, "CostInitialize");
9314 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
9316 r
= MsiDoAction( hpkg
, "FileCost");
9317 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
9319 r
= MsiDoAction( hpkg
, "CostFinalize");
9320 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
9324 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
9325 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9326 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9327 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9331 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
9332 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9333 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9334 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
9338 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
9339 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9340 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9341 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9345 r
= MsiGetFeatureState(hpkg
, "waters", &state
, &action
);
9346 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9347 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9348 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
9352 r
= MsiGetFeatureState(hpkg
, "bayer", &state
, &action
);
9353 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9354 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9355 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
9359 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
9360 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9361 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
9362 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9366 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
9367 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9368 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9369 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
9373 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
9374 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9375 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
9376 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
9380 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
9381 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9382 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
9383 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
9387 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
9388 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9389 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9390 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
9394 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
9395 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9396 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
9397 ok( action
== INSTALLSTATE_LOCAL
, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action
);
9401 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
9402 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9403 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
9404 ok( action
== INSTALLSTATE_LOCAL
, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action
);
9408 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
9409 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9410 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
9411 ok( action
== INSTALLSTATE_SOURCE
, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action
);
9415 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
9416 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9417 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9418 ok( action
== INSTALLSTATE_LOCAL
, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action
);
9422 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
9423 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9424 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9425 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9429 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
9430 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9431 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9432 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9434 r
= MsiSetFeatureState(hpkg
, "orion", INSTALLSTATE_ABSENT
);
9435 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
9437 r
= MsiSetFeatureState(hpkg
, "nosuchfeature", INSTALLSTATE_ABSENT
);
9438 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r
);
9442 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
9443 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9444 ok( state
== INSTALLSTATE_ABSENT
, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state
);
9445 ok( action
== INSTALLSTATE_LOCAL
, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action
);
9449 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
9450 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9451 ok( state
== INSTALLSTATE_ABSENT
, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state
);
9452 ok( action
== INSTALLSTATE_SOURCE
, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action
);
9456 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
9457 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9458 ok( state
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state
);
9459 ok( action
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action
);
9463 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
9464 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9465 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9466 ok( action
== INSTALLSTATE_LOCAL
, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action
);
9470 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
9471 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9472 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9473 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
9477 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
9478 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9479 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
9480 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
9484 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
9485 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9486 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
9487 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
9491 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
9492 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9493 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9494 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
9498 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
9499 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9500 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
9501 ok( action
== INSTALLSTATE_SOURCE
, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action
);
9505 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
9506 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9507 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
9508 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action
);
9512 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
9513 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9514 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
9515 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action
);
9519 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
9520 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9521 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9522 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9526 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
9527 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9528 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9529 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9533 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
9534 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9535 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9536 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9538 MsiCloseHandle(hpkg
);
9539 DeleteFileA(msifile
);
9542 static void test_installprops(void)
9544 MSIHANDLE hpkg
, hdb
;
9545 CHAR path
[MAX_PATH
], buf
[MAX_PATH
];
9551 REGSAM access
= KEY_ALL_ACCESS
;
9554 if (pIsWow64Process
&& pIsWow64Process(GetCurrentProcess(), &wow64
) && wow64
)
9555 access
|= KEY_WOW64_64KEY
;
9557 GetCurrentDirectory(MAX_PATH
, path
);
9558 lstrcat(path
, "\\");
9559 lstrcat(path
, msifile
);
9561 hdb
= create_package_db();
9562 ok( hdb
, "failed to create database\n");
9564 r
= package_from_db(hdb
, &hpkg
);
9565 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9567 skip("Not enough rights to perform tests\n");
9568 DeleteFile(msifile
);
9571 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
9573 MsiCloseHandle(hdb
);
9576 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
9577 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9578 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
9580 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
9581 RegOpenKeyEx(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey2
);
9586 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
9590 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
9593 /* win9x doesn't set this */
9597 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
9598 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9599 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
9605 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
9609 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
9615 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
9616 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9617 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
9621 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
9622 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9623 trace("VersionDatabase = %s\n", buf
);
9626 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
9627 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9628 trace("VersionMsi = %s\n", buf
);
9631 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
9632 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9633 trace("Date = %s\n", buf
);
9636 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
9637 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9638 trace("Time = %s\n", buf
);
9641 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
9642 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9643 trace("PackageCode = %s\n", buf
);
9645 langid
= GetUserDefaultLangID();
9646 sprintf(path
, "%d", langid
);
9649 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
9650 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS< got %d\n", r
);
9651 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
9653 res
= GetSystemMetrics(SM_CXSCREEN
);
9655 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
9656 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
9658 res
= GetSystemMetrics(SM_CYSCREEN
);
9660 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
9661 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
9665 MsiCloseHandle(hpkg
);
9666 DeleteFile(msifile
);
9669 static void test_launchconditions(void)
9675 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9677 hdb
= create_package_db();
9678 ok( hdb
, "failed to create package database\n" );
9680 r
= create_launchcondition_table( hdb
);
9681 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
9683 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
9684 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
9686 /* invalid condition */
9687 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
9688 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
9690 r
= package_from_db( hdb
, &hpkg
);
9691 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9693 skip("Not enough rights to perform tests\n");
9694 DeleteFile(msifile
);
9697 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
9699 MsiCloseHandle( hdb
);
9701 r
= MsiSetProperty( hpkg
, "X", "1" );
9702 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
9704 /* invalid conditions are ignored */
9705 r
= MsiDoAction( hpkg
, "LaunchConditions" );
9706 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
9708 /* verify LaunchConditions still does some verification */
9709 r
= MsiSetProperty( hpkg
, "X", "2" );
9710 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
9712 r
= MsiDoAction( hpkg
, "LaunchConditions" );
9713 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
9715 MsiCloseHandle( hpkg
);
9716 DeleteFile( msifile
);
9719 static void test_ccpsearch(void)
9721 MSIHANDLE hdb
, hpkg
;
9722 CHAR prop
[MAX_PATH
];
9723 DWORD size
= MAX_PATH
;
9726 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9728 hdb
= create_package_db();
9729 ok(hdb
, "failed to create package database\n");
9731 r
= create_ccpsearch_table(hdb
);
9732 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9734 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
9735 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9737 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
9738 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9740 r
= create_reglocator_table(hdb
);
9741 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9743 r
= add_reglocator_entry(hdb
, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9744 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9746 r
= create_drlocator_table(hdb
);
9747 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9749 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
9750 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9752 r
= create_signature_table(hdb
);
9753 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9755 r
= package_from_db(hdb
, &hpkg
);
9756 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9758 skip("Not enough rights to perform tests\n");
9759 DeleteFile(msifile
);
9762 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
9764 MsiCloseHandle(hdb
);
9766 r
= MsiDoAction(hpkg
, "CCPSearch");
9767 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9769 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
9770 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9771 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
9773 MsiCloseHandle(hpkg
);
9774 DeleteFileA(msifile
);
9777 static void test_complocator(void)
9779 MSIHANDLE hdb
, hpkg
;
9781 CHAR prop
[MAX_PATH
];
9782 CHAR expected
[MAX_PATH
];
9783 DWORD size
= MAX_PATH
;
9785 hdb
= create_package_db();
9786 ok(hdb
, "failed to create package database\n");
9788 r
= create_appsearch_table(hdb
);
9789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9791 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
9792 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9794 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
9795 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9797 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
9798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9800 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
9801 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9803 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
9804 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9806 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
9807 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9809 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
9810 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9812 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
9813 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9815 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
9816 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9818 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
9819 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9821 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
9822 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9824 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
9825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9827 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
9828 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9830 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
9831 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9833 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
9834 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9836 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
9837 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9839 r
= create_complocator_table(hdb
);
9840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9842 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9843 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9845 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9846 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9848 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9849 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9851 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9852 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9854 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9855 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9857 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9858 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9860 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9863 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9866 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9867 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9869 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9870 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9872 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9873 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9875 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9876 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9878 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9879 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9881 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9882 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9884 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9885 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9887 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9888 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9890 r
= create_signature_table(hdb
);
9891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9893 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9894 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9896 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9897 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9899 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9900 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9902 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9903 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9905 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9906 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9908 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9909 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9911 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9912 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9914 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9915 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9917 r
= package_from_db(hdb
, &hpkg
);
9918 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9920 skip("Not enough rights to perform tests\n");
9921 DeleteFile(msifile
);
9924 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
9926 MsiCloseHandle(hdb
);
9928 create_test_file("abelisaurus");
9929 create_test_file("bactrosaurus");
9930 create_test_file("camelotia");
9931 create_test_file("diclonius");
9932 create_test_file("echinodon");
9933 create_test_file("falcarius");
9934 create_test_file("gallimimus");
9935 create_test_file("hagryphus");
9936 CreateDirectoryA("iguanodon", NULL
);
9937 CreateDirectoryA("jobaria", NULL
);
9938 CreateDirectoryA("kakuru", NULL
);
9939 CreateDirectoryA("labocania", NULL
);
9940 CreateDirectoryA("megaraptor", NULL
);
9941 CreateDirectoryA("neosodon", NULL
);
9942 CreateDirectoryA("olorotitan", NULL
);
9943 CreateDirectoryA("pantydraco", NULL
);
9945 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE
,
9946 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL
, FALSE
);
9947 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE
,
9948 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL
, FALSE
);
9949 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE
,
9950 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL
, FALSE
);
9951 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE
,
9952 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL
, FALSE
);
9953 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE
,
9954 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL
, FALSE
);
9955 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE
,
9956 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL
, FALSE
);
9957 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE
,
9958 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL
, FALSE
);
9959 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE
,
9960 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL
, FALSE
);
9962 r
= MsiDoAction(hpkg
, "AppSearch");
9963 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9966 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
9967 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9969 lstrcpyA(expected
, CURR_DIR
);
9970 lstrcatA(expected
, "\\abelisaurus");
9971 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9972 "Expected %s or empty string, got %s\n", expected
, prop
);
9975 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", prop
, &size
);
9976 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9977 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9980 r
= MsiGetPropertyA(hpkg
, "CAMELOTIA", prop
, &size
);
9981 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9982 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9985 r
= MsiGetPropertyA(hpkg
, "DICLONIUS", prop
, &size
);
9986 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9987 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9990 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
9991 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9993 lstrcpyA(expected
, CURR_DIR
);
9994 lstrcatA(expected
, "\\");
9995 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9996 "Expected %s or empty string, got %s\n", expected
, prop
);
9999 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
10000 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10001 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10004 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
10005 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10006 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10009 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
10010 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10011 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10014 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
10015 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10016 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10019 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
10020 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10021 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10024 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
10025 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10026 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10029 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
10030 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10031 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10034 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
10035 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10037 lstrcpyA(expected
, CURR_DIR
);
10038 lstrcatA(expected
, "\\");
10039 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10040 "Expected %s or empty string, got %s\n", expected
, prop
);
10043 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
10044 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10046 lstrcpyA(expected
, CURR_DIR
);
10047 lstrcatA(expected
, "\\neosodon\\");
10048 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10049 "Expected %s or empty string, got %s\n", expected
, prop
);
10052 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
10053 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10054 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10057 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
10058 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10059 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10061 MsiCloseHandle(hpkg
);
10062 DeleteFileA("abelisaurus");
10063 DeleteFileA("bactrosaurus");
10064 DeleteFileA("camelotia");
10065 DeleteFileA("diclonius");
10066 DeleteFileA("echinodon");
10067 DeleteFileA("falcarius");
10068 DeleteFileA("gallimimus");
10069 DeleteFileA("hagryphus");
10070 RemoveDirectoryA("iguanodon");
10071 RemoveDirectoryA("jobaria");
10072 RemoveDirectoryA("kakuru");
10073 RemoveDirectoryA("labocania");
10074 RemoveDirectoryA("megaraptor");
10075 RemoveDirectoryA("neosodon");
10076 RemoveDirectoryA("olorotitan");
10077 RemoveDirectoryA("pantydraco");
10078 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10079 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10080 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10081 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10082 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10083 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10084 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10085 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10086 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10087 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10088 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10089 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10090 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10091 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10092 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10093 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10094 DeleteFileA(msifile
);
10097 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
10102 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
10103 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10105 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
10106 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10108 r
= MsiSummaryInfoPersist(summary
);
10109 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
10111 MsiCloseHandle(summary
);
10114 static void test_MsiGetSourcePath(void)
10116 MSIHANDLE hdb
, hpkg
;
10117 CHAR path
[MAX_PATH
];
10118 CHAR cwd
[MAX_PATH
];
10119 CHAR subsrc
[MAX_PATH
];
10120 CHAR sub2
[MAX_PATH
];
10124 lstrcpyA(cwd
, CURR_DIR
);
10125 lstrcatA(cwd
, "\\");
10127 lstrcpyA(subsrc
, cwd
);
10128 lstrcatA(subsrc
, "subsource");
10129 lstrcatA(subsrc
, "\\");
10131 lstrcpyA(sub2
, subsrc
);
10132 lstrcatA(sub2
, "sub2");
10133 lstrcatA(sub2
, "\\");
10135 /* uncompressed source */
10137 hdb
= create_package_db();
10138 ok( hdb
, "failed to create database\n");
10140 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
10142 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
10143 ok(r
== S_OK
, "failed\n");
10145 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10146 ok(r
== S_OK
, "failed\n");
10148 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
10149 ok(r
== S_OK
, "failed\n");
10151 r
= MsiDatabaseCommit(hdb
);
10152 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
10154 r
= package_from_db(hdb
, &hpkg
);
10155 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10157 skip("Not enough rights to perform tests\n");
10158 DeleteFile(msifile
);
10161 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10163 MsiCloseHandle(hdb
);
10165 /* invalid database handle */
10167 lstrcpyA(path
, "kiwi");
10168 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
10169 ok(r
== ERROR_INVALID_HANDLE
,
10170 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
10171 ok(!lstrcmpA(path
, "kiwi"),
10172 "Expected path to be unchanged, got \"%s\"\n", path
);
10173 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10175 /* NULL szFolder */
10177 lstrcpyA(path
, "kiwi");
10178 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
10179 ok(r
== ERROR_INVALID_PARAMETER
,
10180 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
10181 ok(!lstrcmpA(path
, "kiwi"),
10182 "Expected path to be unchanged, got \"%s\"\n", path
);
10183 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10185 /* empty szFolder */
10187 lstrcpyA(path
, "kiwi");
10188 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
10189 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10190 ok(!lstrcmpA(path
, "kiwi"),
10191 "Expected path to be unchanged, got \"%s\"\n", path
);
10192 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10194 /* try TARGETDIR */
10196 lstrcpyA(path
, "kiwi");
10197 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10198 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10199 ok(!lstrcmpA(path
, "kiwi"),
10200 "Expected path to be unchanged, got \"%s\"\n", path
);
10201 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10204 lstrcpyA(path
, "kiwi");
10205 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10206 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10207 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10208 ok(size
== 0, "Expected 0, got %d\n", size
);
10211 lstrcpyA(path
, "kiwi");
10212 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10213 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10214 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10215 ok(size
== 0, "Expected 0, got %d\n", size
);
10217 /* try SourceDir */
10219 lstrcpyA(path
, "kiwi");
10220 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10221 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10222 ok(!lstrcmpA(path
, "kiwi"),
10223 "Expected path to be unchanged, got \"%s\"\n", path
);
10224 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10226 /* try SOURCEDIR */
10228 lstrcpyA(path
, "kiwi");
10229 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10230 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10231 ok(!lstrcmpA(path
, "kiwi"),
10232 "Expected path to be unchanged, got \"%s\"\n", path
);
10233 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10235 /* source path does not exist, but the property exists */
10237 lstrcpyA(path
, "kiwi");
10238 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10239 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10240 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10241 ok(size
== 0, "Expected 0, got %d\n", size
);
10244 lstrcpyA(path
, "kiwi");
10245 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10246 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10247 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10248 ok(size
== 0, "Expected 0, got %d\n", size
);
10252 lstrcpyA(path
, "kiwi");
10253 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10254 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10255 ok(!lstrcmpA(path
, "kiwi"),
10256 "Expected path to be unchanged, got \"%s\"\n", path
);
10257 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10261 lstrcpyA(path
, "kiwi");
10262 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10263 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10264 ok(!lstrcmpA(path
, "kiwi"),
10265 "Expected path to be unchanged, got \"%s\"\n", path
);
10266 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10268 r
= MsiDoAction(hpkg
, "CostInitialize");
10269 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
10271 /* try TARGETDIR after CostInitialize */
10273 lstrcpyA(path
, "kiwi");
10274 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10275 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10276 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10277 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10279 /* try SourceDir after CostInitialize */
10281 lstrcpyA(path
, "kiwi");
10282 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10283 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10284 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10285 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10287 /* try SOURCEDIR after CostInitialize */
10289 lstrcpyA(path
, "kiwi");
10290 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10291 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10292 ok(!lstrcmpA(path
, "kiwi"),
10293 "Expected path to be unchanged, got \"%s\"\n", path
);
10294 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10296 /* source path does not exist, but the property exists */
10298 lstrcpyA(path
, "kiwi");
10299 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10300 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10303 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10304 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10307 /* try SubDir after CostInitialize */
10309 lstrcpyA(path
, "kiwi");
10310 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10311 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10312 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10313 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10315 /* try SubDir2 after CostInitialize */
10317 lstrcpyA(path
, "kiwi");
10318 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10319 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10320 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
10321 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
10323 r
= MsiDoAction(hpkg
, "ResolveSource");
10324 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10326 /* try TARGETDIR after ResolveSource */
10328 lstrcpyA(path
, "kiwi");
10329 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10330 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10331 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10332 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10334 /* try SourceDir after ResolveSource */
10336 lstrcpyA(path
, "kiwi");
10337 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10338 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10339 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10340 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10342 /* try SOURCEDIR after ResolveSource */
10344 lstrcpyA(path
, "kiwi");
10345 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10346 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10347 ok(!lstrcmpA(path
, "kiwi"),
10348 "Expected path to be unchanged, got \"%s\"\n", path
);
10349 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10351 /* source path does not exist, but the property exists */
10353 lstrcpyA(path
, "kiwi");
10354 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10355 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10356 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10357 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10359 /* try SubDir after ResolveSource */
10361 lstrcpyA(path
, "kiwi");
10362 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10363 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10364 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10365 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10367 /* try SubDir2 after ResolveSource */
10369 lstrcpyA(path
, "kiwi");
10370 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10371 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10372 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
10373 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
10375 r
= MsiDoAction(hpkg
, "FileCost");
10376 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10378 /* try TARGETDIR after FileCost */
10380 lstrcpyA(path
, "kiwi");
10381 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10382 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10383 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10384 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10386 /* try SourceDir after FileCost */
10388 lstrcpyA(path
, "kiwi");
10389 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10390 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10391 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10392 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10394 /* try SOURCEDIR after FileCost */
10396 lstrcpyA(path
, "kiwi");
10397 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10398 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10399 ok(!lstrcmpA(path
, "kiwi"),
10400 "Expected path to be unchanged, got \"%s\"\n", path
);
10401 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10403 /* source path does not exist, but the property exists */
10405 lstrcpyA(path
, "kiwi");
10406 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10407 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10408 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10409 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10411 /* try SubDir after FileCost */
10413 lstrcpyA(path
, "kiwi");
10414 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10415 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10416 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10417 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10419 /* try SubDir2 after FileCost */
10421 lstrcpyA(path
, "kiwi");
10422 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10423 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10424 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
10425 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
10427 r
= MsiDoAction(hpkg
, "CostFinalize");
10428 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10430 /* try TARGETDIR after CostFinalize */
10432 lstrcpyA(path
, "kiwi");
10433 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10435 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10436 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10438 /* try SourceDir after CostFinalize */
10440 lstrcpyA(path
, "kiwi");
10441 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10442 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10443 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10444 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10446 /* try SOURCEDIR after CostFinalize */
10448 lstrcpyA(path
, "kiwi");
10449 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10450 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10451 ok(!lstrcmpA(path
, "kiwi"),
10452 "Expected path to be unchanged, got \"%s\"\n", path
);
10453 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10455 /* source path does not exist, but the property exists */
10457 lstrcpyA(path
, "kiwi");
10458 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10459 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10460 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10461 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10463 /* try SubDir after CostFinalize */
10465 lstrcpyA(path
, "kiwi");
10466 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10467 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10468 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10469 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10471 /* try SubDir2 after CostFinalize */
10473 lstrcpyA(path
, "kiwi");
10474 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10475 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10476 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
10477 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
10479 /* nonexistent directory */
10481 lstrcpyA(path
, "kiwi");
10482 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
10483 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10484 ok(!lstrcmpA(path
, "kiwi"),
10485 "Expected path to be unchanged, got \"%s\"\n", path
);
10486 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10488 /* NULL szPathBuf */
10490 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
10491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10492 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10494 /* NULL pcchPathBuf */
10495 lstrcpyA(path
, "kiwi");
10496 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
10497 ok(r
== ERROR_INVALID_PARAMETER
,
10498 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
10499 ok(!lstrcmpA(path
, "kiwi"),
10500 "Expected path to be unchanged, got \"%s\"\n", path
);
10502 /* pcchPathBuf is 0 */
10504 lstrcpyA(path
, "kiwi");
10505 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10506 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
10507 ok(!lstrcmpA(path
, "kiwi"),
10508 "Expected path to be unchanged, got \"%s\"\n", path
);
10509 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10511 /* pcchPathBuf does not have room for NULL terminator */
10512 size
= lstrlenA(cwd
);
10513 lstrcpyA(path
, "kiwi");
10514 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10515 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
10516 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
10517 "Expected path with no backslash, got \"%s\"\n", path
);
10518 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10520 /* pcchPathBuf has room for NULL terminator */
10521 size
= lstrlenA(cwd
) + 1;
10522 lstrcpyA(path
, "kiwi");
10523 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10524 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10525 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10526 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10528 /* remove property */
10529 r
= MsiSetProperty(hpkg
, "SourceDir", NULL
);
10530 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10532 /* try SourceDir again */
10534 lstrcpyA(path
, "kiwi");
10535 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10536 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10537 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10538 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10540 /* set property to a valid directory */
10541 r
= MsiSetProperty(hpkg
, "SOURCEDIR", cwd
);
10542 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10544 /* try SOURCEDIR again */
10546 lstrcpyA(path
, "kiwi");
10547 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10548 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10549 ok(!lstrcmpA(path
, "kiwi"),
10550 "Expected path to be unchanged, got \"%s\"\n", path
);
10551 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10553 MsiCloseHandle(hpkg
);
10555 /* compressed source */
10557 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
10558 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10560 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
10562 r
= package_from_db(hdb
, &hpkg
);
10563 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10565 /* try TARGETDIR */
10567 lstrcpyA(path
, "kiwi");
10568 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10569 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10570 ok(!lstrcmpA(path
, "kiwi"),
10571 "Expected path to be unchanged, got \"%s\"\n", path
);
10572 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10574 /* try SourceDir */
10576 lstrcpyA(path
, "kiwi");
10577 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10578 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10579 ok(!lstrcmpA(path
, "kiwi"),
10580 "Expected path to be unchanged, got \"%s\"\n", path
);
10581 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10583 /* try SOURCEDIR */
10585 lstrcpyA(path
, "kiwi");
10586 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10587 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10588 ok(!lstrcmpA(path
, "kiwi"),
10589 "Expected path to be unchanged, got \"%s\"\n", path
);
10590 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10592 /* source path nor the property exist */
10594 lstrcpyA(path
, "kiwi");
10595 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10596 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10597 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10598 ok(size
== 0, "Expected 0, got %d\n", size
);
10602 lstrcpyA(path
, "kiwi");
10603 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10604 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10605 ok(!lstrcmpA(path
, "kiwi"),
10606 "Expected path to be unchanged, got \"%s\"\n", path
);
10607 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10611 lstrcpyA(path
, "kiwi");
10612 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10613 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10614 ok(!lstrcmpA(path
, "kiwi"),
10615 "Expected path to be unchanged, got \"%s\"\n", path
);
10616 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10618 r
= MsiDoAction(hpkg
, "CostInitialize");
10619 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10621 /* try TARGETDIR after CostInitialize */
10623 lstrcpyA(path
, "kiwi");
10624 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10625 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10626 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10627 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10629 /* try SourceDir after CostInitialize */
10631 lstrcpyA(path
, "kiwi");
10632 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10633 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10634 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10635 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10637 /* try SOURCEDIR after CostInitialize */
10639 lstrcpyA(path
, "kiwi");
10640 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10643 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10644 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10645 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10648 /* source path does not exist, but the property exists */
10650 lstrcpyA(path
, "kiwi");
10651 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10652 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10655 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10656 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10659 /* try SubDir after CostInitialize */
10661 lstrcpyA(path
, "kiwi");
10662 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10663 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10664 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10665 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10667 /* try SubDir2 after CostInitialize */
10669 lstrcpyA(path
, "kiwi");
10670 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10671 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10672 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10673 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10675 r
= MsiDoAction(hpkg
, "ResolveSource");
10676 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10678 /* try TARGETDIR after ResolveSource */
10680 lstrcpyA(path
, "kiwi");
10681 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10682 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10683 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10684 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10686 /* try SourceDir after ResolveSource */
10688 lstrcpyA(path
, "kiwi");
10689 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10690 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10691 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10692 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10694 /* try SOURCEDIR after ResolveSource */
10696 lstrcpyA(path
, "kiwi");
10697 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10700 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10701 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10702 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10705 /* source path and the property exist */
10707 lstrcpyA(path
, "kiwi");
10708 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10709 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10710 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10711 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10713 /* try SubDir after ResolveSource */
10715 lstrcpyA(path
, "kiwi");
10716 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10717 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10718 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10719 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10721 /* try SubDir2 after ResolveSource */
10723 lstrcpyA(path
, "kiwi");
10724 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10725 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10726 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10727 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10729 r
= MsiDoAction(hpkg
, "FileCost");
10730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10732 /* try TARGETDIR after CostFinalize */
10734 lstrcpyA(path
, "kiwi");
10735 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10736 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10737 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10738 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10740 /* try SourceDir after CostFinalize */
10742 lstrcpyA(path
, "kiwi");
10743 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10744 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10745 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10746 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10748 /* try SOURCEDIR after CostFinalize */
10750 lstrcpyA(path
, "kiwi");
10751 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10754 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10755 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10756 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10759 /* source path and the property exist */
10761 lstrcpyA(path
, "kiwi");
10762 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10763 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10764 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10765 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10767 /* try SubDir after CostFinalize */
10769 lstrcpyA(path
, "kiwi");
10770 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10771 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10772 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10773 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10775 /* try SubDir2 after CostFinalize */
10777 lstrcpyA(path
, "kiwi");
10778 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10779 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10780 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10781 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10783 r
= MsiDoAction(hpkg
, "CostFinalize");
10784 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10786 /* try TARGETDIR after CostFinalize */
10788 lstrcpyA(path
, "kiwi");
10789 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10790 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10791 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10792 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10794 /* try SourceDir after CostFinalize */
10796 lstrcpyA(path
, "kiwi");
10797 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10799 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10800 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10802 /* try SOURCEDIR after CostFinalize */
10804 lstrcpyA(path
, "kiwi");
10805 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10808 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10809 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10810 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10813 /* source path and the property exist */
10815 lstrcpyA(path
, "kiwi");
10816 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10817 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10818 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10819 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10821 /* try SubDir after CostFinalize */
10823 lstrcpyA(path
, "kiwi");
10824 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10826 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10827 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10829 /* try SubDir2 after CostFinalize */
10831 lstrcpyA(path
, "kiwi");
10832 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10833 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10834 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10835 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10837 MsiCloseHandle(hpkg
);
10838 DeleteFile(msifile
);
10841 static void test_shortlongsource(void)
10843 MSIHANDLE hdb
, hpkg
;
10844 CHAR path
[MAX_PATH
];
10845 CHAR cwd
[MAX_PATH
];
10846 CHAR subsrc
[MAX_PATH
];
10850 lstrcpyA(cwd
, CURR_DIR
);
10851 lstrcatA(cwd
, "\\");
10853 lstrcpyA(subsrc
, cwd
);
10854 lstrcatA(subsrc
, "long");
10855 lstrcatA(subsrc
, "\\");
10857 /* long file names */
10859 hdb
= create_package_db();
10860 ok( hdb
, "failed to create database\n");
10862 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
10864 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
10865 ok(r
== S_OK
, "failed\n");
10867 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
10868 ok(r
== S_OK
, "failed\n");
10870 /* CostInitialize:short */
10871 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
10872 ok(r
== S_OK
, "failed\n");
10874 /* CostInitialize:long */
10875 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
10876 ok(r
== S_OK
, "failed\n");
10878 /* FileCost:short */
10879 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
10880 ok(r
== S_OK
, "failed\n");
10882 /* FileCost:long */
10883 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10884 ok(r
== S_OK
, "failed\n");
10886 /* CostFinalize:short */
10887 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10888 ok(r
== S_OK
, "failed\n");
10890 /* CostFinalize:long */
10891 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10892 ok(r
== S_OK
, "failed\n");
10894 MsiDatabaseCommit(hdb
);
10896 r
= package_from_db(hdb
, &hpkg
);
10897 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10899 skip("Not enough rights to perform tests\n");
10900 DeleteFile(msifile
);
10903 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10905 MsiCloseHandle(hdb
);
10907 CreateDirectoryA("one", NULL
);
10908 CreateDirectoryA("four", NULL
);
10910 r
= MsiDoAction(hpkg
, "CostInitialize");
10911 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10913 CreateDirectory("five", NULL
);
10914 CreateDirectory("eight", NULL
);
10916 r
= MsiDoAction(hpkg
, "FileCost");
10917 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10919 CreateDirectory("nine", NULL
);
10920 CreateDirectory("twelve", NULL
);
10922 r
= MsiDoAction(hpkg
, "CostFinalize");
10923 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10925 /* neither short nor long source directories exist */
10927 lstrcpyA(path
, "kiwi");
10928 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10929 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10930 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10931 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10933 CreateDirectoryA("short", NULL
);
10935 /* short source directory exists */
10937 lstrcpyA(path
, "kiwi");
10938 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10939 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10940 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10941 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10943 CreateDirectoryA("long", NULL
);
10945 /* both short and long source directories exist */
10947 lstrcpyA(path
, "kiwi");
10948 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10949 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10950 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10951 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10953 lstrcpyA(subsrc
, cwd
);
10954 lstrcatA(subsrc
, "two");
10955 lstrcatA(subsrc
, "\\");
10957 /* short dir exists before CostInitialize */
10959 lstrcpyA(path
, "kiwi");
10960 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10961 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10962 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10963 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10965 lstrcpyA(subsrc
, cwd
);
10966 lstrcatA(subsrc
, "four");
10967 lstrcatA(subsrc
, "\\");
10969 /* long dir exists before CostInitialize */
10971 lstrcpyA(path
, "kiwi");
10972 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
10973 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10974 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10975 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10977 lstrcpyA(subsrc
, cwd
);
10978 lstrcatA(subsrc
, "six");
10979 lstrcatA(subsrc
, "\\");
10981 /* short dir exists before FileCost */
10983 lstrcpyA(path
, "kiwi");
10984 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
10985 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10986 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10987 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10989 lstrcpyA(subsrc
, cwd
);
10990 lstrcatA(subsrc
, "eight");
10991 lstrcatA(subsrc
, "\\");
10993 /* long dir exists before FileCost */
10995 lstrcpyA(path
, "kiwi");
10996 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
10997 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10998 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10999 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11001 lstrcpyA(subsrc
, cwd
);
11002 lstrcatA(subsrc
, "ten");
11003 lstrcatA(subsrc
, "\\");
11005 /* short dir exists before CostFinalize */
11007 lstrcpyA(path
, "kiwi");
11008 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
11009 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11010 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11011 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11013 lstrcpyA(subsrc
, cwd
);
11014 lstrcatA(subsrc
, "twelve");
11015 lstrcatA(subsrc
, "\\");
11017 /* long dir exists before CostFinalize */
11019 lstrcpyA(path
, "kiwi");
11020 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
11021 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11022 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11023 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11025 MsiCloseHandle(hpkg
);
11026 RemoveDirectoryA("short");
11027 RemoveDirectoryA("long");
11028 RemoveDirectoryA("one");
11029 RemoveDirectoryA("four");
11030 RemoveDirectoryA("five");
11031 RemoveDirectoryA("eight");
11032 RemoveDirectoryA("nine");
11033 RemoveDirectoryA("twelve");
11035 /* short file names */
11037 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
11038 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11040 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
11042 r
= package_from_db(hdb
, &hpkg
);
11043 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
11045 MsiCloseHandle(hdb
);
11047 CreateDirectoryA("one", NULL
);
11048 CreateDirectoryA("four", NULL
);
11050 r
= MsiDoAction(hpkg
, "CostInitialize");
11051 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11053 CreateDirectory("five", NULL
);
11054 CreateDirectory("eight", NULL
);
11056 r
= MsiDoAction(hpkg
, "FileCost");
11057 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11059 CreateDirectory("nine", NULL
);
11060 CreateDirectory("twelve", NULL
);
11062 r
= MsiDoAction(hpkg
, "CostFinalize");
11063 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11065 lstrcpyA(subsrc
, cwd
);
11066 lstrcatA(subsrc
, "short");
11067 lstrcatA(subsrc
, "\\");
11069 /* neither short nor long source directories exist */
11071 lstrcpyA(path
, "kiwi");
11072 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11073 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11074 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11075 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11077 CreateDirectoryA("short", NULL
);
11079 /* short source directory exists */
11081 lstrcpyA(path
, "kiwi");
11082 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11083 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11084 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11085 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11087 CreateDirectoryA("long", NULL
);
11089 /* both short and long source directories exist */
11091 lstrcpyA(path
, "kiwi");
11092 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11093 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11094 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11095 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11097 lstrcpyA(subsrc
, cwd
);
11098 lstrcatA(subsrc
, "one");
11099 lstrcatA(subsrc
, "\\");
11101 /* short dir exists before CostInitialize */
11103 lstrcpyA(path
, "kiwi");
11104 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11105 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11106 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11107 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11109 lstrcpyA(subsrc
, cwd
);
11110 lstrcatA(subsrc
, "three");
11111 lstrcatA(subsrc
, "\\");
11113 /* long dir exists before CostInitialize */
11115 lstrcpyA(path
, "kiwi");
11116 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
11117 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11118 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11119 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11121 lstrcpyA(subsrc
, cwd
);
11122 lstrcatA(subsrc
, "five");
11123 lstrcatA(subsrc
, "\\");
11125 /* short dir exists before FileCost */
11127 lstrcpyA(path
, "kiwi");
11128 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
11129 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11130 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11131 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11133 lstrcpyA(subsrc
, cwd
);
11134 lstrcatA(subsrc
, "seven");
11135 lstrcatA(subsrc
, "\\");
11137 /* long dir exists before FileCost */
11139 lstrcpyA(path
, "kiwi");
11140 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
11141 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11142 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11143 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11145 lstrcpyA(subsrc
, cwd
);
11146 lstrcatA(subsrc
, "nine");
11147 lstrcatA(subsrc
, "\\");
11149 /* short dir exists before CostFinalize */
11151 lstrcpyA(path
, "kiwi");
11152 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
11153 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11154 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11155 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11157 lstrcpyA(subsrc
, cwd
);
11158 lstrcatA(subsrc
, "eleven");
11159 lstrcatA(subsrc
, "\\");
11161 /* long dir exists before CostFinalize */
11163 lstrcpyA(path
, "kiwi");
11164 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
11165 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11166 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11167 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11169 MsiCloseHandle(hpkg
);
11170 RemoveDirectoryA("short");
11171 RemoveDirectoryA("long");
11172 RemoveDirectoryA("one");
11173 RemoveDirectoryA("four");
11174 RemoveDirectoryA("five");
11175 RemoveDirectoryA("eight");
11176 RemoveDirectoryA("nine");
11177 RemoveDirectoryA("twelve");
11178 DeleteFileA(msifile
);
11181 static void test_sourcedir(void)
11183 MSIHANDLE hdb
, hpkg
;
11185 CHAR path
[MAX_PATH
];
11186 CHAR cwd
[MAX_PATH
];
11187 CHAR subsrc
[MAX_PATH
];
11191 lstrcpyA(cwd
, CURR_DIR
);
11192 lstrcatA(cwd
, "\\");
11194 lstrcpyA(subsrc
, cwd
);
11195 lstrcatA(subsrc
, "long");
11196 lstrcatA(subsrc
, "\\");
11198 hdb
= create_package_db();
11199 ok( hdb
, "failed to create database\n");
11201 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
11202 ok(r
== S_OK
, "failed\n");
11204 sprintf(package
, "#%u", hdb
);
11205 r
= MsiOpenPackage(package
, &hpkg
);
11206 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
11208 skip("Not enough rights to perform tests\n");
11211 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11213 /* properties only */
11215 /* SourceDir prop */
11217 lstrcpyA(path
, "kiwi");
11218 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11219 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11220 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11221 ok(size
== 0, "Expected 0, got %d\n", size
);
11223 /* SOURCEDIR prop */
11225 lstrcpyA(path
, "kiwi");
11226 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11227 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11228 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11229 ok(size
== 0, "Expected 0, got %d\n", size
);
11231 r
= MsiDoAction(hpkg
, "CostInitialize");
11232 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11234 /* SourceDir after CostInitialize */
11236 lstrcpyA(path
, "kiwi");
11237 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11238 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11239 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11240 ok(size
== 0, "Expected 0, got %d\n", size
);
11242 /* SOURCEDIR after CostInitialize */
11244 lstrcpyA(path
, "kiwi");
11245 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11246 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11247 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11248 ok(size
== 0, "Expected 0, got %d\n", size
);
11250 r
= MsiDoAction(hpkg
, "FileCost");
11251 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11253 /* SourceDir after FileCost */
11255 lstrcpyA(path
, "kiwi");
11256 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11257 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11258 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11259 ok(size
== 0, "Expected 0, got %d\n", size
);
11261 /* SOURCEDIR after FileCost */
11263 lstrcpyA(path
, "kiwi");
11264 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11265 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11266 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11267 ok(size
== 0, "Expected 0, got %d\n", size
);
11269 r
= MsiDoAction(hpkg
, "CostFinalize");
11270 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11272 /* SourceDir after CostFinalize */
11274 lstrcpyA(path
, "kiwi");
11275 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11276 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11277 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11278 ok(size
== 0, "Expected 0, got %d\n", size
);
11280 /* SOURCEDIR after CostFinalize */
11282 lstrcpyA(path
, "kiwi");
11283 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11284 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11285 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11286 ok(size
== 0, "Expected 0, got %d\n", size
);
11288 r
= MsiDoAction(hpkg
, "ResolveSource");
11289 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11291 /* SourceDir after ResolveSource */
11293 lstrcpyA(path
, "kiwi");
11294 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11295 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11296 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11297 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11299 /* SOURCEDIR after ResolveSource */
11301 lstrcpyA(path
, "kiwi");
11302 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11303 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11304 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11305 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11307 /* random casing */
11309 lstrcpyA(path
, "kiwi");
11310 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
11311 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11312 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11313 ok(size
== 0, "Expected 0, got %d\n", size
);
11315 MsiCloseHandle(hpkg
);
11317 /* reset the package state */
11318 sprintf(package
, "#%i", hdb
);
11319 r
= MsiOpenPackage(package
, &hpkg
);
11320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11322 /* test how MsiGetSourcePath affects the properties */
11324 /* SourceDir prop */
11326 lstrcpyA(path
, "kiwi");
11327 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11328 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11331 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11332 ok(size
== 0, "Expected 0, got %d\n", size
);
11336 lstrcpyA(path
, "kiwi");
11337 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11338 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11339 ok(!lstrcmpA(path
, "kiwi"),
11340 "Expected path to be unchanged, got \"%s\"\n", path
);
11341 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11343 /* SourceDir after MsiGetSourcePath */
11345 lstrcpyA(path
, "kiwi");
11346 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11347 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11350 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11351 ok(size
== 0, "Expected 0, got %d\n", size
);
11354 /* SOURCEDIR prop */
11356 lstrcpyA(path
, "kiwi");
11357 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11358 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11361 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11362 ok(size
== 0, "Expected 0, got %d\n", size
);
11366 lstrcpyA(path
, "kiwi");
11367 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11368 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11369 ok(!lstrcmpA(path
, "kiwi"),
11370 "Expected path to be unchanged, got \"%s\"\n", path
);
11371 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11373 /* SOURCEDIR prop after MsiGetSourcePath */
11375 lstrcpyA(path
, "kiwi");
11376 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11377 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11380 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11381 ok(size
== 0, "Expected 0, got %d\n", size
);
11384 r
= MsiDoAction(hpkg
, "CostInitialize");
11385 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11387 /* SourceDir after CostInitialize */
11389 lstrcpyA(path
, "kiwi");
11390 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11394 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11395 ok(size
== 0, "Expected 0, got %d\n", size
);
11399 lstrcpyA(path
, "kiwi");
11400 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11401 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11402 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11403 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11405 /* SourceDir after MsiGetSourcePath */
11407 lstrcpyA(path
, "kiwi");
11408 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11409 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11410 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11411 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11413 /* SOURCEDIR after CostInitialize */
11415 lstrcpyA(path
, "kiwi");
11416 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11417 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11418 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11419 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11421 /* SOURCEDIR source path still does not exist */
11423 lstrcpyA(path
, "kiwi");
11424 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11425 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11426 ok(!lstrcmpA(path
, "kiwi"),
11427 "Expected path to be unchanged, got \"%s\"\n", path
);
11428 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11430 r
= MsiDoAction(hpkg
, "FileCost");
11431 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11433 /* SourceDir after FileCost */
11435 lstrcpyA(path
, "kiwi");
11436 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11437 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11438 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11439 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11441 /* SOURCEDIR after FileCost */
11443 lstrcpyA(path
, "kiwi");
11444 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11445 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11446 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11447 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11449 /* SOURCEDIR source path still does not exist */
11451 lstrcpyA(path
, "kiwi");
11452 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11453 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11454 ok(!lstrcmpA(path
, "kiwi"),
11455 "Expected path to be unchanged, got \"%s\"\n", path
);
11456 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11458 r
= MsiDoAction(hpkg
, "CostFinalize");
11459 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11461 /* SourceDir after CostFinalize */
11463 lstrcpyA(path
, "kiwi");
11464 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11465 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11466 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11467 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11469 /* SOURCEDIR after CostFinalize */
11471 lstrcpyA(path
, "kiwi");
11472 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11473 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11474 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11475 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11477 /* SOURCEDIR source path still does not exist */
11479 lstrcpyA(path
, "kiwi");
11480 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11481 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11482 ok(!lstrcmpA(path
, "kiwi"),
11483 "Expected path to be unchanged, got \"%s\"\n", path
);
11484 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11486 r
= MsiDoAction(hpkg
, "ResolveSource");
11487 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11489 /* SourceDir after ResolveSource */
11491 lstrcpyA(path
, "kiwi");
11492 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11493 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11494 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11495 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11497 /* SOURCEDIR after ResolveSource */
11499 lstrcpyA(path
, "kiwi");
11500 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11501 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11502 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11503 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11505 /* SOURCEDIR source path still does not exist */
11507 lstrcpyA(path
, "kiwi");
11508 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11509 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11510 ok(!lstrcmpA(path
, "kiwi"),
11511 "Expected path to be unchanged, got \"%s\"\n", path
);
11512 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11514 MsiCloseHandle(hpkg
);
11517 MsiCloseHandle(hdb
);
11518 DeleteFileA(msifile
);
11528 static const struct access_res create
[16] =
11530 { TRUE
, ERROR_SUCCESS
, TRUE
},
11531 { TRUE
, ERROR_SUCCESS
, TRUE
},
11532 { TRUE
, ERROR_SUCCESS
, FALSE
},
11533 { TRUE
, ERROR_SUCCESS
, FALSE
},
11534 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11535 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11536 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11537 { TRUE
, ERROR_SUCCESS
, FALSE
},
11538 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11539 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11540 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11541 { TRUE
, ERROR_SUCCESS
, TRUE
},
11542 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11543 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11544 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11545 { TRUE
, ERROR_SUCCESS
, TRUE
}
11548 static const struct access_res create_commit
[16] =
11550 { TRUE
, ERROR_SUCCESS
, TRUE
},
11551 { TRUE
, ERROR_SUCCESS
, TRUE
},
11552 { TRUE
, ERROR_SUCCESS
, FALSE
},
11553 { TRUE
, ERROR_SUCCESS
, FALSE
},
11554 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11555 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11556 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11557 { TRUE
, ERROR_SUCCESS
, FALSE
},
11558 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11559 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11560 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11561 { TRUE
, ERROR_SUCCESS
, TRUE
},
11562 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11563 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11564 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
11565 { TRUE
, ERROR_SUCCESS
, TRUE
}
11568 static const struct access_res create_close
[16] =
11570 { TRUE
, ERROR_SUCCESS
, FALSE
},
11571 { TRUE
, ERROR_SUCCESS
, FALSE
},
11572 { TRUE
, ERROR_SUCCESS
, FALSE
},
11573 { TRUE
, ERROR_SUCCESS
, FALSE
},
11574 { TRUE
, ERROR_SUCCESS
, FALSE
},
11575 { TRUE
, ERROR_SUCCESS
, FALSE
},
11576 { TRUE
, ERROR_SUCCESS
, FALSE
},
11577 { TRUE
, ERROR_SUCCESS
, FALSE
},
11578 { TRUE
, ERROR_SUCCESS
, FALSE
},
11579 { TRUE
, ERROR_SUCCESS
, FALSE
},
11580 { TRUE
, ERROR_SUCCESS
, FALSE
},
11581 { TRUE
, ERROR_SUCCESS
, FALSE
},
11582 { TRUE
, ERROR_SUCCESS
, FALSE
},
11583 { TRUE
, ERROR_SUCCESS
, FALSE
},
11584 { TRUE
, ERROR_SUCCESS
, FALSE
},
11585 { TRUE
, ERROR_SUCCESS
}
11588 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
11590 DWORD access
= 0, share
= 0;
11595 for (i
= 0; i
< 4; i
++)
11597 if (i
== 0) access
= 0;
11598 if (i
== 1) access
= GENERIC_READ
;
11599 if (i
== 2) access
= GENERIC_WRITE
;
11600 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
11602 for (j
= 0; j
< 4; j
++)
11604 if (ares
[idx
].ignore
)
11607 if (j
== 0) share
= 0;
11608 if (j
== 1) share
= FILE_SHARE_READ
;
11609 if (j
== 2) share
= FILE_SHARE_WRITE
;
11610 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
11612 SetLastError(0xdeadbeef);
11613 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
11614 FILE_ATTRIBUTE_NORMAL
, 0);
11615 lasterr
= GetLastError();
11617 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
11618 "(%d, handle, %d): Expected %d, got %d\n",
11619 line
, idx
, ares
[idx
].gothandle
,
11620 (hfile
!= INVALID_HANDLE_VALUE
));
11622 ok(lasterr
== ares
[idx
].lasterr
||
11623 lasterr
== 0xdeadbeef, /* win9x */
11624 "(%d, lasterr, %d): Expected %d, got %d\n",
11625 line
, idx
, ares
[idx
].lasterr
, lasterr
);
11627 CloseHandle(hfile
);
11633 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11635 static void test_access(void)
11640 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
11641 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11643 test_file_access(msifile
, create
);
11645 r
= MsiDatabaseCommit(hdb
);
11646 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11648 test_file_access(msifile
, create_commit
);
11650 MsiCloseHandle(hdb
);
11652 test_file_access(msifile
, create_close
);
11654 DeleteFileA(msifile
);
11656 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
11657 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11659 test_file_access(msifile
, create
);
11661 r
= MsiDatabaseCommit(hdb
);
11662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11664 test_file_access(msifile
, create_commit
);
11666 MsiCloseHandle(hdb
);
11668 test_file_access(msifile
, create_close
);
11670 DeleteFileA(msifile
);
11673 static void test_emptypackage(void)
11675 MSIHANDLE hpkg
= 0, hdb
= 0, hsuminfo
= 0;
11676 MSIHANDLE hview
= 0, hrec
= 0;
11677 MSICONDITION condition
;
11678 CHAR buffer
[MAX_PATH
];
11682 r
= MsiOpenPackageA("", &hpkg
);
11683 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
11685 skip("Not enough rights to perform tests\n");
11690 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11693 hdb
= MsiGetActiveDatabase(hpkg
);
11696 ok(hdb
!= 0, "Expected a valid database handle\n");
11699 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Tables`", &hview
);
11702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11704 r
= MsiViewExecute(hview
, 0);
11707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11710 r
= MsiViewFetch(hview
, &hrec
);
11713 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11718 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
11721 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11722 ok(!lstrcmpA(buffer
, "_Property"),
11723 "Expected \"_Property\", got \"%s\"\n", buffer
);
11726 MsiCloseHandle(hrec
);
11728 r
= MsiViewFetch(hview
, &hrec
);
11731 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11735 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
11738 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11739 ok(!lstrcmpA(buffer
, "#_FolderCache"),
11740 "Expected \"_Property\", got \"%s\"\n", buffer
);
11743 MsiCloseHandle(hrec
);
11744 MsiViewClose(hview
);
11745 MsiCloseHandle(hview
);
11747 condition
= MsiDatabaseIsTablePersistentA(hdb
, "_Property");
11750 ok(condition
== MSICONDITION_FALSE
,
11751 "Expected MSICONDITION_FALSE, got %d\n", condition
);
11754 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
11757 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11759 r
= MsiViewExecute(hview
, 0);
11762 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11765 /* _Property table is not empty */
11766 r
= MsiViewFetch(hview
, &hrec
);
11769 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11772 MsiCloseHandle(hrec
);
11773 MsiViewClose(hview
);
11774 MsiCloseHandle(hview
);
11776 condition
= MsiDatabaseIsTablePersistentA(hdb
, "#_FolderCache");
11779 ok(condition
== MSICONDITION_FALSE
,
11780 "Expected MSICONDITION_FALSE, got %d\n", condition
);
11783 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `#_FolderCache`", &hview
);
11786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11788 r
= MsiViewExecute(hview
, 0);
11791 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11794 /* #_FolderCache is not empty */
11795 r
= MsiViewFetch(hview
, &hrec
);
11798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11801 MsiCloseHandle(hrec
);
11802 MsiViewClose(hview
);
11803 MsiCloseHandle(hview
);
11805 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Streams`", &hview
);
11808 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
11809 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
11812 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Storages`", &hview
);
11815 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
11816 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
11819 r
= MsiGetSummaryInformationA(hdb
, NULL
, 0, &hsuminfo
);
11822 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
11823 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
11826 MsiCloseHandle(hsuminfo
);
11828 r
= MsiDatabaseCommit(hdb
);
11831 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11834 MsiCloseHandle(hdb
);
11835 MsiCloseHandle(hpkg
);
11838 static void test_MsiGetProductProperty(void)
11840 MSIHANDLE hprod
, hdb
;
11841 CHAR val
[MAX_PATH
];
11842 CHAR path
[MAX_PATH
];
11843 CHAR query
[MAX_PATH
];
11844 CHAR keypath
[MAX_PATH
*2];
11845 CHAR prodcode
[MAX_PATH
];
11846 CHAR prod_squashed
[MAX_PATH
];
11847 HKEY prodkey
, userkey
, props
;
11852 REGSAM access
= KEY_ALL_ACCESS
;
11855 scm
= OpenSCManager(NULL
, NULL
, SC_MANAGER_CONNECT
);
11856 if (!scm
&& (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED
))
11858 win_skip("Different registry keys on Win9x and WinMe\n");
11861 CloseServiceHandle(scm
);
11863 GetCurrentDirectoryA(MAX_PATH
, path
);
11864 lstrcatA(path
, "\\");
11866 create_test_guid(prodcode
, prod_squashed
);
11868 if (pIsWow64Process
&& pIsWow64Process(GetCurrentProcess(), &wow64
) && wow64
)
11869 access
|= KEY_WOW64_64KEY
;
11871 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
11872 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11874 r
= MsiDatabaseCommit(hdb
);
11875 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11877 r
= set_summary_info(hdb
);
11878 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11881 "CREATE TABLE `Directory` ( "
11882 "`Directory` CHAR(255) NOT NULL, "
11883 "`Directory_Parent` CHAR(255), "
11884 "`DefaultDir` CHAR(255) NOT NULL "
11885 "PRIMARY KEY `Directory`)");
11886 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11889 "CREATE TABLE `Property` ( "
11890 "`Property` CHAR(72) NOT NULL, "
11891 "`Value` CHAR(255) "
11892 "PRIMARY KEY `Property`)");
11893 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11895 sprintf(query
, "INSERT INTO `Property` "
11896 "(`Property`, `Value`) "
11897 "VALUES( 'ProductCode', '%s' )", prodcode
);
11898 r
= run_query(hdb
, query
);
11899 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11901 r
= MsiDatabaseCommit(hdb
);
11902 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11904 MsiCloseHandle(hdb
);
11906 lstrcpyA(keypath
, "Software\\Classes\\Installer\\Products\\");
11907 lstrcatA(keypath
, prod_squashed
);
11909 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, NULL
, 0, access
, NULL
, &prodkey
, NULL
);
11910 if (res
== ERROR_ACCESS_DENIED
)
11912 skip("Not enough rights to perform tests\n");
11913 DeleteFile(msifile
);
11916 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11918 lstrcpyA(keypath
, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11919 lstrcatA(keypath
, "Installer\\UserData\\S-1-5-18\\Products\\");
11920 lstrcatA(keypath
, prod_squashed
);
11922 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, NULL
, 0, access
, NULL
, &userkey
, NULL
);
11923 if (res
== ERROR_ACCESS_DENIED
)
11925 skip("Not enough rights to perform tests\n");
11926 RegDeleteKeyA(prodkey
, "");
11927 RegCloseKey(prodkey
);
11930 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11932 res
= RegCreateKeyExA(userkey
, "InstallProperties", 0, NULL
, 0, access
, NULL
, &props
, NULL
);
11933 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11935 lstrcpyA(val
, path
);
11936 lstrcatA(val
, "\\");
11937 lstrcatA(val
, msifile
);
11938 res
= RegSetValueExA(props
, "LocalPackage", 0, REG_SZ
,
11939 (const BYTE
*)val
, lstrlenA(val
) + 1);
11940 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11942 hprod
= 0xdeadbeef;
11943 r
= MsiOpenProductA(prodcode
, &hprod
);
11944 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11945 ok(hprod
!= 0 && hprod
!= 0xdeadbeef, "Expected a valid product handle\n");
11947 /* hProduct is invalid */
11949 lstrcpyA(val
, "apple");
11950 r
= MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val
, &size
);
11951 ok(r
== ERROR_INVALID_HANDLE
,
11952 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
11953 ok(!lstrcmpA(val
, "apple"),
11954 "Expected val to be unchanged, got \"%s\"\n", val
);
11955 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11957 /* szProperty is NULL */
11959 lstrcpyA(val
, "apple");
11960 r
= MsiGetProductPropertyA(hprod
, NULL
, val
, &size
);
11961 ok(r
== ERROR_INVALID_PARAMETER
,
11962 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11963 ok(!lstrcmpA(val
, "apple"),
11964 "Expected val to be unchanged, got \"%s\"\n", val
);
11965 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11967 /* szProperty is empty */
11969 lstrcpyA(val
, "apple");
11970 r
= MsiGetProductPropertyA(hprod
, "", val
, &size
);
11971 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11972 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
11973 ok(size
== 0, "Expected 0, got %d\n", size
);
11975 /* get the property */
11977 lstrcpyA(val
, "apple");
11978 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11979 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11980 ok(!lstrcmpA(val
, prodcode
),
11981 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
11982 ok(size
== lstrlenA(prodcode
),
11983 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11985 /* lpValueBuf is NULL */
11987 r
= MsiGetProductPropertyA(hprod
, "ProductCode", NULL
, &size
);
11988 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11989 ok(size
== lstrlenA(prodcode
),
11990 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11992 /* pcchValueBuf is NULL */
11993 lstrcpyA(val
, "apple");
11994 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, NULL
);
11995 ok(r
== ERROR_INVALID_PARAMETER
,
11996 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11997 ok(!lstrcmpA(val
, "apple"),
11998 "Expected val to be unchanged, got \"%s\"\n", val
);
11999 ok(size
== lstrlenA(prodcode
),
12000 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12002 /* pcchValueBuf is too small */
12004 lstrcpyA(val
, "apple");
12005 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12006 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
12007 ok(!strncmp(val
, prodcode
, 3),
12008 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
12009 ok(size
== lstrlenA(prodcode
),
12010 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12012 /* pcchValueBuf does not leave room for NULL terminator */
12013 size
= lstrlenA(prodcode
);
12014 lstrcpyA(val
, "apple");
12015 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12016 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
12017 ok(!strncmp(val
, prodcode
, lstrlenA(prodcode
) - 1),
12018 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
12019 ok(size
== lstrlenA(prodcode
),
12020 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12022 /* pcchValueBuf has enough room for NULL terminator */
12023 size
= lstrlenA(prodcode
) + 1;
12024 lstrcpyA(val
, "apple");
12025 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12026 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12027 ok(!lstrcmpA(val
, prodcode
),
12028 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12029 ok(size
== lstrlenA(prodcode
),
12030 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12032 /* nonexistent property */
12034 lstrcpyA(val
, "apple");
12035 r
= MsiGetProductPropertyA(hprod
, "IDontExist", val
, &size
);
12036 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12037 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12038 ok(size
== 0, "Expected 0, got %d\n", size
);
12040 r
= MsiSetPropertyA(hprod
, "NewProperty", "value");
12041 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12043 /* non-product property set */
12045 lstrcpyA(val
, "apple");
12046 r
= MsiGetProductPropertyA(hprod
, "NewProperty", val
, &size
);
12047 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12048 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12049 ok(size
== 0, "Expected 0, got %d\n", size
);
12051 r
= MsiSetPropertyA(hprod
, "ProductCode", "value");
12052 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12054 /* non-product property that is also a product property set */
12056 lstrcpyA(val
, "apple");
12057 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12058 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12059 ok(!lstrcmpA(val
, prodcode
),
12060 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12061 ok(size
== lstrlenA(prodcode
),
12062 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12064 MsiCloseHandle(hprod
);
12066 RegDeleteValueA(props
, "LocalPackage");
12067 delete_key(props
, "", access
);
12068 RegCloseKey(props
);
12069 delete_key(userkey
, "", access
);
12070 RegCloseKey(userkey
);
12071 delete_key(prodkey
, "", access
);
12072 RegCloseKey(prodkey
);
12073 DeleteFileA(msifile
);
12076 static void test_MsiSetProperty(void)
12078 MSIHANDLE hpkg
, hdb
, hrec
;
12079 CHAR buf
[MAX_PATH
];
12084 r
= package_from_db(create_package_db(), &hpkg
);
12085 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
12087 skip("Not enough rights to perform tests\n");
12088 DeleteFile(msifile
);
12091 ok(r
== ERROR_SUCCESS
, "Expected a valid package %u\n", r
);
12093 /* invalid hInstall */
12094 r
= MsiSetPropertyA(0, "Prop", "Val");
12095 ok(r
== ERROR_INVALID_HANDLE
,
12096 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12098 /* invalid hInstall */
12099 r
= MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12100 ok(r
== ERROR_INVALID_HANDLE
,
12101 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12103 /* szName is NULL */
12104 r
= MsiSetPropertyA(hpkg
, NULL
, "Val");
12105 ok(r
== ERROR_INVALID_PARAMETER
,
12106 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12108 /* both szName and szValue are NULL */
12109 r
= MsiSetPropertyA(hpkg
, NULL
, NULL
);
12110 ok(r
== ERROR_INVALID_PARAMETER
,
12111 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12113 /* szName is empty */
12114 r
= MsiSetPropertyA(hpkg
, "", "Val");
12115 ok(r
== ERROR_FUNCTION_FAILED
,
12116 "Expected ERROR_FUNCTION_FAILED, got %d\n", r
);
12118 /* szName is empty and szValue is NULL */
12119 r
= MsiSetPropertyA(hpkg
, "", NULL
);
12120 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12122 /* set a property */
12123 r
= MsiSetPropertyA(hpkg
, "Prop", "Val");
12124 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12126 /* get the property */
12128 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12129 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12130 ok(!lstrcmpA(buf
, "Val"), "Expected \"Val\", got \"%s\"\n", buf
);
12131 ok(size
== 3, "Expected 3, got %d\n", size
);
12133 /* update the property */
12134 r
= MsiSetPropertyA(hpkg
, "Prop", "Nuvo");
12135 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12137 /* get the property */
12139 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12140 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12141 ok(!lstrcmpA(buf
, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf
);
12142 ok(size
== 4, "Expected 4, got %d\n", size
);
12144 hdb
= MsiGetActiveDatabase(hpkg
);
12145 ok(hdb
!= 0, "Expected a valid database handle\n");
12147 /* set prop is not in the _Property table */
12148 query
= "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12149 r
= do_query(hdb
, query
, &hrec
);
12150 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12151 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12153 /* set prop is not in the Property table */
12154 query
= "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12155 r
= do_query(hdb
, query
, &hrec
);
12156 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12157 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12159 MsiCloseHandle(hdb
);
12161 /* szValue is an empty string */
12162 r
= MsiSetPropertyA(hpkg
, "Prop", "");
12163 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12165 /* try to get the property */
12167 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12168 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12169 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
12170 ok(size
== 0, "Expected 0, got %d\n", size
);
12172 /* reset the property */
12173 r
= MsiSetPropertyA(hpkg
, "Prop", "BlueTap");
12174 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12176 /* delete the property */
12177 r
= MsiSetPropertyA(hpkg
, "Prop", NULL
);
12178 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12180 /* try to get the property */
12182 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12183 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12184 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
12185 ok(size
== 0, "Expected 0, got %d\n", size
);
12187 MsiCloseHandle(hpkg
);
12188 DeleteFileA(msifile
);
12191 static void test_MsiApplyMultiplePatches(void)
12193 UINT r
, type
= GetDriveType(NULL
);
12195 if (!pMsiApplyMultiplePatchesA
) {
12196 win_skip("MsiApplyMultiplePatchesA not found\n");
12200 r
= pMsiApplyMultiplePatchesA(NULL
, NULL
, NULL
);
12201 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
12203 r
= pMsiApplyMultiplePatchesA("", NULL
, NULL
);
12204 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
12206 r
= pMsiApplyMultiplePatchesA(";", NULL
, NULL
);
12209 if (type
== DRIVE_FIXED
)
12210 ok(r
== ERROR_PATH_NOT_FOUND
,
12211 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
12213 ok(r
== ERROR_INVALID_NAME
,
12214 "Expected ERROR_INVALID_NAME, got %u\n", r
);
12217 r
= pMsiApplyMultiplePatchesA(" ;", NULL
, NULL
);
12220 if (type
== DRIVE_FIXED
)
12221 ok(r
== ERROR_PATCH_PACKAGE_OPEN_FAILED
,
12222 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r
);
12224 ok(r
== ERROR_INVALID_NAME
,
12225 "Expected ERROR_INVALID_NAME, got %u\n", r
);
12228 r
= pMsiApplyMultiplePatchesA(";;", NULL
, NULL
);
12231 if (type
== DRIVE_FIXED
)
12232 ok(r
== ERROR_PATH_NOT_FOUND
,
12233 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
12235 ok(r
== ERROR_INVALID_NAME
,
12236 "Expected ERROR_INVALID_NAME, got %u\n", r
);
12239 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL
, NULL
);
12240 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
12242 r
= pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL
, NULL
);
12245 if (type
== DRIVE_FIXED
)
12246 ok(r
== ERROR_PATH_NOT_FOUND
,
12247 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
12249 ok(r
== ERROR_INVALID_NAME
,
12250 "Expected ERROR_INVALID_NAME, got %u\n", r
);
12253 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL
, NULL
);
12254 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
12256 r
= pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL
, NULL
);
12257 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
12260 static void test_MsiApplyPatch(void)
12264 r
= MsiApplyPatch(NULL
, NULL
, INSTALLTYPE_DEFAULT
, NULL
);
12265 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
12267 r
= MsiApplyPatch("", NULL
, INSTALLTYPE_DEFAULT
, NULL
);
12268 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
12271 START_TEST(package
)
12273 STATEMGRSTATUS status
;
12276 init_functionpointers();
12278 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
12280 /* Create a restore point ourselves so we circumvent the multitude of restore points
12281 * that would have been created by all the installation and removal tests.
12283 if (pSRSetRestorePointA
)
12285 memset(&status
, 0, sizeof(status
));
12286 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
12289 test_createpackage();
12291 test_gettargetpath_bad();
12292 test_settargetpath();
12294 test_property_table();
12297 test_formatrecord2();
12299 test_getproperty();
12300 test_removefiles();
12302 test_appsearch_complocator();
12303 test_appsearch_reglocator();
12304 test_appsearch_inilocator();
12305 test_appsearch_drlocator();
12306 test_featureparents();
12307 test_installprops();
12308 test_launchconditions();
12310 test_complocator();
12311 test_MsiGetSourcePath();
12312 test_shortlongsource();
12315 test_emptypackage();
12316 test_MsiGetProductProperty();
12317 test_MsiSetProperty();
12318 test_MsiApplyMultiplePatches();
12319 test_MsiApplyPatch();
12321 if (pSRSetRestorePointA
&& ret
)
12323 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
12325 remove_restore_point(status
.llSequenceNumber
);