2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/test.h"
32 static const char msifile
[] = "winetest.msi";
33 char CURR_DIR
[MAX_PATH
];
35 static UINT (WINAPI
*pMsiApplyMultiplePatchesA
)(LPCSTR
, LPCSTR
, LPCSTR
);
37 static void get_user_sid(LPSTR
*usersid
)
43 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
44 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
47 pConvertSidToStringSidA
= (void *)GetProcAddress(hadvapi32
, "ConvertSidToStringSidA");
48 if (!pConvertSidToStringSidA
)
51 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
53 GetTokenInformation(token
, TokenUser
, buf
, size
, &size
);
54 user
= (PTOKEN_USER
)buf
;
55 pConvertSidToStringSidA(user
->User
.Sid
, usersid
);
59 /* RegDeleteTreeW from dlls/advapi32/registry.c */
60 static LSTATUS
package_RegDeleteTreeW(HKEY hKey
, LPCWSTR lpszSubKey
)
63 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
64 DWORD dwMaxLen
, dwSize
;
65 WCHAR szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
70 ret
= RegOpenKeyExW(hKey
, lpszSubKey
, 0, KEY_READ
, &hSubKey
);
74 ret
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, NULL
,
75 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
76 if (ret
) goto cleanup
;
80 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
81 if (dwMaxLen
> sizeof(szNameBuf
)/sizeof(WCHAR
))
83 /* Name too big: alloc a buffer for it */
84 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
*sizeof(WCHAR
))))
86 ret
= ERROR_NOT_ENOUGH_MEMORY
;
91 /* Recursively delete all the subkeys */
95 if (RegEnumKeyExW(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
96 NULL
, NULL
, NULL
)) break;
98 ret
= package_RegDeleteTreeW(hSubKey
, lpszName
);
99 if (ret
) goto cleanup
;
103 ret
= RegDeleteKeyW(hKey
, lpszSubKey
);
108 if (RegEnumValueW(hKey
, 0, lpszName
, &dwSize
,
109 NULL
, NULL
, NULL
, NULL
)) break;
111 ret
= RegDeleteValueW(hKey
, lpszName
);
112 if (ret
) goto cleanup
;
116 if (lpszName
!= szNameBuf
)
117 HeapFree(GetProcessHeap(), 0, lpszName
);
119 RegCloseKey(hSubKey
);
123 static BOOL
squash_guid(LPCWSTR in
, LPWSTR out
)
128 if (FAILED(CLSIDFromString((LPOLESTR
)in
, &guid
)))
142 out
[17+i
*2] = in
[n
++];
143 out
[16+i
*2] = in
[n
++];
148 out
[17+i
*2] = in
[n
++];
149 out
[16+i
*2] = in
[n
++];
155 static void create_test_guid(LPSTR prodcode
, LPSTR squashed
)
157 WCHAR guidW
[MAX_PATH
];
158 WCHAR squashedW
[MAX_PATH
];
163 hr
= CoCreateGuid(&guid
);
164 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
166 size
= StringFromGUID2(&guid
, guidW
, MAX_PATH
);
167 ok(size
== 39, "Expected 39, got %d\n", hr
);
169 WideCharToMultiByte(CP_ACP
, 0, guidW
, size
, prodcode
, MAX_PATH
, NULL
, NULL
);
170 squash_guid(guidW
, squashedW
);
171 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
174 static void set_component_path(LPCSTR filename
, MSIINSTALLCONTEXT context
,
175 LPCSTR guid
, LPSTR usersid
, BOOL dir
)
177 WCHAR guidW
[MAX_PATH
];
178 WCHAR squashedW
[MAX_PATH
];
179 CHAR squashed
[MAX_PATH
];
180 CHAR comppath
[MAX_PATH
];
181 CHAR prodpath
[MAX_PATH
];
186 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
187 squash_guid(guidW
, squashedW
);
188 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
190 if (context
== MSIINSTALLCONTEXT_MACHINE
)
192 prod
= "3D0DAE300FACA1300AD792060BCDAA92";
194 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
195 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
197 "SOFTWARE\\Classes\\Installer\\"
198 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
200 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
202 prod
= "7D2F387510109040002000060BECB6AB";
204 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
205 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
207 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
208 "Installer\\%s\\Installer\\Products\\"
209 "7D2F387510109040002000060BECB6AB", usersid
);
211 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
213 prod
= "7D2F387510109040002000060BECB6AB";
215 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
216 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
218 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
219 "Installer\\Managed\\%s\\Installer\\Products\\"
220 "7D2F387510109040002000060BECB6AB", usersid
);
223 RegCreateKeyA(HKEY_LOCAL_MACHINE
, comppath
, &hkey
);
225 lstrcpyA(path
, CURR_DIR
);
226 lstrcatA(path
, "\\");
227 if (!dir
) lstrcatA(path
, filename
);
229 RegSetValueExA(hkey
, prod
, 0, REG_SZ
, (LPBYTE
)path
, lstrlenA(path
));
232 RegCreateKeyA(HKEY_LOCAL_MACHINE
, prodpath
, &hkey
);
236 static void delete_component_path(LPCSTR guid
, MSIINSTALLCONTEXT context
, LPSTR usersid
)
238 WCHAR guidW
[MAX_PATH
];
239 WCHAR squashedW
[MAX_PATH
];
240 WCHAR substrW
[MAX_PATH
];
241 CHAR squashed
[MAX_PATH
];
242 CHAR comppath
[MAX_PATH
];
243 CHAR prodpath
[MAX_PATH
];
245 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
246 squash_guid(guidW
, squashedW
);
247 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
249 if (context
== MSIINSTALLCONTEXT_MACHINE
)
252 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
253 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
255 "SOFTWARE\\Classes\\Installer\\"
256 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
258 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
261 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
262 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
264 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
265 "Installer\\%s\\Installer\\Products\\"
266 "7D2F387510109040002000060BECB6AB", usersid
);
268 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
271 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
272 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
274 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
275 "Installer\\Managed\\%s\\Installer\\Products\\"
276 "7D2F387510109040002000060BECB6AB", usersid
);
279 MultiByteToWideChar(CP_ACP
, 0, comppath
, -1, substrW
, MAX_PATH
);
280 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
282 MultiByteToWideChar(CP_ACP
, 0, prodpath
, -1, substrW
, MAX_PATH
);
283 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
286 static UINT
do_query(MSIHANDLE hdb
, const char *query
, MSIHANDLE
*phrec
)
291 /* open a select query */
292 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
293 if (r
!= ERROR_SUCCESS
)
295 r
= MsiViewExecute(hview
, 0);
296 if (r
!= ERROR_SUCCESS
)
298 ret
= MsiViewFetch(hview
, phrec
);
299 r
= MsiViewClose(hview
);
300 if (r
!= ERROR_SUCCESS
)
302 r
= MsiCloseHandle(hview
);
303 if (r
!= ERROR_SUCCESS
)
308 static UINT
run_query( MSIHANDLE hdb
, const char *query
)
313 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
314 if( r
!= ERROR_SUCCESS
)
317 r
= MsiViewExecute(hview
, 0);
318 if( r
== ERROR_SUCCESS
)
319 r
= MsiViewClose(hview
);
320 MsiCloseHandle(hview
);
324 static UINT
create_component_table( MSIHANDLE hdb
)
326 return run_query( hdb
,
327 "CREATE TABLE `Component` ( "
328 "`Component` CHAR(72) NOT NULL, "
329 "`ComponentId` CHAR(38), "
330 "`Directory_` CHAR(72) NOT NULL, "
331 "`Attributes` SHORT NOT NULL, "
332 "`Condition` CHAR(255), "
333 "`KeyPath` CHAR(72) "
334 "PRIMARY KEY `Component`)" );
337 static UINT
create_feature_table( MSIHANDLE hdb
)
339 return run_query( hdb
,
340 "CREATE TABLE `Feature` ( "
341 "`Feature` CHAR(38) NOT NULL, "
342 "`Feature_Parent` CHAR(38), "
344 "`Description` CHAR(255), "
345 "`Display` SHORT NOT NULL, "
346 "`Level` SHORT NOT NULL, "
347 "`Directory_` CHAR(72), "
348 "`Attributes` SHORT NOT NULL "
349 "PRIMARY KEY `Feature`)" );
352 static UINT
create_feature_components_table( MSIHANDLE hdb
)
354 return run_query( hdb
,
355 "CREATE TABLE `FeatureComponents` ( "
356 "`Feature_` CHAR(38) NOT NULL, "
357 "`Component_` CHAR(72) NOT NULL "
358 "PRIMARY KEY `Feature_`, `Component_` )" );
361 static UINT
create_file_table( MSIHANDLE hdb
)
363 return run_query( hdb
,
364 "CREATE TABLE `File` ("
365 "`File` CHAR(72) NOT NULL, "
366 "`Component_` CHAR(72) NOT NULL, "
367 "`FileName` CHAR(255) NOT NULL, "
368 "`FileSize` LONG NOT NULL, "
369 "`Version` CHAR(72), "
370 "`Language` CHAR(20), "
371 "`Attributes` SHORT, "
372 "`Sequence` SHORT NOT NULL "
373 "PRIMARY KEY `File`)" );
376 static UINT
create_remove_file_table( MSIHANDLE hdb
)
378 return run_query( hdb
,
379 "CREATE TABLE `RemoveFile` ("
380 "`FileKey` CHAR(72) NOT NULL, "
381 "`Component_` CHAR(72) NOT NULL, "
382 "`FileName` CHAR(255) LOCALIZABLE, "
383 "`DirProperty` CHAR(72) NOT NULL, "
384 "`InstallMode` SHORT NOT NULL "
385 "PRIMARY KEY `FileKey`)" );
388 static UINT
create_appsearch_table( MSIHANDLE hdb
)
390 return run_query( hdb
,
391 "CREATE TABLE `AppSearch` ("
392 "`Property` CHAR(72) NOT NULL, "
393 "`Signature_` CHAR(72) NOT NULL "
394 "PRIMARY KEY `Property`, `Signature_`)" );
397 static UINT
create_reglocator_table( MSIHANDLE hdb
)
399 return run_query( hdb
,
400 "CREATE TABLE `RegLocator` ("
401 "`Signature_` CHAR(72) NOT NULL, "
402 "`Root` SHORT NOT NULL, "
403 "`Key` CHAR(255) NOT NULL, "
406 "PRIMARY KEY `Signature_`)" );
409 static UINT
create_signature_table( MSIHANDLE hdb
)
411 return run_query( hdb
,
412 "CREATE TABLE `Signature` ("
413 "`Signature` CHAR(72) NOT NULL, "
414 "`FileName` CHAR(255) NOT NULL, "
415 "`MinVersion` CHAR(20), "
416 "`MaxVersion` CHAR(20), "
421 "`Languages` CHAR(255) "
422 "PRIMARY KEY `Signature`)" );
425 static UINT
create_launchcondition_table( MSIHANDLE hdb
)
427 return run_query( hdb
,
428 "CREATE TABLE `LaunchCondition` ("
429 "`Condition` CHAR(255) NOT NULL, "
430 "`Description` CHAR(255) NOT NULL "
431 "PRIMARY KEY `Condition`)" );
434 static UINT
create_property_table( MSIHANDLE hdb
)
436 return run_query( hdb
,
437 "CREATE TABLE `Property` ("
438 "`Property` CHAR(72) NOT NULL, "
440 "PRIMARY KEY `Property`)" );
443 static UINT
create_install_execute_sequence_table( MSIHANDLE hdb
)
445 return run_query( hdb
,
446 "CREATE TABLE `InstallExecuteSequence` ("
447 "`Action` CHAR(72) NOT NULL, "
448 "`Condition` CHAR(255), "
450 "PRIMARY KEY `Action`)" );
453 static UINT
create_media_table( MSIHANDLE hdb
)
455 return run_query( hdb
,
456 "CREATE TABLE `Media` ("
457 "`DiskId` SHORT NOT NULL, "
458 "`LastSequence` SHORT NOT NULL, "
459 "`DiskPrompt` CHAR(64), "
460 "`Cabinet` CHAR(255), "
461 "`VolumeLabel` CHAR(32), "
463 "PRIMARY KEY `DiskId`)" );
466 static UINT
create_ccpsearch_table( MSIHANDLE hdb
)
468 return run_query( hdb
,
469 "CREATE TABLE `CCPSearch` ("
470 "`Signature_` CHAR(72) NOT NULL "
471 "PRIMARY KEY `Signature_`)" );
474 static UINT
create_drlocator_table( MSIHANDLE hdb
)
476 return run_query( hdb
,
477 "CREATE TABLE `DrLocator` ("
478 "`Signature_` CHAR(72) NOT NULL, "
479 "`Parent` CHAR(72), "
482 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
485 static UINT
create_complocator_table( MSIHANDLE hdb
)
487 return run_query( hdb
,
488 "CREATE TABLE `CompLocator` ("
489 "`Signature_` CHAR(72) NOT NULL, "
490 "`ComponentId` CHAR(38) NOT NULL, "
492 "PRIMARY KEY `Signature_`)" );
495 static UINT
create_inilocator_table( MSIHANDLE hdb
)
497 return run_query( hdb
,
498 "CREATE TABLE `IniLocator` ("
499 "`Signature_` CHAR(72) NOT NULL, "
500 "`FileName` CHAR(255) NOT NULL, "
501 "`Section` CHAR(96)NOT NULL, "
502 "`Key` CHAR(128)NOT NULL, "
505 "PRIMARY KEY `Signature_`)" );
508 #define make_add_entry(type, qtext) \
509 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
511 char insert[] = qtext; \
514 sz = strlen(values) + sizeof insert; \
515 query = HeapAlloc(GetProcessHeap(),0,sz); \
516 sprintf(query,insert,values); \
517 r = run_query( hdb, query ); \
518 HeapFree(GetProcessHeap(), 0, query); \
522 make_add_entry(component
,
523 "INSERT INTO `Component` "
524 "(`Component`, `ComponentId`, `Directory_`, "
525 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
527 make_add_entry(directory
,
528 "INSERT INTO `Directory` "
529 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
531 make_add_entry(feature
,
532 "INSERT INTO `Feature` "
533 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
534 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
536 make_add_entry(feature_components
,
537 "INSERT INTO `FeatureComponents` "
538 "(`Feature_`, `Component_`) VALUES( %s )")
541 "INSERT INTO `File` "
542 "(`File`, `Component_`, `FileName`, `FileSize`, "
543 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
545 make_add_entry(appsearch
,
546 "INSERT INTO `AppSearch` "
547 "(`Property`, `Signature_`) VALUES( %s )")
549 make_add_entry(reglocator
,
550 "INSERT INTO `RegLocator` "
551 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
553 make_add_entry(signature
,
554 "INSERT INTO `Signature` "
555 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
556 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
559 make_add_entry(launchcondition
,
560 "INSERT INTO `LaunchCondition` "
561 "(`Condition`, `Description`) VALUES( %s )")
563 make_add_entry(property
,
564 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
566 make_add_entry(install_execute_sequence
,
567 "INSERT INTO `InstallExecuteSequence` "
568 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
570 make_add_entry(media
,
571 "INSERT INTO `Media` "
572 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
573 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
575 make_add_entry(ccpsearch
,
576 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
578 make_add_entry(drlocator
,
579 "INSERT INTO `DrLocator` "
580 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
582 make_add_entry(complocator
,
583 "INSERT INTO `CompLocator` "
584 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
586 make_add_entry(inilocator
,
587 "INSERT INTO `IniLocator` "
588 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
591 static UINT
set_summary_info(MSIHANDLE hdb
)
596 /* build summary info */
597 res
= MsiGetSummaryInformation(hdb
, NULL
, 7, &suminfo
);
598 ok( res
== ERROR_SUCCESS
, "Failed to open summaryinfo\n" );
600 res
= MsiSummaryInfoSetProperty(suminfo
,2, VT_LPSTR
, 0,NULL
,
601 "Installation Database");
602 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
604 res
= MsiSummaryInfoSetProperty(suminfo
,3, VT_LPSTR
, 0,NULL
,
605 "Installation Database");
606 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
608 res
= MsiSummaryInfoSetProperty(suminfo
,4, VT_LPSTR
, 0,NULL
,
610 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
612 res
= MsiSummaryInfoSetProperty(suminfo
,7, VT_LPSTR
, 0,NULL
,
614 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
616 res
= MsiSummaryInfoSetProperty(suminfo
,9, VT_LPSTR
, 0,NULL
,
617 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
618 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
620 res
= MsiSummaryInfoSetProperty(suminfo
, 14, VT_I4
, 100, NULL
, NULL
);
621 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
623 res
= MsiSummaryInfoSetProperty(suminfo
, 15, VT_I4
, 0, NULL
, NULL
);
624 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
626 res
= MsiSummaryInfoPersist(suminfo
);
627 ok( res
== ERROR_SUCCESS
, "Failed to make summary info persist\n" );
629 res
= MsiCloseHandle( suminfo
);
630 ok( res
== ERROR_SUCCESS
, "Failed to close suminfo\n" );
636 static MSIHANDLE
create_package_db(void)
643 /* create an empty database */
644 res
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
645 ok( res
== ERROR_SUCCESS
, "Failed to create database\n" );
646 if( res
!= ERROR_SUCCESS
)
649 res
= MsiDatabaseCommit( hdb
);
650 ok( res
== ERROR_SUCCESS
, "Failed to commit database\n" );
652 res
= set_summary_info(hdb
);
654 res
= run_query( hdb
,
655 "CREATE TABLE `Directory` ( "
656 "`Directory` CHAR(255) NOT NULL, "
657 "`Directory_Parent` CHAR(255), "
658 "`DefaultDir` CHAR(255) NOT NULL "
659 "PRIMARY KEY `Directory`)" );
660 ok( res
== ERROR_SUCCESS
, "Failed to create directory table\n" );
665 static MSIHANDLE
package_from_db(MSIHANDLE hdb
)
671 sprintf(szPackage
,"#%i",hdb
);
672 res
= MsiOpenPackage(szPackage
,&hPackage
);
673 if (res
!= ERROR_SUCCESS
)
676 res
= MsiCloseHandle(hdb
);
677 if (res
!= ERROR_SUCCESS
)
683 static void create_test_file(const CHAR
*name
)
688 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
689 ok(file
!= INVALID_HANDLE_VALUE
, "Failure to open file %s\n", name
);
690 WriteFile(file
, name
, strlen(name
), &written
, NULL
);
691 WriteFile(file
, "\n", strlen("\n"), &written
, NULL
);
695 typedef struct _tagVS_VERSIONINFO
702 VS_FIXEDFILEINFO Value
;
707 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
708 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
710 static BOOL
create_file_with_version(const CHAR
*name
, LONG ms
, LONG ls
)
712 VS_VERSIONINFO
*pVerInfo
;
713 VS_FIXEDFILEINFO
*pFixedInfo
;
720 GetSystemDirectory(path
, MAX_PATH
);
721 lstrcatA(path
, "\\kernel32.dll");
723 CopyFileA(path
, name
, FALSE
);
725 size
= GetFileVersionInfoSize(path
, &handle
);
726 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
728 GetFileVersionInfoA(path
, 0, size
, buffer
);
730 pVerInfo
= (VS_VERSIONINFO
*)buffer
;
731 ofs
= (BYTE
*)&pVerInfo
->szKey
[lstrlenW(pVerInfo
->szKey
) + 1];
732 pFixedInfo
= (VS_FIXEDFILEINFO
*)roundpos(pVerInfo
, ofs
, 4);
734 pFixedInfo
->dwFileVersionMS
= ms
;
735 pFixedInfo
->dwFileVersionLS
= ls
;
736 pFixedInfo
->dwProductVersionMS
= ms
;
737 pFixedInfo
->dwProductVersionLS
= ls
;
739 resource
= BeginUpdateResource(name
, FALSE
);
743 if (!UpdateResource(resource
, RT_VERSION
, MAKEINTRESOURCE(VS_VERSION_INFO
),
744 MAKELANGID(LANG_NEUTRAL
, SUBLANG_NEUTRAL
), buffer
, size
))
747 if (!EndUpdateResource(resource
, FALSE
))
753 HeapFree(GetProcessHeap(), 0, buffer
);
757 static void test_createpackage(void)
759 MSIHANDLE hPackage
= 0;
762 hPackage
= package_from_db(create_package_db());
763 ok( hPackage
!= 0, " Failed to create package\n");
765 res
= MsiCloseHandle( hPackage
);
766 ok( res
== ERROR_SUCCESS
, "Failed to close package\n" );
770 static void test_doaction( void )
775 r
= MsiDoAction( -1, NULL
);
776 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
778 hpkg
= package_from_db(create_package_db());
779 ok( hpkg
, "failed to create package\n");
781 r
= MsiDoAction(hpkg
, NULL
);
782 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
784 r
= MsiDoAction(0, "boo");
785 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
787 r
= MsiDoAction(hpkg
, "boo");
788 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "wrong return val\n");
790 MsiCloseHandle( hpkg
);
794 static void test_gettargetpath_bad(void)
801 hpkg
= package_from_db(create_package_db());
802 ok( hpkg
, "failed to create package\n");
804 r
= MsiGetTargetPath( 0, NULL
, NULL
, NULL
);
805 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
807 r
= MsiGetTargetPath( 0, NULL
, NULL
, &sz
);
808 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
810 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
811 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
813 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
814 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
816 r
= MsiGetTargetPath( hpkg
, "boo", NULL
, NULL
);
817 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
819 r
= MsiGetTargetPath( hpkg
, "boo", buffer
, NULL
);
820 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
822 MsiCloseHandle( hpkg
);
826 static void query_file_path(MSIHANDLE hpkg
, LPCSTR file
, LPSTR buff
)
832 rec
= MsiCreateRecord( 1 );
833 ok(rec
, "MsiCreate record failed\n");
835 r
= MsiRecordSetString( rec
, 0, file
);
836 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
839 r
= MsiFormatRecord( hpkg
, rec
, buff
, &size
);
840 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
842 MsiCloseHandle( rec
);
845 static void test_settargetpath(void)
847 char tempdir
[MAX_PATH
+8], buffer
[MAX_PATH
], file
[MAX_PATH
];
853 hdb
= create_package_db();
854 ok ( hdb
, "failed to create package database\n" );
856 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
857 ok( r
== S_OK
, "failed to add directory entry: %d\n" , r
);
859 r
= create_component_table( hdb
);
860 ok( r
== S_OK
, "cannot create Component table: %d\n", r
);
862 r
= add_component_entry( hdb
, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
863 ok( r
== S_OK
, "cannot add dummy component: %d\n", r
);
865 r
= add_component_entry( hdb
, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
866 ok( r
== S_OK
, "cannot add test component: %d\n", r
);
868 r
= create_feature_table( hdb
);
869 ok( r
== S_OK
, "cannot create Feature table: %d\n", r
);
871 r
= add_feature_entry( hdb
, "'TestFeature', '', '', '', 0, 1, '', 0" );
872 ok( r
== ERROR_SUCCESS
, "cannot add TestFeature to Feature table: %d\n", r
);
874 r
= create_feature_components_table( hdb
);
875 ok( r
== S_OK
, "cannot create FeatureComponents table: %d\n", r
);
877 r
= add_feature_components_entry( hdb
, "'TestFeature', 'RootComp'" );
878 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
880 r
= add_feature_components_entry( hdb
, "'TestFeature', 'TestComp'" );
881 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
883 add_directory_entry( hdb
, "'TestParent', 'TARGETDIR', 'TestParent'" );
884 add_directory_entry( hdb
, "'TestDir', 'TestParent', 'TestDir'" );
886 r
= create_file_table( hdb
);
887 ok( r
== S_OK
, "cannot create File table: %d\n", r
);
889 r
= add_file_entry( hdb
, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
890 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
892 r
= add_file_entry( hdb
, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
893 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
895 hpkg
= package_from_db( hdb
);
896 ok( hpkg
, "failed to create package\n");
898 r
= MsiDoAction( hpkg
, "CostInitialize");
899 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
901 r
= MsiDoAction( hpkg
, "FileCost");
902 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
904 r
= MsiDoAction( hpkg
, "CostFinalize");
905 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
907 r
= MsiSetTargetPath( 0, NULL
, NULL
);
908 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
910 r
= MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
911 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
913 r
= MsiSetTargetPath( hpkg
, "boo", NULL
);
914 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
916 r
= MsiSetTargetPath( hpkg
, "boo", "c:\\bogusx" );
917 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
919 sz
= sizeof tempdir
- 1;
920 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", tempdir
, &sz
);
921 sprintf( file
, "%srootfile.txt", tempdir
);
922 query_file_path( hpkg
, "[#RootFile]", buffer
);
923 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
924 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
926 GetTempFileName( tempdir
, "_wt", 0, buffer
);
927 sprintf( tempdir
, "%s\\subdir", buffer
);
929 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
930 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
931 "MsiSetTargetPath on file returned %d\n", r
);
933 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
934 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
935 "MsiSetTargetPath on 'subdir' of file returned %d\n", r
);
937 DeleteFile( buffer
);
939 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
940 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
942 r
= GetFileAttributes( buffer
);
943 ok ( r
== INVALID_FILE_ATTRIBUTES
, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r
);
945 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
946 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath on subsubdir returned %d\n", r
);
948 sz
= sizeof buffer
- 1;
949 lstrcat( tempdir
, "\\" );
950 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", buffer
, &sz
);
951 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
952 ok( !lstrcmp(buffer
, tempdir
), "Expected %s, got %s\n", tempdir
, buffer
);
954 sprintf( file
, "%srootfile.txt", tempdir
);
955 query_file_path( hpkg
, "[#RootFile]", buffer
);
956 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
958 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two" );
959 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
961 query_file_path( hpkg
, "[#TestFile]", buffer
);
962 ok( !lstrcmp(buffer
, "C:\\one\\two\\TestDir\\testfile.txt"),
963 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer
);
965 sz
= sizeof buffer
- 1;
966 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
967 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
968 ok( !lstrcmp(buffer
, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer
);
970 MsiCloseHandle( hpkg
);
973 static void test_condition(void)
978 hpkg
= package_from_db(create_package_db());
979 ok( hpkg
, "failed to create package\n");
981 r
= MsiEvaluateCondition(0, NULL
);
982 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
984 r
= MsiEvaluateCondition(hpkg
, NULL
);
985 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
987 r
= MsiEvaluateCondition(hpkg
, "");
988 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
990 r
= MsiEvaluateCondition(hpkg
, "1");
991 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
993 r
= MsiEvaluateCondition(hpkg
, "0");
994 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
996 r
= MsiEvaluateCondition(hpkg
, "-1");
997 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
999 r
= MsiEvaluateCondition(hpkg
, "0 = 0");
1000 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1002 r
= MsiEvaluateCondition(hpkg
, "0 <> 0");
1003 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1005 r
= MsiEvaluateCondition(hpkg
, "0 = 1");
1006 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1008 r
= MsiEvaluateCondition(hpkg
, "0 > 1");
1009 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1011 r
= MsiEvaluateCondition(hpkg
, "0 ~> 1");
1012 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1014 r
= MsiEvaluateCondition(hpkg
, "1 > 1");
1015 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1017 r
= MsiEvaluateCondition(hpkg
, "1 ~> 1");
1018 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1020 r
= MsiEvaluateCondition(hpkg
, "0 >= 1");
1021 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1023 r
= MsiEvaluateCondition(hpkg
, "0 ~>= 1");
1024 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1026 r
= MsiEvaluateCondition(hpkg
, "1 >= 1");
1027 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1029 r
= MsiEvaluateCondition(hpkg
, "1 ~>= 1");
1030 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1032 r
= MsiEvaluateCondition(hpkg
, "0 < 1");
1033 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1035 r
= MsiEvaluateCondition(hpkg
, "0 ~< 1");
1036 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1038 r
= MsiEvaluateCondition(hpkg
, "1 < 1");
1039 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1041 r
= MsiEvaluateCondition(hpkg
, "1 ~< 1");
1042 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1044 r
= MsiEvaluateCondition(hpkg
, "0 <= 1");
1045 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1047 r
= MsiEvaluateCondition(hpkg
, "0 ~<= 1");
1048 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1050 r
= MsiEvaluateCondition(hpkg
, "1 <= 1");
1051 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1053 r
= MsiEvaluateCondition(hpkg
, "1 ~<= 1");
1054 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1056 r
= MsiEvaluateCondition(hpkg
, "0 >=");
1057 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1059 r
= MsiEvaluateCondition(hpkg
, " ");
1060 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1062 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"1\"");
1063 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1065 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"0\"");
1066 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1068 r
= MsiEvaluateCondition(hpkg
, "LicView <> LicView");
1069 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1071 r
= MsiEvaluateCondition(hpkg
, "not 0");
1072 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1074 r
= MsiEvaluateCondition(hpkg
, "not LicView");
1075 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1077 r
= MsiEvaluateCondition(hpkg
, "\"Testing\" ~<< \"Testing\"");
1078 ok (r
== MSICONDITION_TRUE
, "wrong return val\n");
1080 r
= MsiEvaluateCondition(hpkg
, "LicView ~<< \"Testing\"");
1081 ok (r
== MSICONDITION_FALSE
, "wrong return val\n");
1083 r
= MsiEvaluateCondition(hpkg
, "Not LicView ~<< \"Testing\"");
1084 ok (r
== MSICONDITION_TRUE
, "wrong return val\n");
1086 r
= MsiEvaluateCondition(hpkg
, "not \"A\"");
1087 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1089 r
= MsiEvaluateCondition(hpkg
, "~not \"A\"");
1090 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1092 r
= MsiEvaluateCondition(hpkg
, "\"0\"");
1093 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1095 r
= MsiEvaluateCondition(hpkg
, "1 and 2");
1096 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1098 r
= MsiEvaluateCondition(hpkg
, "not 0 and 3");
1099 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1101 r
= MsiEvaluateCondition(hpkg
, "not 0 and 0");
1102 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1104 r
= MsiEvaluateCondition(hpkg
, "not 0 or 1");
1105 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1107 r
= MsiEvaluateCondition(hpkg
, "(0)");
1108 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1110 r
= MsiEvaluateCondition(hpkg
, "(((((1))))))");
1111 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1113 r
= MsiEvaluateCondition(hpkg
, "(((((1)))))");
1114 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1116 r
= MsiEvaluateCondition(hpkg
, " \"A\" < \"B\" ");
1117 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1119 r
= MsiEvaluateCondition(hpkg
, " \"A\" > \"B\" ");
1120 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1122 r
= MsiEvaluateCondition(hpkg
, " \"1\" > \"12\" ");
1123 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1125 r
= MsiEvaluateCondition(hpkg
, " \"100\" < \"21\" ");
1126 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1128 r
= MsiEvaluateCondition(hpkg
, "0 < > 0");
1129 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1131 r
= MsiEvaluateCondition(hpkg
, "(1<<1) == 2");
1132 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1134 r
= MsiEvaluateCondition(hpkg
, " \"A\" = \"a\" ");
1135 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1137 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~ = \"a\" ");
1138 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1140 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= \"a\" ");
1141 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1143 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= 1 ");
1144 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1146 r
= MsiEvaluateCondition(hpkg
, " \"A\" = 1 ");
1147 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1149 r
= MsiEvaluateCondition(hpkg
, " 1 ~= 1 ");
1150 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1152 r
= MsiEvaluateCondition(hpkg
, " 1 ~= \"1\" ");
1153 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1155 r
= MsiEvaluateCondition(hpkg
, " 1 = \"1\" ");
1156 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1158 r
= MsiEvaluateCondition(hpkg
, " 0 = \"1\" ");
1159 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1161 r
= MsiEvaluateCondition(hpkg
, " 0 < \"100\" ");
1162 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1164 r
= MsiEvaluateCondition(hpkg
, " 100 > \"0\" ");
1165 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1167 r
= MsiEvaluateCondition(hpkg
, "1 XOR 1");
1168 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1170 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1");
1171 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1173 r
= MsiEvaluateCondition(hpkg
, "1 IMP 0");
1174 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1176 r
= MsiEvaluateCondition(hpkg
, "0 IMP 0");
1177 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1179 r
= MsiEvaluateCondition(hpkg
, "0 EQV 0");
1180 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1182 r
= MsiEvaluateCondition(hpkg
, "0 EQV 1");
1183 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1185 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1 OR 0");
1186 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1188 r
= MsiEvaluateCondition(hpkg
, "1 IMPL 1");
1189 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1191 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" >< \"S\" ");
1192 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1194 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"s\" ");
1195 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1197 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"\" ");
1198 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1200 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"sss\" ");
1201 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1203 MsiSetProperty(hpkg
, "mm", "5" );
1205 r
= MsiEvaluateCondition(hpkg
, "mm = 5");
1206 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1208 r
= MsiEvaluateCondition(hpkg
, "mm < 6");
1209 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1211 r
= MsiEvaluateCondition(hpkg
, "mm <= 5");
1212 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1214 r
= MsiEvaluateCondition(hpkg
, "mm > 4");
1215 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1217 r
= MsiEvaluateCondition(hpkg
, "mm < 12");
1218 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1220 r
= MsiEvaluateCondition(hpkg
, "mm = \"5\"");
1221 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1223 r
= MsiEvaluateCondition(hpkg
, "0 = \"\"");
1224 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1226 r
= MsiEvaluateCondition(hpkg
, "0 AND \"\"");
1227 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1229 r
= MsiEvaluateCondition(hpkg
, "1 AND \"\"");
1230 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1232 r
= MsiEvaluateCondition(hpkg
, "1 AND \"1\"");
1233 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1235 r
= MsiEvaluateCondition(hpkg
, "3 >< 1");
1236 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1238 r
= MsiEvaluateCondition(hpkg
, "3 >< 4");
1239 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1241 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 0");
1242 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1244 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1");
1245 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1247 r
= MsiEvaluateCondition(hpkg
, "NOT 1 OR 0");
1248 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1250 r
= MsiEvaluateCondition(hpkg
, "0 AND 1 OR 1");
1251 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1253 r
= MsiEvaluateCondition(hpkg
, "0 AND 0 OR 1");
1254 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1256 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1 OR 0");
1257 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1259 r
= MsiEvaluateCondition(hpkg
, "_1 = _1");
1260 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1262 r
= MsiEvaluateCondition(hpkg
, "( 1 AND 1 ) = 2");
1263 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1265 r
= MsiEvaluateCondition(hpkg
, "NOT ( 1 AND 1 )");
1266 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1268 r
= MsiEvaluateCondition(hpkg
, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1269 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1271 r
= MsiEvaluateCondition(hpkg
, "Installed<>\"\"");
1272 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1274 r
= MsiEvaluateCondition(hpkg
, "NOT 1 AND 0");
1275 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1277 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1278 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1280 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1281 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1283 r
= MsiEvaluateCondition(hpkg
, "bandalmael<0");
1284 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1286 r
= MsiEvaluateCondition(hpkg
, "bandalmael>0");
1287 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1289 r
= MsiEvaluateCondition(hpkg
, "bandalmael>=0");
1290 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1292 r
= MsiEvaluateCondition(hpkg
, "bandalmael<=0");
1293 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1295 r
= MsiEvaluateCondition(hpkg
, "bandalmael~<>0");
1296 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1298 MsiSetProperty(hpkg
, "bandalmael", "0" );
1299 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1300 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1302 MsiSetProperty(hpkg
, "bandalmael", "" );
1303 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1304 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1306 MsiSetProperty(hpkg
, "bandalmael", "asdf" );
1307 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1308 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1310 MsiSetProperty(hpkg
, "bandalmael", "0asdf" );
1311 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1312 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1314 MsiSetProperty(hpkg
, "bandalmael", "0 " );
1315 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1316 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1318 MsiSetProperty(hpkg
, "bandalmael", "-0" );
1319 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1320 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1322 MsiSetProperty(hpkg
, "bandalmael", "0000000000000" );
1323 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1324 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1326 MsiSetProperty(hpkg
, "bandalmael", "--0" );
1327 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1328 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1330 MsiSetProperty(hpkg
, "bandalmael", "0x00" );
1331 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1332 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1334 MsiSetProperty(hpkg
, "bandalmael", "-" );
1335 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1336 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1338 MsiSetProperty(hpkg
, "bandalmael", "+0" );
1339 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1340 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1342 MsiSetProperty(hpkg
, "bandalmael", "0.0" );
1343 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1344 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1345 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1346 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1348 MsiSetProperty(hpkg
, "one", "hi");
1349 MsiSetProperty(hpkg
, "two", "hithere");
1350 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1351 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1353 MsiSetProperty(hpkg
, "one", "hithere");
1354 MsiSetProperty(hpkg
, "two", "hi");
1355 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1356 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1358 MsiSetProperty(hpkg
, "one", "hello");
1359 MsiSetProperty(hpkg
, "two", "hi");
1360 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1361 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1363 MsiSetProperty(hpkg
, "one", "hellohithere");
1364 MsiSetProperty(hpkg
, "two", "hi");
1365 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1366 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1368 MsiSetProperty(hpkg
, "one", "");
1369 MsiSetProperty(hpkg
, "two", "hi");
1370 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1371 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1373 MsiSetProperty(hpkg
, "one", "hi");
1374 MsiSetProperty(hpkg
, "two", "");
1375 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1376 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1378 MsiSetProperty(hpkg
, "one", "");
1379 MsiSetProperty(hpkg
, "two", "");
1380 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1381 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1383 MsiSetProperty(hpkg
, "one", "1234");
1384 MsiSetProperty(hpkg
, "two", "1");
1385 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1386 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1388 MsiSetProperty(hpkg
, "one", "one 1234");
1389 MsiSetProperty(hpkg
, "two", "1");
1390 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1391 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1393 MsiSetProperty(hpkg
, "one", "hithere");
1394 MsiSetProperty(hpkg
, "two", "hi");
1395 r
= MsiEvaluateCondition(hpkg
, "one << two");
1396 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1398 MsiSetProperty(hpkg
, "one", "hi");
1399 MsiSetProperty(hpkg
, "two", "hithere");
1400 r
= MsiEvaluateCondition(hpkg
, "one << two");
1401 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1403 MsiSetProperty(hpkg
, "one", "hi");
1404 MsiSetProperty(hpkg
, "two", "hi");
1405 r
= MsiEvaluateCondition(hpkg
, "one << two");
1406 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1408 MsiSetProperty(hpkg
, "one", "abcdhithere");
1409 MsiSetProperty(hpkg
, "two", "hi");
1410 r
= MsiEvaluateCondition(hpkg
, "one << two");
1411 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1413 MsiSetProperty(hpkg
, "one", "");
1414 MsiSetProperty(hpkg
, "two", "hi");
1415 r
= MsiEvaluateCondition(hpkg
, "one << two");
1416 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1418 MsiSetProperty(hpkg
, "one", "hithere");
1419 MsiSetProperty(hpkg
, "two", "");
1420 r
= MsiEvaluateCondition(hpkg
, "one << two");
1421 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1423 MsiSetProperty(hpkg
, "one", "");
1424 MsiSetProperty(hpkg
, "two", "");
1425 r
= MsiEvaluateCondition(hpkg
, "one << two");
1426 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1428 MsiSetProperty(hpkg
, "one", "1234");
1429 MsiSetProperty(hpkg
, "two", "1");
1430 r
= MsiEvaluateCondition(hpkg
, "one << two");
1431 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1433 MsiSetProperty(hpkg
, "one", "1234 one");
1434 MsiSetProperty(hpkg
, "two", "1");
1435 r
= MsiEvaluateCondition(hpkg
, "one << two");
1436 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1438 MsiSetProperty(hpkg
, "one", "hithere");
1439 MsiSetProperty(hpkg
, "two", "there");
1440 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1441 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1443 MsiSetProperty(hpkg
, "one", "hithere");
1444 MsiSetProperty(hpkg
, "two", "hi");
1445 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1446 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1448 MsiSetProperty(hpkg
, "one", "there");
1449 MsiSetProperty(hpkg
, "two", "hithere");
1450 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1451 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1453 MsiSetProperty(hpkg
, "one", "there");
1454 MsiSetProperty(hpkg
, "two", "there");
1455 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1456 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1458 MsiSetProperty(hpkg
, "one", "abcdhithere");
1459 MsiSetProperty(hpkg
, "two", "hi");
1460 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1461 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1463 MsiSetProperty(hpkg
, "one", "");
1464 MsiSetProperty(hpkg
, "two", "there");
1465 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1466 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1468 MsiSetProperty(hpkg
, "one", "there");
1469 MsiSetProperty(hpkg
, "two", "");
1470 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1471 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1473 MsiSetProperty(hpkg
, "one", "");
1474 MsiSetProperty(hpkg
, "two", "");
1475 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1476 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1478 MsiSetProperty(hpkg
, "one", "1234");
1479 MsiSetProperty(hpkg
, "two", "4");
1480 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1481 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1483 MsiSetProperty(hpkg
, "one", "one 1234");
1484 MsiSetProperty(hpkg
, "two", "4");
1485 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1486 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1488 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", NULL
); /* make sure it's empty */
1490 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1491 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1493 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport > \"1.1.4322\"");
1494 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1496 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport >= \"1.1.4322\"");
1497 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1499 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <= \"1.1.4322\"");
1500 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1502 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <> \"1.1.4322\"");
1503 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1505 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1506 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1508 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"abcd\"");
1509 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1511 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a1.1.4322\"");
1512 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1514 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322a\"");
1515 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1517 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1518 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1520 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1521 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1523 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1524 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1526 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1");
1527 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1529 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1\"");
1530 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1532 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"12.1\"");
1533 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1535 r
= MsiEvaluateCondition(hpkg
, "\"02.1\" < \"2.11\"");
1536 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1538 r
= MsiEvaluateCondition(hpkg
, "\"02.1.1\" < \"2.1\"");
1539 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1541 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1542 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1544 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1545 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1547 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0\"");
1548 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1550 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"-1\"");
1551 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1553 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a\"");
1554 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1556 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1557 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1559 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1560 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1562 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"/\"");
1563 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1565 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \" \"");
1566 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1568 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"azAZ_\"");
1569 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1571 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]\"");
1572 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1574 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]a\"");
1575 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1577 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]\"");
1578 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1580 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]a\"");
1581 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1583 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a}\"");
1584 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1586 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a\"");
1587 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1589 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a\"");
1590 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1592 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a{\"");
1593 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1595 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a]\"");
1596 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1598 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"A\"");
1599 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1601 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", "1.1.4322");
1602 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1603 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1605 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.14322\"");
1606 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1608 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.5\"");
1609 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1611 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1612 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1614 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1615 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1617 MsiSetProperty(hpkg
, "one", "1");
1618 r
= MsiEvaluateCondition(hpkg
, "one < \"1\"");
1619 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1621 MsiSetProperty(hpkg
, "X", "5.0");
1623 r
= MsiEvaluateCondition(hpkg
, "X != \"\"");
1624 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1626 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\"");
1627 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1629 r
= MsiEvaluateCondition(hpkg
, "X =\"5.1\"");
1630 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1632 r
= MsiEvaluateCondition(hpkg
, "X =\"6.0\"");
1633 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1635 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1636 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1638 r
= MsiEvaluateCondition(hpkg
, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1639 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1641 r
= MsiEvaluateCondition(hpkg
, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1642 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1644 /* feature doesn't exist */
1645 r
= MsiEvaluateCondition(hpkg
, "&nofeature");
1646 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1648 MsiSetProperty(hpkg
, "A", "2");
1649 MsiSetProperty(hpkg
, "X", "50");
1651 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1652 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1654 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1655 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1657 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1658 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1660 MsiSetProperty(hpkg
, "X", "50val");
1662 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1663 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1665 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1666 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1668 MsiSetProperty(hpkg
, "A", "7");
1669 MsiSetProperty(hpkg
, "X", "50");
1671 r
= MsiEvaluateCondition(hpkg
, "7 <= X");
1672 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1674 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1675 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1677 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1678 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1680 MsiSetProperty(hpkg
, "X", "50val");
1682 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1683 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1685 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1686 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1688 MsiCloseHandle( hpkg
);
1689 DeleteFile(msifile
);
1692 static BOOL
check_prop_empty( MSIHANDLE hpkg
, const char * prop
)
1700 r
= MsiGetProperty( hpkg
, prop
, buffer
, &sz
);
1701 return r
== ERROR_SUCCESS
&& buffer
[0] == 0 && sz
== 0;
1704 static void test_props(void)
1706 MSIHANDLE hpkg
, hdb
;
1711 hdb
= create_package_db();
1713 "CREATE TABLE `Property` ( "
1714 "`Property` CHAR(255) NOT NULL, "
1715 "`Value` CHAR(255) "
1716 "PRIMARY KEY `Property`)" );
1717 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1720 "INSERT INTO `Property` "
1721 "(`Property`, `Value`) "
1722 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1723 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1725 hpkg
= package_from_db( hdb
);
1726 ok( hpkg
, "failed to create package\n");
1728 /* test invalid values */
1729 r
= MsiGetProperty( 0, NULL
, NULL
, NULL
);
1730 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1732 r
= MsiGetProperty( hpkg
, NULL
, NULL
, NULL
);
1733 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1735 r
= MsiGetProperty( hpkg
, "boo", NULL
, NULL
);
1736 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1738 r
= MsiGetProperty( hpkg
, "boo", buffer
, NULL
);
1739 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1741 /* test retrieving an empty/nonexistent property */
1743 r
= MsiGetProperty( hpkg
, "boo", NULL
, &sz
);
1744 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1745 ok( sz
== 0, "wrong size returned\n");
1747 check_prop_empty( hpkg
, "boo");
1750 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1751 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1752 ok( !strcmp(buffer
,"x"), "buffer was changed\n");
1753 ok( sz
== 0, "wrong size returned\n");
1757 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1758 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1759 ok( buffer
[0] == 0, "buffer was not changed\n");
1760 ok( sz
== 0, "wrong size returned\n");
1762 /* set the property to something */
1763 r
= MsiSetProperty( 0, NULL
, NULL
);
1764 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1766 r
= MsiSetProperty( hpkg
, NULL
, NULL
);
1767 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1769 r
= MsiSetProperty( hpkg
, "", NULL
);
1770 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1772 /* try set and get some illegal property identifiers */
1773 r
= MsiSetProperty( hpkg
, "", "asdf" );
1774 ok( r
== ERROR_FUNCTION_FAILED
, "wrong return val\n");
1776 r
= MsiSetProperty( hpkg
, "=", "asdf" );
1777 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1779 r
= MsiSetProperty( hpkg
, " ", "asdf" );
1780 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1782 r
= MsiSetProperty( hpkg
, "'", "asdf" );
1783 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1787 r
= MsiGetProperty( hpkg
, "'", buffer
, &sz
);
1788 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1789 ok( !strcmp(buffer
,"asdf"), "buffer was not changed\n");
1791 /* set empty values */
1792 r
= MsiSetProperty( hpkg
, "boo", NULL
);
1793 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1794 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1796 r
= MsiSetProperty( hpkg
, "boo", "" );
1797 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1798 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1800 /* set a non-empty value */
1801 r
= MsiSetProperty( hpkg
, "boo", "xyz" );
1802 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1806 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1807 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1808 ok( buffer
[0] == 0, "buffer was not changed\n");
1809 ok( sz
== 3, "wrong size returned\n");
1813 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1814 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1815 ok( !strcmp(buffer
,"xyz"), "buffer was not changed\n");
1816 ok( sz
== 3, "wrong size returned\n");
1820 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1821 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1822 ok( !strcmp(buffer
,"xy"), "buffer was not changed\n");
1823 ok( sz
== 3, "wrong size returned\n");
1825 r
= MsiSetProperty(hpkg
, "SourceDir", "foo");
1826 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1829 r
= MsiGetProperty(hpkg
, "SOURCEDIR", buffer
, &sz
);
1830 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1831 ok( !strcmp(buffer
,""), "buffer wrong\n");
1832 ok( sz
== 0, "wrong size returned\n");
1835 r
= MsiGetProperty(hpkg
, "SOMERANDOMNAME", buffer
, &sz
);
1836 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1837 ok( !strcmp(buffer
,""), "buffer wrong\n");
1838 ok( sz
== 0, "wrong size returned\n");
1841 r
= MsiGetProperty(hpkg
, "SourceDir", buffer
, &sz
);
1842 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1843 ok( !strcmp(buffer
,"foo"), "buffer wrong\n");
1844 ok( sz
== 3, "wrong size returned\n");
1846 r
= MsiSetProperty(hpkg
, "MetadataCompName", "Photoshop.dll");
1847 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1850 r
= MsiGetProperty(hpkg
, "MetadataCompName", NULL
, &sz
);
1851 ok( r
== ERROR_SUCCESS
, "return wrong\n");
1852 ok( sz
== 13, "size wrong (%d)\n", sz
);
1855 r
= MsiGetProperty(hpkg
, "MetadataCompName", buffer
, &sz
);
1856 ok( r
== ERROR_MORE_DATA
, "return wrong\n");
1857 ok( !strcmp(buffer
,"Photoshop.dl"), "buffer wrong\n");
1859 r
= MsiSetProperty(hpkg
, "property", "value");
1860 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1863 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
1864 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1865 ok( !strcmp(buffer
, "value"), "Expected value, got %s\n", buffer
);
1867 r
= MsiSetProperty(hpkg
, "property", NULL
);
1868 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1871 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
1872 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1873 ok( !strlen(buffer
), "Expected empty string, got %s\n", buffer
);
1875 MsiCloseHandle( hpkg
);
1876 DeleteFile(msifile
);
1879 static BOOL
find_prop_in_property(MSIHANDLE hdb
, LPCSTR prop
, LPCSTR val
)
1881 MSIHANDLE hview
, hrec
;
1883 CHAR buffer
[MAX_PATH
];
1887 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
1888 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
1889 r
= MsiViewExecute(hview
, 0);
1890 ok(r
== ERROR_SUCCESS
, "MsiViewExecute failed\n");
1893 while (r
== ERROR_SUCCESS
&& !found
)
1895 r
= MsiViewFetch(hview
, &hrec
);
1896 if (r
!= ERROR_SUCCESS
) break;
1899 r
= MsiRecordGetString(hrec
, 1, buffer
, &sz
);
1900 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, prop
))
1903 r
= MsiRecordGetString(hrec
, 2, buffer
, &sz
);
1904 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, val
))
1908 MsiCloseHandle(hrec
);
1911 MsiViewClose(hview
);
1912 MsiCloseHandle(hview
);
1917 static void test_property_table(void)
1921 MSIHANDLE hpkg
, hdb
, hrec
;
1922 char buffer
[MAX_PATH
];
1926 hdb
= create_package_db();
1927 ok( hdb
, "failed to create package\n");
1929 hpkg
= package_from_db(hdb
);
1930 ok( hpkg
, "failed to create package\n");
1932 MsiCloseHandle(hdb
);
1934 hdb
= MsiGetActiveDatabase(hpkg
);
1936 query
= "CREATE TABLE `_Property` ( "
1937 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1938 r
= run_query(hdb
, query
);
1939 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
1941 MsiCloseHandle(hdb
);
1942 MsiCloseHandle(hpkg
);
1943 DeleteFile(msifile
);
1945 hdb
= create_package_db();
1946 ok( hdb
, "failed to create package\n");
1948 query
= "CREATE TABLE `_Property` ( "
1949 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1950 r
= run_query(hdb
, query
);
1951 ok(r
== ERROR_SUCCESS
, "failed to create table\n");
1953 query
= "ALTER `_Property` ADD `foo` INTEGER";
1954 r
= run_query(hdb
, query
);
1955 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
1957 query
= "ALTER TABLE `_Property` ADD `foo` INTEGER";
1958 r
= run_query(hdb
, query
);
1959 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
1961 query
= "ALTER TABLE `_Property` ADD `extra` INTEGER";
1962 r
= run_query(hdb
, query
);
1963 ok(r
== ERROR_SUCCESS
, "failed to add column\n");
1965 hpkg
= package_from_db(hdb
);
1968 ok(!hpkg
, "package should not be created\n");
1971 MsiCloseHandle(hdb
);
1972 MsiCloseHandle(hpkg
);
1973 DeleteFile(msifile
);
1975 hdb
= create_package_db();
1976 ok (hdb
, "failed to create package database\n");
1978 r
= create_property_table(hdb
);
1979 ok(r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
1981 r
= add_property_entry(hdb
, "'prop', 'val'");
1982 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
1984 hpkg
= package_from_db(hdb
);
1985 ok(hpkg
, "failed to create package\n");
1987 MsiCloseHandle(hdb
);
1990 r
= MsiGetProperty(hpkg
, "prop", buffer
, &sz
);
1991 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1992 ok(!lstrcmp(buffer
, "val"), "Expected val, got %s\n", buffer
);
1994 hdb
= MsiGetActiveDatabase(hpkg
);
1996 found
= find_prop_in_property(hdb
, "prop", "val");
1997 ok(found
, "prop should be in the _Property table\n");
1999 r
= add_property_entry(hdb
, "'dantes', 'mercedes'");
2000 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2002 query
= "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2003 r
= do_query(hdb
, query
, &hrec
);
2004 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
2006 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2007 ok(found
== FALSE
, "dantes should not be in the _Property table\n");
2010 lstrcpy(buffer
, "aaa");
2011 r
= MsiGetProperty(hpkg
, "dantes", buffer
, &sz
);
2012 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2013 ok(lstrlenA(buffer
) == 0, "Expected empty string, got %s\n", buffer
);
2015 r
= MsiSetProperty(hpkg
, "dantes", "mercedes");
2016 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2018 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2019 ok(found
== TRUE
, "dantes should be in the _Property table\n");
2021 MsiCloseHandle(hdb
);
2022 MsiCloseHandle(hpkg
);
2023 DeleteFile(msifile
);
2026 static UINT
try_query_param( MSIHANDLE hdb
, LPCSTR szQuery
, MSIHANDLE hrec
)
2031 res
= MsiDatabaseOpenView( hdb
, szQuery
, &htab
);
2032 if( res
== ERROR_SUCCESS
)
2036 r
= MsiViewExecute( htab
, hrec
);
2037 if( r
!= ERROR_SUCCESS
)
2040 fprintf(stderr
,"MsiViewExecute failed %08x\n", res
);
2043 r
= MsiViewClose( htab
);
2044 if( r
!= ERROR_SUCCESS
)
2047 r
= MsiCloseHandle( htab
);
2048 if( r
!= ERROR_SUCCESS
)
2054 static UINT
try_query( MSIHANDLE hdb
, LPCSTR szQuery
)
2056 return try_query_param( hdb
, szQuery
, 0 );
2059 static void set_summary_str(MSIHANDLE hdb
, DWORD pid
, LPCSTR value
)
2064 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2065 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2067 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_LPSTR
, 0, NULL
, value
);
2068 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2070 r
= MsiSummaryInfoPersist(summary
);
2071 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2073 MsiCloseHandle(summary
);
2076 static void set_summary_dword(MSIHANDLE hdb
, DWORD pid
, DWORD value
)
2081 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2082 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2084 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_I4
, value
, NULL
, NULL
);
2085 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2087 r
= MsiSummaryInfoPersist(summary
);
2088 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2090 MsiCloseHandle(summary
);
2093 static void test_msipackage(void)
2095 MSIHANDLE hdb
= 0, hpack
= 100;
2100 /* NULL szPackagePath */
2101 r
= MsiOpenPackage(NULL
, &hpack
);
2102 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2104 /* empty szPackagePath */
2105 r
= MsiOpenPackage("", &hpack
);
2108 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2111 if (r
== ERROR_SUCCESS
)
2112 MsiCloseHandle(hpack
);
2114 /* nonexistent szPackagePath */
2115 r
= MsiOpenPackage("nonexistent", &hpack
);
2116 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r
);
2119 r
= MsiOpenPackage(msifile
, NULL
);
2120 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2124 r
= MsiOpenPackage(name
, &hpack
);
2125 ok(r
== ERROR_INVALID_HANDLE
, "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
2127 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2128 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2130 /* database exists, but is emtpy */
2131 sprintf(name
, "#%d", hdb
);
2132 r
= MsiOpenPackage(name
, &hpack
);
2133 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2134 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2136 query
= "CREATE TABLE `Property` ( "
2137 "`Property` CHAR(72), `Value` CHAR(0) "
2138 "PRIMARY KEY `Property`)";
2139 r
= try_query(hdb
, query
);
2140 ok(r
== ERROR_SUCCESS
, "failed to create Properties table\n");
2142 query
= "CREATE TABLE `InstallExecuteSequence` ("
2143 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2144 "PRIMARY KEY `Action`)";
2145 r
= try_query(hdb
, query
);
2146 ok(r
== ERROR_SUCCESS
, "failed to create InstallExecuteSequence table\n");
2148 /* a few key tables exist */
2149 sprintf(name
, "#%d", hdb
);
2150 r
= MsiOpenPackage(name
, &hpack
);
2151 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2152 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2154 MsiCloseHandle(hdb
);
2155 DeleteFile(msifile
);
2157 /* start with a clean database to show what constitutes a valid package */
2158 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2161 sprintf(name
, "#%d", hdb
);
2163 /* The following summary information props must exist:
2168 set_summary_dword(hdb
, PID_PAGECOUNT
, 100);
2169 r
= MsiOpenPackage(name
, &hpack
);
2170 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2171 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2173 set_summary_str(hdb
, PID_REVNUMBER
, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2174 r
= MsiOpenPackage(name
, &hpack
);
2175 ok(r
== ERROR_SUCCESS
,
2176 "Expected ERROR_SUCCESS, got %d\n", r
);
2178 MsiCloseHandle(hpack
);
2179 MsiCloseHandle(hdb
);
2180 DeleteFile(msifile
);
2183 static void test_formatrecord2(void)
2185 MSIHANDLE hpkg
, hrec
;
2190 hpkg
= package_from_db(create_package_db());
2191 ok( hpkg
, "failed to create package\n");
2193 r
= MsiSetProperty(hpkg
, "Manufacturer", " " );
2194 ok( r
== ERROR_SUCCESS
, "set property failed\n");
2196 hrec
= MsiCreateRecord(2);
2197 ok(hrec
, "create record failed\n");
2199 r
= MsiRecordSetString( hrec
, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2200 ok( r
== ERROR_SUCCESS
, "format record failed\n");
2204 r
= MsiFormatRecord( hpkg
, hrec
, buffer
, &sz
);
2206 r
= MsiRecordSetString(hrec
, 0, "[foo][1]");
2207 r
= MsiRecordSetString(hrec
, 1, "hoo");
2209 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2210 ok( sz
== 3, "size wrong\n");
2211 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2212 ok( r
== ERROR_SUCCESS
, "format failed\n");
2214 r
= MsiRecordSetString(hrec
, 0, "x[~]x");
2216 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2217 ok( sz
== 3, "size wrong\n");
2218 ok( 0 == strcmp(buffer
,"x"), "wrong output %s\n",buffer
);
2219 ok( r
== ERROR_SUCCESS
, "format failed\n");
2221 r
= MsiRecordSetString(hrec
, 0, "[foo.$%}][1]");
2222 r
= MsiRecordSetString(hrec
, 1, "hoo");
2224 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2225 ok( sz
== 3, "size wrong\n");
2226 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2227 ok( r
== ERROR_SUCCESS
, "format failed\n");
2229 r
= MsiRecordSetString(hrec
, 0, "[\\[]");
2231 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2232 ok( sz
== 1, "size wrong\n");
2233 ok( 0 == strcmp(buffer
,"["), "wrong output %s\n",buffer
);
2234 ok( r
== ERROR_SUCCESS
, "format failed\n");
2236 SetEnvironmentVariable("FOO", "BAR");
2237 r
= MsiRecordSetString(hrec
, 0, "[%FOO]");
2239 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2240 ok( sz
== 3, "size wrong\n");
2241 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2242 ok( r
== ERROR_SUCCESS
, "format failed\n");
2244 r
= MsiRecordSetString(hrec
, 0, "[[1]]");
2245 r
= MsiRecordSetString(hrec
, 1, "%FOO");
2247 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2248 ok( sz
== 3, "size wrong\n");
2249 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2250 ok( r
== ERROR_SUCCESS
, "format failed\n");
2252 MsiCloseHandle( hrec
);
2253 MsiCloseHandle( hpkg
);
2254 DeleteFile(msifile
);
2257 static void test_states(void)
2262 INSTALLSTATE state
, action
;
2264 static const CHAR msifile2
[] = "winetest2.msi";
2265 static const CHAR msifile3
[] = "winetest3.msi";
2266 static const CHAR msifile4
[] = "winetest4.msi";
2268 hdb
= create_package_db();
2269 ok ( hdb
, "failed to create package database\n" );
2271 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
2272 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
2274 r
= create_property_table( hdb
);
2275 ok( r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2277 r
= add_property_entry( hdb
, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2278 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2280 r
= add_property_entry( hdb
, "'ProductLanguage', '1033'" );
2281 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2283 r
= add_property_entry( hdb
, "'ProductName', 'MSITEST'" );
2284 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2286 r
= add_property_entry( hdb
, "'ProductVersion', '1.1.1'" );
2287 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2289 r
= create_install_execute_sequence_table( hdb
);
2290 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table: %d\n", r
);
2292 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
2293 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2295 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
2296 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2298 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
2299 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2301 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1400'" );
2302 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2304 r
= add_install_execute_sequence_entry( hdb
, "'InstallInitialize', '', '1500'" );
2305 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2307 r
= add_install_execute_sequence_entry( hdb
, "'ProcessComponents', '', '1600'" );
2308 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2310 r
= add_install_execute_sequence_entry( hdb
, "'UnpublishFeatures', '', '1800'" );
2311 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2313 r
= add_install_execute_sequence_entry( hdb
, "'RegisterProduct', '', '6100'" );
2314 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2316 r
= add_install_execute_sequence_entry( hdb
, "'PublishFeatures', '', '6300'" );
2317 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2319 r
= add_install_execute_sequence_entry( hdb
, "'PublishProduct', '', '6400'" );
2320 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2322 r
= add_install_execute_sequence_entry( hdb
, "'InstallFinalize', '', '6600'" );
2323 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2325 r
= create_media_table( hdb
);
2326 ok( r
== ERROR_SUCCESS
, "cannot create media table: %d\n", r
);
2328 r
= add_media_entry( hdb
, "'1', '3', '', '', 'DISK1', ''");
2329 ok( r
== ERROR_SUCCESS
, "cannot add media entry: %d\n", r
);
2331 r
= create_feature_table( hdb
);
2332 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
2334 r
= create_component_table( hdb
);
2335 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
2337 /* msidbFeatureAttributesFavorLocal */
2338 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
2339 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2341 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2342 r
= add_component_entry( hdb
, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2343 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2345 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2346 r
= add_component_entry( hdb
, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2347 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2349 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2350 r
= add_component_entry( hdb
, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2351 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2353 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2354 r
= add_component_entry( hdb
, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2355 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2357 /* msidbFeatureAttributesFavorSource */
2358 r
= add_feature_entry( hdb
, "'two', '', '', '', 2, 1, '', 1" );
2359 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2361 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2362 r
= add_component_entry( hdb
, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2363 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2365 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2366 r
= add_component_entry( hdb
, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2367 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2369 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2370 r
= add_component_entry( hdb
, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2371 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2373 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2374 r
= add_component_entry( hdb
, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2375 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2377 /* msidbFeatureAttributesFavorSource */
2378 r
= add_feature_entry( hdb
, "'three', '', '', '', 2, 1, '', 1" );
2379 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2381 /* msidbFeatureAttributesFavorLocal */
2382 r
= add_feature_entry( hdb
, "'four', '', '', '', 2, 1, '', 0" );
2383 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2386 r
= add_feature_entry( hdb
, "'five', '', '', '', 2, 0, '', 1" );
2387 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2389 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2390 r
= add_component_entry( hdb
, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2391 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2393 /* no feature parent:msidbComponentAttributesLocalOnly */
2394 r
= add_component_entry( hdb
, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2395 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2397 /* msidbFeatureAttributesFavorLocal:removed */
2398 r
= add_feature_entry( hdb
, "'six', '', '', '', 2, 1, '', 0" );
2399 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2401 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2402 r
= add_component_entry( hdb
, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2403 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2405 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2406 r
= add_component_entry( hdb
, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2407 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2409 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2410 r
= add_component_entry( hdb
, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2411 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2413 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2414 r
= add_component_entry( hdb
, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2415 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2417 /* msidbFeatureAttributesFavorSource:removed */
2418 r
= add_feature_entry( hdb
, "'seven', '', '', '', 2, 1, '', 1" );
2419 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2421 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2422 r
= add_component_entry( hdb
, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2423 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2425 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2426 r
= add_component_entry( hdb
, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2427 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2429 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2430 r
= add_component_entry( hdb
, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2431 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2433 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2434 r
= add_component_entry( hdb
, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2435 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2437 /* msidbFeatureAttributesFavorLocal */
2438 r
= add_feature_entry( hdb
, "'eight', '', '', '', 2, 1, '', 0" );
2439 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2441 r
= add_component_entry( hdb
, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2442 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2444 /* msidbFeatureAttributesFavorSource */
2445 r
= add_feature_entry( hdb
, "'nine', '', '', '', 2, 1, '', 1" );
2446 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2448 r
= add_component_entry( hdb
, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2449 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2451 /* msidbFeatureAttributesFavorAdvertise */
2452 r
= add_feature_entry( hdb
, "'ten', '', '', '', 2, 1, '', 4" );
2453 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2455 r
= add_component_entry( hdb
, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2456 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2458 r
= create_feature_components_table( hdb
);
2459 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
2461 r
= add_feature_components_entry( hdb
, "'one', 'alpha'" );
2462 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2464 r
= add_feature_components_entry( hdb
, "'one', 'beta'" );
2465 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2467 r
= add_feature_components_entry( hdb
, "'one', 'gamma'" );
2468 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2470 r
= add_feature_components_entry( hdb
, "'one', 'theta'" );
2471 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2473 r
= add_feature_components_entry( hdb
, "'two', 'delta'" );
2474 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2476 r
= add_feature_components_entry( hdb
, "'two', 'epsilon'" );
2477 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2479 r
= add_feature_components_entry( hdb
, "'two', 'zeta'" );
2480 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2482 r
= add_feature_components_entry( hdb
, "'two', 'iota'" );
2483 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2485 r
= add_feature_components_entry( hdb
, "'three', 'eta'" );
2486 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2488 r
= add_feature_components_entry( hdb
, "'four', 'eta'" );
2489 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2491 r
= add_feature_components_entry( hdb
, "'five', 'eta'" );
2492 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2494 r
= add_feature_components_entry( hdb
, "'six', 'lambda'" );
2495 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2497 r
= add_feature_components_entry( hdb
, "'six', 'mu'" );
2498 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2500 r
= add_feature_components_entry( hdb
, "'six', 'nu'" );
2501 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2503 r
= add_feature_components_entry( hdb
, "'six', 'xi'" );
2504 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2506 r
= add_feature_components_entry( hdb
, "'seven', 'omicron'" );
2507 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2509 r
= add_feature_components_entry( hdb
, "'seven', 'pi'" );
2510 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2512 r
= add_feature_components_entry( hdb
, "'seven', 'rho'" );
2513 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2515 r
= add_feature_components_entry( hdb
, "'seven', 'sigma'" );
2516 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2518 r
= add_feature_components_entry( hdb
, "'eight', 'tau'" );
2519 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2521 r
= add_feature_components_entry( hdb
, "'nine', 'phi'" );
2522 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2524 r
= add_feature_components_entry( hdb
, "'ten', 'chi'" );
2525 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2527 r
= create_file_table( hdb
);
2528 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
2530 r
= add_file_entry( hdb
, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2531 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2533 r
= add_file_entry( hdb
, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2534 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2536 r
= add_file_entry( hdb
, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2537 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2539 r
= add_file_entry( hdb
, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2540 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2542 r
= add_file_entry( hdb
, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2543 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2545 r
= add_file_entry( hdb
, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2546 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2548 r
= add_file_entry( hdb
, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2549 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2551 r
= add_file_entry( hdb
, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2552 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2554 /* compressed file */
2555 r
= add_file_entry( hdb
, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2556 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2558 r
= add_file_entry( hdb
, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2559 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2561 r
= add_file_entry( hdb
, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2562 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2564 r
= add_file_entry( hdb
, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2565 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2567 r
= add_file_entry( hdb
, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2568 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2570 r
= add_file_entry( hdb
, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2571 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2573 r
= add_file_entry( hdb
, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2574 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2576 r
= add_file_entry( hdb
, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2577 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2579 r
= add_file_entry( hdb
, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2580 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2582 r
= add_file_entry( hdb
, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2583 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2585 r
= add_file_entry( hdb
, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2586 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2588 r
= add_file_entry( hdb
, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2589 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2591 r
= add_file_entry( hdb
, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2592 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2594 MsiDatabaseCommit(hdb
);
2596 /* these properties must not be in the saved msi file */
2597 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
2598 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2600 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
2601 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2603 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
2604 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2606 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine,ten'");
2607 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2609 r
= add_property_entry( hdb
, "'REINSTALLMODE', 'omus'");
2610 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2612 hpkg
= package_from_db( hdb
);
2613 ok( hpkg
, "failed to create package\n");
2615 MsiCloseHandle(hdb
);
2617 CopyFileA(msifile
, msifile2
, FALSE
);
2618 CopyFileA(msifile
, msifile3
, FALSE
);
2619 CopyFileA(msifile
, msifile4
, FALSE
);
2623 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2624 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2625 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2626 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2630 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2631 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2632 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2633 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2637 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2638 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2639 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2640 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2644 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2645 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2646 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2647 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2651 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2652 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2653 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2654 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2658 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2659 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2660 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2661 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2665 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2666 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2667 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2668 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2672 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
2673 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2674 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2675 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2679 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
2680 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2681 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2682 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2686 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
2687 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2688 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2689 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2693 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2694 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2695 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2696 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2700 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2701 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2702 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2703 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2707 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2708 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2709 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2710 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2714 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2715 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2716 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2717 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2721 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2722 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2723 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2724 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2728 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2729 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2730 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2731 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2735 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2736 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2737 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2738 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2742 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2743 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2744 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2745 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2749 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2750 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2751 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2752 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2756 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2757 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2758 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2759 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2763 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2764 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2765 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2766 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2770 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2771 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2772 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2773 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2777 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2778 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2779 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2780 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2784 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2785 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2786 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2787 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2791 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
2792 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2793 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2794 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2798 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
2799 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2800 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2801 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2805 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
2806 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2807 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2808 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2812 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
2813 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2814 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2815 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2819 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
2820 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2821 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2822 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2826 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
2827 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2828 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2829 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2833 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
2834 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2835 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2836 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2838 r
= MsiDoAction( hpkg
, "CostInitialize");
2839 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
2843 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2844 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2845 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2846 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2850 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2851 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2852 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2853 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2857 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2858 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2859 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2860 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2864 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2865 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2866 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2867 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2871 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2872 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2873 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2874 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2878 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2879 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2880 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2881 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2885 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2886 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2887 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2888 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2892 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
2893 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2894 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2895 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2899 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
2900 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2901 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2902 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2906 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
2907 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2908 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2909 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2913 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2914 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2915 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2916 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2920 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2921 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2922 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2923 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2927 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2928 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2929 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2930 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2934 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2935 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2936 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2937 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2941 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2942 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2943 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2944 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2948 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2949 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2950 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2951 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2955 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2956 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2957 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2958 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2962 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2963 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2964 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2965 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2969 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2970 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2971 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2972 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2976 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2977 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2978 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2979 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2983 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2984 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2985 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2986 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2990 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2991 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2992 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2993 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2997 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2998 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2999 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3000 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3004 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3005 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3006 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3007 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3011 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3012 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3013 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3014 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3018 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3019 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3020 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3021 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3025 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3026 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3027 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3028 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3032 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3033 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3034 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3035 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3039 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3040 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3041 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3042 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3046 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3047 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3048 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3049 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3053 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3054 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3055 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3056 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3058 r
= MsiDoAction( hpkg
, "FileCost");
3059 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3063 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3064 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3065 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3066 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3070 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3071 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3072 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3073 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3077 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3078 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3079 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3080 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3084 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3085 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3086 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3087 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3091 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3092 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3093 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3094 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3098 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3099 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3100 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3101 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3105 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3106 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3107 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3108 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3112 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3113 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3114 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3115 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3119 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3120 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3121 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3122 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3126 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3127 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3128 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3129 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3133 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3134 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3135 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3136 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3140 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3141 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3142 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3143 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3147 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3148 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3149 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3150 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3154 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3155 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3156 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3157 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3161 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3162 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3163 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3164 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3168 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3169 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3170 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3171 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3175 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3176 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3177 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3178 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3182 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3183 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3184 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3185 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3189 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3190 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3191 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3192 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3196 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3197 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3198 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3199 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3203 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3204 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3205 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3206 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3210 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3211 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3212 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3213 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3217 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3218 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3219 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3220 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3224 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3225 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3226 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3227 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3231 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3232 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3233 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3234 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3238 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3239 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3240 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3241 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3245 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3246 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3247 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3248 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3252 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3253 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3254 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3255 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3259 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3260 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3261 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3262 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3266 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3267 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3268 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3269 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3273 r
= MsiGetComponentState(hpkg
, "chi", &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
);
3278 r
= MsiDoAction( hpkg
, "CostFinalize");
3279 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3283 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3284 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3285 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3286 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3290 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3291 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3292 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3293 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3297 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3298 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3299 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3300 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3304 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3305 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3306 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3307 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3311 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3312 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3313 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3314 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3318 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3319 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3320 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3321 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3325 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3326 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3327 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3328 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3332 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3333 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3334 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3335 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3339 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3340 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3341 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3342 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3346 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3347 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3348 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3349 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3353 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3354 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3355 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3356 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3360 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3361 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3362 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3363 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3367 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3368 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3369 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3370 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3374 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3375 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3376 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3377 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3381 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3382 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3383 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3384 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3388 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3389 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3390 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3391 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3395 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3396 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3397 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3398 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3402 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3403 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3404 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3405 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3409 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3410 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3411 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3412 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3416 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3417 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3418 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3419 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3423 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3424 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3425 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3426 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3430 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3431 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3432 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3433 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3437 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3438 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3439 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3440 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3444 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3445 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3446 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3447 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3451 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3452 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3453 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3454 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3458 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3459 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3460 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3461 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3465 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3466 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3467 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3468 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3472 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3473 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3474 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3475 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3479 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3480 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3481 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3482 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3486 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3487 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3488 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3489 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3493 r
= MsiGetComponentState(hpkg
, "chi", &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_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3498 MsiCloseHandle( hpkg
);
3500 /* publish the features and components */
3501 r
= MsiInstallProduct(msifile
, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3502 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3504 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
3505 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3507 /* these properties must not be in the saved msi file */
3508 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
3509 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3511 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
3512 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3514 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
3515 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3517 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine,ten'");
3518 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3520 hpkg
= package_from_db( hdb
);
3521 ok( hpkg
, "failed to create package\n");
3523 MsiCloseHandle(hdb
);
3527 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3528 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3529 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3530 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3534 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3535 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3536 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3537 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3541 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3542 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3543 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3544 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3548 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3549 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3550 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3551 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3555 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3556 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3557 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3558 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3562 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3563 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3564 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3565 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3569 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3570 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3571 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3572 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3576 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3577 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3578 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3579 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3583 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3584 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3585 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3586 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3590 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3591 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3592 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3593 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3597 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3598 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3599 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3600 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3604 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3605 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3606 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3607 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3611 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3612 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3613 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3614 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3618 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3619 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3620 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3621 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3625 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3626 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3627 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3628 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3632 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3633 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3634 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3635 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3639 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3640 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3641 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3642 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3646 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3647 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3648 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3649 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3653 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3654 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3655 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3656 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3660 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3661 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3662 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3663 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3667 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3668 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3669 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3670 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3674 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3675 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3676 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3677 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3681 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3682 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3683 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3684 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3688 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3689 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3690 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3691 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3695 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3696 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3697 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3698 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3702 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3703 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3704 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3705 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3709 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3710 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3711 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3712 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3716 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3717 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3718 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3719 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3723 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3724 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3725 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3726 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3730 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3731 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3732 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3733 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3737 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3738 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3739 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3740 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3742 r
= MsiDoAction( hpkg
, "CostInitialize");
3743 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3747 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3748 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3749 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3750 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3754 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3755 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3756 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3757 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3761 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3762 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3763 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3764 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3768 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3769 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3770 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3771 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3775 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3776 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3777 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3778 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3782 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3783 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3784 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3785 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3789 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3790 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3791 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3792 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3796 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3797 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3798 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3799 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3803 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3804 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3805 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3806 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3810 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3811 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3812 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3813 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3817 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3818 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3819 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3820 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3824 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3825 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3826 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3827 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3831 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3832 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3833 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3834 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3838 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3839 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3840 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3841 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3845 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3846 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3847 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3848 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3852 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3853 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3854 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3855 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3859 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3860 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3861 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3862 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3866 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3867 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3868 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3869 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3873 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3874 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3875 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3876 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3880 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3881 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3882 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3883 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3887 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3888 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3889 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3890 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3894 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3895 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3896 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3897 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3901 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3902 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3903 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3904 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3908 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3909 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3910 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3911 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3915 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3916 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3917 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3918 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3922 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3923 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3924 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3925 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3929 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3930 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3931 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3932 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3936 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3937 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3938 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3939 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3943 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3944 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3945 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3946 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3950 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3951 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3952 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3953 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3957 r
= MsiGetComponentState(hpkg
, "chi", &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
);
3962 r
= MsiDoAction( hpkg
, "FileCost");
3963 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3967 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3968 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3969 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3970 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3974 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3975 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3976 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3977 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3981 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3982 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3983 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3984 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3988 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3989 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3990 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3991 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3995 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3996 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3997 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3998 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4002 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4003 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4004 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4005 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4009 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4010 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4011 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4012 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4016 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4017 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4018 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4019 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4023 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4024 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4025 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4026 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4030 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4031 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4032 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4033 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4037 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4038 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4039 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4040 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4044 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4045 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4046 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4047 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4051 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4052 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4053 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4054 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4058 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4059 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4060 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4061 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4065 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4066 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4067 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4068 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4072 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4073 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4074 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4075 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4079 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4080 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4081 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4082 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4086 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4087 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4088 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4089 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4093 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4094 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4095 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4096 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4100 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4101 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4102 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4103 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4107 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4108 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4109 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4110 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4114 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4115 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4116 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4117 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4121 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4122 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4123 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4124 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4128 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4129 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4130 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4131 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4135 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4136 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4137 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4138 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4142 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4143 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4144 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4145 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4149 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4150 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4151 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4152 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4156 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4157 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4158 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4159 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4163 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4164 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4165 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4166 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4170 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4171 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4172 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4173 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4175 r
= MsiDoAction( hpkg
, "CostFinalize");
4176 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4180 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4181 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4182 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4183 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4187 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4188 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4189 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4190 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4194 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4195 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4196 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4197 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4201 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4202 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4203 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4204 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4208 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4209 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4210 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4211 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4215 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4216 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4217 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4218 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4222 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4223 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4224 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4225 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4229 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4230 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4231 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4232 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4236 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4237 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4238 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4239 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4243 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4244 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4245 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4246 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4250 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4251 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4252 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4253 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4257 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4258 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4259 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4260 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4264 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4265 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4266 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4267 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4271 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4272 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4273 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4274 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4278 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4279 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4280 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4281 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4285 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4286 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4287 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4288 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4292 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4293 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4294 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4295 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4299 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4300 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4301 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4302 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4306 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4307 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4308 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4309 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4313 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4314 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4315 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4316 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4320 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4321 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4322 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4323 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4327 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4328 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4329 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4330 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4334 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4335 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4336 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4337 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4341 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4342 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4343 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4344 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4348 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4349 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4350 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4351 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4355 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4356 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4357 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4358 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4362 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4363 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4364 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4365 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4369 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4370 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4371 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4372 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4376 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4377 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4378 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4379 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4383 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4384 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4385 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4386 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4390 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4391 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4392 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4393 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4395 MsiCloseHandle(hpkg
);
4397 /* uninstall the product */
4398 r
= MsiInstallProduct(msifile
, "REMOVE=ALL");
4399 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4401 /* all features installed locally */
4402 r
= MsiInstallProduct(msifile2
, "ADDLOCAL=ALL");
4403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4405 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_DIRECT
, &hdb
);
4406 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4408 /* these properties must not be in the saved msi file */
4409 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4410 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4412 hpkg
= package_from_db( hdb
);
4413 ok( hpkg
, "failed to create package\n");
4417 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4418 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4419 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4420 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4424 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4425 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4426 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4427 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4431 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4432 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4433 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4434 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4438 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4439 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4440 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4441 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4445 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4446 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4447 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4448 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4452 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4453 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4454 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4455 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4459 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4460 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4461 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4462 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4466 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4467 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4468 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4469 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4473 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4474 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4475 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4476 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4480 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4481 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4482 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4483 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4487 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4488 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4489 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4490 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4494 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4495 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4496 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4497 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4501 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4502 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4503 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4504 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4508 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4509 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4510 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4511 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4515 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4516 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4517 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4518 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4522 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4523 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4524 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4525 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4529 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4530 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4531 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4532 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4536 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4537 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4538 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4539 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4543 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4544 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4545 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4546 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4550 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4551 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4552 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4553 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4557 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4558 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4559 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4560 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4564 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4565 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4566 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4567 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4571 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4572 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4573 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4574 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4578 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4579 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4580 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4581 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4585 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4586 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4587 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4588 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4592 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4593 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4594 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4595 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4599 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4600 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4601 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4602 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4606 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4607 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4608 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4609 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4613 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4614 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4615 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4616 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4620 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4621 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4622 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4623 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4627 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4628 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4629 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4630 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4632 r
= MsiDoAction( hpkg
, "CostInitialize");
4633 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4637 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4638 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4639 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4640 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4644 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4645 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4646 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4647 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4651 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4652 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4653 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4654 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4658 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4659 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4660 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4661 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4665 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4666 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4667 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4668 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4672 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4673 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4674 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4675 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4679 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4680 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4681 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4682 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4686 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4687 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4688 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4689 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4693 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4694 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4695 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4696 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4700 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4701 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4702 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4703 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4707 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4708 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4709 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4710 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4714 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4715 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4716 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4717 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4721 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4722 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4723 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4724 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4728 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4729 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4730 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4731 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4735 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4736 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4737 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4738 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4742 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4743 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4744 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4745 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4749 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4750 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4751 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4752 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4756 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4757 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4758 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4759 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4763 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4764 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4765 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4766 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4770 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4771 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4772 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4773 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4777 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4778 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4779 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4780 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4784 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4785 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4786 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4787 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4791 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4792 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4793 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4794 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4798 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4799 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4800 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4801 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4805 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4806 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4807 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4808 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4812 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4813 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4814 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4815 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4819 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4820 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4821 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4822 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4826 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4827 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4828 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4829 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4833 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4834 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4835 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4836 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4840 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4841 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4842 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4843 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4847 r
= MsiGetComponentState(hpkg
, "chi", &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
);
4852 r
= MsiDoAction( hpkg
, "FileCost");
4853 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
4857 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4858 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4859 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4860 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4864 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4865 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4866 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4867 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4871 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4872 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4873 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4874 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4878 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4879 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4880 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4881 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4885 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4886 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4887 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4888 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4892 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4893 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4894 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4895 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4899 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4900 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4901 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4902 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4906 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4907 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4908 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4909 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4913 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4914 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4915 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4916 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4920 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4921 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4922 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4923 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4927 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4928 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4929 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4930 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4934 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4935 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4936 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4937 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4941 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4942 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4943 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4944 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4948 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4949 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4950 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4951 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4955 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4956 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4957 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4958 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4962 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4963 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4964 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4965 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4969 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4970 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4971 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4972 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4976 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4977 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4978 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4979 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4983 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4984 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4985 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4986 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4990 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4991 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4992 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4993 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4997 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4998 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4999 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5000 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5004 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5005 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5006 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5007 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5011 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5012 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5013 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5014 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5018 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5019 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5020 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5021 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5025 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5026 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5027 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5028 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5032 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5033 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5034 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5035 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5039 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5040 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5041 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5042 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5046 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5047 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5048 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5049 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5053 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5054 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5055 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5056 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5060 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5061 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5062 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5063 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5067 r
= MsiGetComponentState(hpkg
, "chi", &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
);
5072 r
= MsiDoAction( hpkg
, "CostFinalize");
5073 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5077 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5078 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5079 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5080 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5084 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5085 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5086 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5087 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5091 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5092 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5093 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5094 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5098 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5099 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5100 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5101 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5105 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5106 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5107 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5108 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5112 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5113 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5114 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5115 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5119 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5120 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5121 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5122 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5126 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5127 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5128 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5129 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5133 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5134 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5135 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5136 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5140 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5141 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5142 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5143 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5147 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5148 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5149 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5150 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5154 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5155 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5156 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5157 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5161 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5162 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5163 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5164 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5168 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5169 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5170 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5171 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5175 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5176 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5177 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5178 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5182 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5183 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5184 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5185 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5189 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5190 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5191 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5192 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5196 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5197 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5198 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5199 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5203 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5204 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5205 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5206 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5210 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5211 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5212 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5213 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5217 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5218 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5219 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5220 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5224 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5225 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5226 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5227 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5231 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5232 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5233 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5234 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5238 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5239 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5240 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5241 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5245 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5246 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5247 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5248 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5252 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5253 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5254 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5255 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5259 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5260 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5261 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5262 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5266 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5267 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5268 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5269 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5273 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5274 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5275 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5276 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5280 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5281 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5282 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5283 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5287 r
= MsiGetComponentState(hpkg
, "chi", &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( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5292 MsiCloseHandle(hpkg
);
5294 /* uninstall the product */
5295 r
= MsiInstallProduct(msifile2
, "REMOVE=ALL");
5296 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5298 /* all features installed from source */
5299 r
= MsiInstallProduct(msifile3
, "ADDSOURCE=ALL");
5300 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5302 r
= MsiOpenDatabase(msifile3
, MSIDBOPEN_DIRECT
, &hdb
);
5303 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
5305 /* this property must not be in the saved msi file */
5306 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5307 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
5309 hpkg
= package_from_db( hdb
);
5310 ok( hpkg
, "failed to create package\n");
5314 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5315 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5316 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5317 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5321 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5322 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5323 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5324 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5328 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5329 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5330 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5331 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5335 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5336 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5337 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5338 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5342 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5343 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5344 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5345 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5349 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5350 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5351 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5352 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5356 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5357 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5358 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5359 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5363 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5364 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5365 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5366 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5370 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5371 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5372 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5373 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5377 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5378 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5379 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5380 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5384 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5385 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5386 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5387 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5391 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5392 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5393 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5394 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5398 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5399 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5400 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5401 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5405 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5406 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5407 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5408 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5412 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5413 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5414 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5415 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5419 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5420 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5421 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5422 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5426 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5427 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5428 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5429 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5433 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5434 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5435 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5436 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5440 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5441 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5442 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5443 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5447 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5448 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5449 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5450 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5454 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5455 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5456 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5457 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5461 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5462 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5463 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5464 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5468 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5469 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5470 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5471 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5475 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5476 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5477 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5478 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5482 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5483 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5484 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5485 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5489 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5490 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5491 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5492 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5496 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5497 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5498 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5499 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5503 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5504 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5505 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5506 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5510 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5511 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5512 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5513 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5517 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5518 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5519 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5520 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5524 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5525 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5526 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5527 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5529 r
= MsiDoAction( hpkg
, "CostInitialize");
5530 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5534 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5535 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5536 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5537 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5541 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5542 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5543 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5544 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5548 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5549 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5550 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5551 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5555 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5556 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5557 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5558 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5562 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5563 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5564 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5565 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5569 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5570 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5571 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5572 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5576 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5577 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5578 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5579 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5583 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5584 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5585 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5586 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5590 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5591 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5592 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5593 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5597 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5598 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5599 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5600 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5604 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5605 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5606 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5607 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5611 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5612 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5613 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5614 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5618 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5619 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5620 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5621 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5625 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5626 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5627 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5628 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5632 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5633 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5634 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5635 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5639 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5640 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5641 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5642 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5646 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5647 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5648 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5649 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5653 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5654 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5655 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5656 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5660 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5661 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5662 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5663 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5667 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5668 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5669 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5670 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5674 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5675 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5676 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5677 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5681 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5682 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5683 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5684 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5688 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5689 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5690 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5691 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5695 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5696 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5697 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5698 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5702 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5703 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5704 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5705 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5709 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5710 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5711 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5712 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5716 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5717 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5718 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5719 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5723 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5724 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5725 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5726 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5730 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5731 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5732 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5733 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5737 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5738 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5739 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5740 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5744 r
= MsiGetComponentState(hpkg
, "chi", &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
);
5749 r
= MsiDoAction( hpkg
, "FileCost");
5750 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5754 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5755 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5756 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5757 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5761 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5762 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5763 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5764 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5768 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5769 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5770 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5771 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5775 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5776 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5777 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5778 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5782 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5783 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5784 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5785 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5789 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5790 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5791 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5792 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5796 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5797 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5798 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5799 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5803 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5804 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5805 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5806 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5810 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5811 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5812 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5813 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5817 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5818 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5819 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5820 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5824 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5825 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5826 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5827 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5831 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5832 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5833 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5834 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5838 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5839 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5840 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5841 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5845 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5846 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5847 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5848 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5852 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5853 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5854 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5855 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5859 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5860 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5861 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5862 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5866 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5867 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5868 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5869 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5873 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5874 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5875 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5876 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5880 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5881 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5882 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5883 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5887 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5888 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5889 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5890 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5894 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5895 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5896 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5897 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5901 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5902 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5903 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5904 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5908 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5909 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5910 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5911 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5915 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5916 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5917 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5918 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5922 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5923 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5924 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5925 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5929 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5930 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5931 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5932 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5936 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5937 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5938 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5939 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5943 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5944 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5945 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5946 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5950 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5951 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5952 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5953 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5957 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5958 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5959 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5960 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5964 r
= MsiGetComponentState(hpkg
, "chi", &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
);
5969 r
= MsiDoAction( hpkg
, "CostFinalize");
5970 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5974 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5975 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5976 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5977 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5981 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5982 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5983 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5984 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5988 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5989 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5990 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5991 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5995 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5996 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5997 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5998 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6002 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6003 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6004 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6005 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6009 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6010 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6011 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6012 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6016 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6017 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6018 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6019 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6023 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6024 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6025 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6026 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6030 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6031 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6032 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6033 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6037 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6038 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6039 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6040 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6044 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6045 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6046 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6047 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6051 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6052 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6053 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6054 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6058 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6059 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6060 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6061 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6065 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6066 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6067 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6068 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6072 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6073 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6074 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6075 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6079 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6080 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6081 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6082 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6086 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6087 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6088 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6089 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6093 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6094 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6095 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6096 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6100 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6101 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6102 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6103 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6107 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6108 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6109 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6110 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6114 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6115 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6116 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6117 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6121 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6122 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6123 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6124 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6128 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6129 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6130 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6131 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6135 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6136 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6137 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6138 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6142 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6143 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6144 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6145 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6149 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6150 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6151 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6152 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6156 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6157 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6158 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6159 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6163 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6164 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6165 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6166 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6170 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6171 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6172 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6173 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6177 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6178 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6179 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6180 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6184 r
= MsiGetComponentState(hpkg
, "chi", &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
);
6189 MsiCloseHandle(hpkg
);
6191 /* reinstall the product */
6192 r
= MsiInstallProduct(msifile3
, "REINSTALL=ALL");
6193 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6195 r
= MsiOpenDatabase(msifile4
, MSIDBOPEN_DIRECT
, &hdb
);
6196 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
6198 /* this property must not be in the saved msi file */
6199 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6200 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
6202 hpkg
= package_from_db( hdb
);
6203 ok( hpkg
, "failed to create package\n");
6207 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6208 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6209 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6210 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6214 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6215 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6216 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6217 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6221 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6222 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6223 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6224 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6228 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6229 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6230 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6231 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6235 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6236 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6237 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6238 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6242 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6243 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6244 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6245 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6249 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6250 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6251 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6252 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6256 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6257 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6258 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6259 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6263 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6264 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6265 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6266 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6270 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6271 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6272 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6273 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6277 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6278 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6279 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6280 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6284 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6285 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6286 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6287 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6291 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6292 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6293 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6294 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6298 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6299 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6300 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6301 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6305 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6306 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6307 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6308 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6312 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6313 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6314 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6315 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6319 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6320 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6321 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6322 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6326 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6327 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6328 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6329 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6333 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6334 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6335 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6336 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6340 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6341 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6342 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6343 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6347 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6348 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6349 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6350 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6354 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6355 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6356 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6357 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6361 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6362 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6363 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6364 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6368 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6369 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6370 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6371 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6375 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6376 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6377 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6378 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6382 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6383 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6384 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6385 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6389 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6390 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6391 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6392 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6396 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6397 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6398 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6399 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6403 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6404 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6405 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6406 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6410 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6411 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6412 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6413 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6417 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6418 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6419 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6420 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6422 r
= MsiDoAction( hpkg
, "CostInitialize");
6423 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
6427 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6428 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6429 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6430 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6434 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6435 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6436 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6437 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6441 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6442 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6443 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6444 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6448 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6449 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6450 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6451 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6455 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6456 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6457 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6458 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6462 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6463 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6464 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6465 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6469 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6470 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6471 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6472 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6476 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6477 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6478 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6479 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6483 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6484 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6485 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6486 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6490 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6491 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6492 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6493 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6497 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6498 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6499 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6500 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6504 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6505 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6506 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6507 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6511 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6512 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6513 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6514 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6518 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6519 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6520 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6521 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6525 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6526 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6527 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6528 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6532 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6533 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6534 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6535 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6539 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6540 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6541 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6542 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6546 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6547 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6548 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6549 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6553 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6554 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6555 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6556 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6560 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6561 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6562 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6563 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6567 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6568 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6569 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6570 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6574 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6575 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6576 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6577 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6581 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6582 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6583 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6584 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6588 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6589 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6590 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6591 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6595 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6596 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6597 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6598 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6602 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6603 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6604 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6605 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6609 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6610 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6611 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6612 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6616 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6617 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6618 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6619 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6623 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6624 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6625 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6626 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6630 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6631 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6632 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6633 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6637 r
= MsiGetComponentState(hpkg
, "chi", &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
);
6642 r
= MsiDoAction( hpkg
, "FileCost");
6643 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
6647 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6648 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6649 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6650 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6654 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6655 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6656 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6657 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6661 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6662 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6663 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6664 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6668 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6669 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6670 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6671 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6675 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6676 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6677 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6678 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6682 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6683 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6684 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6685 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6689 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6690 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6691 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6692 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6696 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6697 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6698 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6699 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6703 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6704 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6705 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6706 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6710 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6711 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6712 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6713 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6717 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6718 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6719 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6720 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6724 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6725 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6726 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6727 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6731 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6732 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6733 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6734 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6738 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6739 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6740 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6741 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6745 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6746 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6747 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6748 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6752 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6753 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6754 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6755 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6759 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6760 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6761 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6762 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6766 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6767 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6768 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6769 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6773 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6774 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6775 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6776 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6780 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6781 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6782 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6783 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6787 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6788 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6789 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6790 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6794 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6795 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6796 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6797 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6801 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6802 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6803 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6804 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6808 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6809 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6810 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6811 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6815 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6816 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6817 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6818 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6822 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6823 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6824 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6825 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6829 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6830 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6831 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6832 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6836 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6837 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6838 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6839 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6843 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6844 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6845 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6846 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6850 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6851 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6852 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6853 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6857 r
= MsiGetComponentState(hpkg
, "chi", &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
);
6862 r
= MsiDoAction( hpkg
, "CostFinalize");
6863 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
6867 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6868 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6869 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6870 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6874 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6875 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6876 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6877 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6881 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6882 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6883 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6884 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6888 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6889 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6890 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6891 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6895 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6896 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6897 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6898 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6902 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6903 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6904 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6905 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6909 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6910 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6911 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6912 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6916 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6917 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6918 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6919 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6923 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6924 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6925 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6926 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6930 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6931 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6932 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6933 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6937 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6938 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6939 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6940 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6944 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6945 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6946 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6947 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6951 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6952 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6953 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6954 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6958 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6959 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6960 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6961 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6965 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6966 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6967 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6968 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6972 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6973 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6974 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6975 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6979 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6980 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6981 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6982 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6986 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6987 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6988 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6989 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6993 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6994 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6995 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6996 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7000 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
7001 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7002 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7003 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7007 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
7008 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7009 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7010 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7014 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
7015 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7016 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7017 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7021 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
7022 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7023 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7024 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7028 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
7029 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7030 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7031 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7035 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
7036 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7037 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7038 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7042 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
7043 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7044 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7045 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7049 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
7050 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7051 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7052 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7056 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
7057 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7058 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7059 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7063 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
7064 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7065 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7066 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7070 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
7071 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7072 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7073 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7077 r
= MsiGetComponentState(hpkg
, "chi", &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( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7082 MsiCloseHandle(hpkg
);
7084 /* uninstall the product */
7085 r
= MsiInstallProduct(msifile4
, "REMOVE=ALL");
7086 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7088 DeleteFileA(msifile
);
7089 DeleteFileA(msifile2
);
7090 DeleteFileA(msifile3
);
7091 DeleteFileA(msifile4
);
7094 static void test_getproperty(void)
7096 MSIHANDLE hPackage
= 0;
7098 static CHAR empty
[] = "";
7102 hPackage
= package_from_db(create_package_db());
7103 ok( hPackage
!= 0, " Failed to create package\n");
7105 /* set the property */
7106 r
= MsiSetProperty(hPackage
, "Name", "Value");
7107 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7109 /* retrieve the size, NULL pointer */
7111 r
= MsiGetProperty(hPackage
, "Name", NULL
, &size
);
7112 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7113 ok( size
== 5, "Expected 5, got %d\n", size
);
7115 /* retrieve the size, empty string */
7117 r
= MsiGetProperty(hPackage
, "Name", empty
, &size
);
7118 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7119 ok( size
== 5, "Expected 5, got %d\n", size
);
7121 /* don't change size */
7122 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
7123 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7124 ok( size
== 5, "Expected 5, got %d\n", size
);
7125 ok( !lstrcmp(prop
, "Valu"), "Expected Valu, got %s\n", prop
);
7127 /* increase the size by 1 */
7129 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
7130 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7131 ok( size
== 5, "Expected 5, got %d\n", size
);
7132 ok( !lstrcmp(prop
, "Value"), "Expected Value, got %s\n", prop
);
7134 r
= MsiCloseHandle( hPackage
);
7135 ok( r
== ERROR_SUCCESS
, "Failed to close package\n" );
7136 DeleteFile(msifile
);
7139 static void test_removefiles(void)
7145 hdb
= create_package_db();
7146 ok ( hdb
, "failed to create package database\n" );
7148 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
7149 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
7151 r
= create_feature_table( hdb
);
7152 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
7154 r
= create_component_table( hdb
);
7155 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
7157 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
7158 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7160 r
= add_component_entry( hdb
, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7161 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7163 r
= add_component_entry( hdb
, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7164 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7166 r
= add_component_entry( hdb
, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7167 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7169 r
= add_component_entry( hdb
, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7170 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7172 r
= add_component_entry( hdb
, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7173 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7175 r
= add_component_entry( hdb
, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7176 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7178 r
= create_feature_components_table( hdb
);
7179 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
7181 r
= add_feature_components_entry( hdb
, "'one', 'hydrogen'" );
7182 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7184 r
= add_feature_components_entry( hdb
, "'one', 'helium'" );
7185 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7187 r
= add_feature_components_entry( hdb
, "'one', 'lithium'" );
7188 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7190 r
= add_feature_components_entry( hdb
, "'one', 'beryllium'" );
7191 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7193 r
= add_feature_components_entry( hdb
, "'one', 'boron'" );
7194 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7196 r
= add_feature_components_entry( hdb
, "'one', 'carbon'" );
7197 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7199 r
= create_file_table( hdb
);
7200 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
7202 r
= add_file_entry( hdb
, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7203 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7205 r
= add_file_entry( hdb
, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7206 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7208 r
= add_file_entry( hdb
, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7209 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7211 r
= add_file_entry( hdb
, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7212 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7214 r
= add_file_entry( hdb
, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7215 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7217 r
= add_file_entry( hdb
, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7218 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7220 r
= create_remove_file_table( hdb
);
7221 ok( r
== ERROR_SUCCESS
, "cannot create Remove File table: %d\n", r
);
7223 hpkg
= package_from_db( hdb
);
7224 ok( hpkg
, "failed to create package\n");
7226 MsiCloseHandle( hdb
);
7228 create_test_file( "hydrogen.txt" );
7229 create_test_file( "helium.txt" );
7230 create_test_file( "lithium.txt" );
7231 create_test_file( "beryllium.txt" );
7232 create_test_file( "boron.txt" );
7233 create_test_file( "carbon.txt" );
7235 r
= MsiSetProperty( hpkg
, "TARGETDIR", CURR_DIR
);
7236 ok( r
== ERROR_SUCCESS
, "set property failed\n");
7238 r
= MsiDoAction( hpkg
, "CostInitialize");
7239 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
7241 r
= MsiDoAction( hpkg
, "FileCost");
7242 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7244 r
= MsiDoAction( hpkg
, "CostFinalize");
7245 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7247 r
= MsiDoAction( hpkg
, "InstallValidate");
7248 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7250 r
= MsiSetComponentState( hpkg
, "hydrogen", INSTALLSTATE_ABSENT
);
7251 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7253 r
= MsiSetComponentState( hpkg
, "helium", INSTALLSTATE_LOCAL
);
7254 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7256 r
= MsiSetComponentState( hpkg
, "lithium", INSTALLSTATE_SOURCE
);
7257 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7259 r
= MsiSetComponentState( hpkg
, "beryllium", INSTALLSTATE_ABSENT
);
7260 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7262 r
= MsiSetComponentState( hpkg
, "boron", INSTALLSTATE_LOCAL
);
7263 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7265 r
= MsiSetComponentState( hpkg
, "carbon", INSTALLSTATE_SOURCE
);
7266 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7268 r
= MsiDoAction( hpkg
, "RemoveFiles");
7269 ok( r
== ERROR_SUCCESS
, "remove files failed\n");
7271 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7272 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7273 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7274 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7275 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7276 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7278 MsiCloseHandle( hpkg
);
7279 DeleteFileA(msifile
);
7282 static void test_appsearch(void)
7287 CHAR prop
[MAX_PATH
];
7288 DWORD size
= MAX_PATH
;
7290 hdb
= create_package_db();
7291 ok ( hdb
, "failed to create package database\n" );
7293 r
= create_appsearch_table( hdb
);
7294 ok( r
== ERROR_SUCCESS
, "cannot create AppSearch table: %d\n", r
);
7296 r
= add_appsearch_entry( hdb
, "'WEBBROWSERPROG', 'NewSignature1'" );
7297 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
7299 r
= create_reglocator_table( hdb
);
7300 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7302 r
= add_reglocator_entry( hdb
, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7303 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7305 r
= create_signature_table( hdb
);
7306 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
7308 r
= add_signature_entry( hdb
, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7309 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
7311 hpkg
= package_from_db( hdb
);
7312 ok( hpkg
, "failed to create package\n");
7314 MsiCloseHandle( hdb
);
7316 r
= MsiDoAction( hpkg
, "AppSearch" );
7317 ok( r
== ERROR_SUCCESS
, "AppSearch failed: %d\n", r
);
7319 r
= MsiGetPropertyA( hpkg
, "WEBBROWSERPROG", prop
, &size
);
7320 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
7323 ok( lstrlenA(prop
) != 0, "Expected non-zero length\n");
7326 MsiCloseHandle( hpkg
);
7327 DeleteFileA(msifile
);
7330 static void test_appsearch_complocator(void)
7332 MSIHANDLE hpkg
, hdb
;
7333 CHAR path
[MAX_PATH
];
7334 CHAR prop
[MAX_PATH
];
7339 get_user_sid(&usersid
);
7342 skip("ConvertSidToStringSidA is not available\n");
7346 create_test_file("FileName1");
7347 create_test_file("FileName4");
7348 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE
,
7349 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL
, FALSE
);
7351 create_test_file("FileName2");
7352 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED
,
7353 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid
, FALSE
);
7355 create_test_file("FileName3");
7356 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED
,
7357 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid
, FALSE
);
7359 create_test_file("FileName5");
7360 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE
,
7361 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL
, TRUE
);
7363 create_test_file("FileName6");
7364 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE
,
7365 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL
, TRUE
);
7367 create_test_file("FileName7");
7368 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE
,
7369 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL
, FALSE
);
7371 /* dir is FALSE, but we're pretending it's a directory */
7372 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE
,
7373 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL
, FALSE
);
7375 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7376 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE
,
7377 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL
, FALSE
);
7379 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7380 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE
,
7381 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL
, FALSE
);
7383 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7384 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE
,
7385 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL
, FALSE
);
7387 hdb
= create_package_db();
7388 ok(hdb
, "Expected a valid database handle\n");
7390 r
= create_appsearch_table(hdb
);
7391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7393 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
7394 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7396 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
7397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7399 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
7400 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7402 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
7403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7405 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
7406 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7408 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
7409 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7411 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
7412 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7414 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
7415 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7417 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
7418 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7420 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
7421 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7423 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
7424 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7426 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
7427 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7429 r
= create_complocator_table(hdb
);
7430 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7432 /* published component, machine, file, signature, misdbLocatorTypeFile */
7433 r
= add_complocator_entry(hdb
, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7436 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7437 r
= add_complocator_entry(hdb
, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7438 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7440 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7441 r
= add_complocator_entry(hdb
, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7442 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7444 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7445 r
= add_complocator_entry(hdb
, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7446 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7448 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7449 r
= add_complocator_entry(hdb
, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7450 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7452 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7453 r
= add_complocator_entry(hdb
, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7454 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7456 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7457 r
= add_complocator_entry(hdb
, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7458 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7460 /* unpublished component, no signature, misdbLocatorTypeDir */
7461 r
= add_complocator_entry(hdb
, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7462 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7464 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7465 r
= add_complocator_entry(hdb
, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7466 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7468 /* published component, signature w/ ver, misdbLocatorTypeFile */
7469 r
= add_complocator_entry(hdb
, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7472 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7473 r
= add_complocator_entry(hdb
, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7474 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7476 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7477 r
= add_complocator_entry(hdb
, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7478 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7480 r
= create_signature_table(hdb
);
7481 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7483 r
= add_signature_entry(hdb
, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7484 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7486 r
= add_signature_entry(hdb
, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7487 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7489 r
= add_signature_entry(hdb
, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7490 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7492 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7493 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7495 r
= add_signature_entry(hdb
, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7496 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7498 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7499 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7501 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7502 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7504 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7505 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7507 hpkg
= package_from_db(hdb
);
7508 ok(hpkg
, "Expected a valid package handle\n");
7510 r
= MsiSetPropertyA(hpkg
, "SIGPROP8", "october");
7511 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7513 r
= MsiDoAction(hpkg
, "AppSearch");
7514 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7517 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7518 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
7519 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7520 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7523 sprintf(path
, "%s\\FileName2", CURR_DIR
);
7524 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
7525 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7526 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7529 sprintf(path
, "%s\\FileName3", CURR_DIR
);
7530 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
7531 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7532 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7535 sprintf(path
, "%s\\FileName4", CURR_DIR
);
7536 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
7537 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7538 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7541 sprintf(path
, "%s\\FileName5", CURR_DIR
);
7542 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
7543 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7544 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7547 sprintf(path
, "%s\\", CURR_DIR
);
7548 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
7549 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7550 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7553 sprintf(path
, "%s\\", CURR_DIR
);
7554 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
7555 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7556 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7559 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
7560 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7561 ok(!lstrcmpA(prop
, "october"), "Expected \"october\", got \"%s\"\n", prop
);
7564 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
7565 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7566 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7569 sprintf(path
, "%s\\FileName8.dll", CURR_DIR
);
7570 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
7571 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7572 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7575 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
7576 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7577 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7580 sprintf(path
, "%s\\FileName10.dll", CURR_DIR
);
7581 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
7582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7583 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7585 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7586 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7587 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7588 MSIINSTALLCONTEXT_USERUNMANAGED
, usersid
);
7589 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7590 MSIINSTALLCONTEXT_USERMANAGED
, usersid
);
7591 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7592 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7593 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7594 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7595 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7596 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7597 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7598 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7599 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7600 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7601 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7602 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7603 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7604 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7606 DeleteFileA("FileName1");
7607 DeleteFileA("FileName2");
7608 DeleteFileA("FileName3");
7609 DeleteFileA("FileName4");
7610 DeleteFileA("FileName5");
7611 DeleteFileA("FileName6");
7612 DeleteFileA("FileName7");
7613 DeleteFileA("FileName8.dll");
7614 DeleteFileA("FileName9.dll");
7615 DeleteFileA("FileName10.dll");
7616 MsiCloseHandle(hpkg
);
7617 DeleteFileA(msifile
);
7620 static void test_appsearch_reglocator(void)
7622 MSIHANDLE hpkg
, hdb
;
7623 CHAR path
[MAX_PATH
];
7624 CHAR prop
[MAX_PATH
];
7627 BOOL space
, version
;
7638 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7641 DeleteFileA("test.dll");
7643 res
= RegCreateKeyA(HKEY_CLASSES_ROOT
, "Software\\Wine", &classes
);
7644 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7646 res
= RegSetValueExA(classes
, "Value1", 0, REG_SZ
,
7647 (const BYTE
*)"regszdata", 10);
7648 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7650 res
= RegCreateKeyA(HKEY_CURRENT_USER
, "Software\\Wine", &hkcu
);
7651 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7653 res
= RegSetValueExA(hkcu
, "Value1", 0, REG_SZ
,
7654 (const BYTE
*)"regszdata", 10);
7655 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7658 res
= RegCreateKeyA(HKEY_USERS
, "S-1-5-18\\Software\\Wine", &users
);
7659 ok(res
== ERROR_SUCCESS
||
7660 broken(res
== ERROR_INVALID_PARAMETER
),
7661 "Expected ERROR_SUCCESS, got %d\n", res
);
7663 if (res
== ERROR_SUCCESS
)
7665 res
= RegSetValueExA(users
, "Value1", 0, REG_SZ
,
7666 (const BYTE
*)"regszdata", 10);
7667 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7670 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine", &hklm
);
7671 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7673 res
= RegSetValueA(hklm
, NULL
, REG_SZ
, "defvalue", 8);
7674 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7676 res
= RegSetValueExA(hklm
, "Value1", 0, REG_SZ
,
7677 (const BYTE
*)"regszdata", 10);
7678 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7681 res
= RegSetValueExA(hklm
, "Value2", 0, REG_DWORD
,
7682 (const BYTE
*)&val
, sizeof(DWORD
));
7683 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7686 res
= RegSetValueExA(hklm
, "Value3", 0, REG_DWORD
,
7687 (const BYTE
*)&val
, sizeof(DWORD
));
7688 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7690 res
= RegSetValueExA(hklm
, "Value4", 0, REG_EXPAND_SZ
,
7691 (const BYTE
*)"%PATH%", 7);
7692 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7694 res
= RegSetValueExA(hklm
, "Value5", 0, REG_EXPAND_SZ
,
7695 (const BYTE
*)"my%NOVAR%", 10);
7696 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7698 res
= RegSetValueExA(hklm
, "Value6", 0, REG_MULTI_SZ
,
7699 (const BYTE
*)"one\0two\0", 9);
7700 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7702 binary
[0] = 0x1234abcd;
7703 binary
[1] = 0x567890ef;
7704 res
= RegSetValueExA(hklm
, "Value7", 0, REG_BINARY
,
7705 (const BYTE
*)binary
, sizeof(binary
));
7706 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7708 res
= RegSetValueExA(hklm
, "Value8", 0, REG_SZ
,
7709 (const BYTE
*)"#regszdata", 11);
7710 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7712 create_test_file("FileName1");
7713 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7714 res
= RegSetValueExA(hklm
, "Value9", 0, REG_SZ
,
7715 (const BYTE
*)path
, lstrlenA(path
) + 1);
7716 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7718 sprintf(path
, "%s\\FileName2", CURR_DIR
);
7719 res
= RegSetValueExA(hklm
, "Value10", 0, REG_SZ
,
7720 (const BYTE
*)path
, lstrlenA(path
) + 1);
7721 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7723 lstrcpyA(path
, CURR_DIR
);
7724 res
= RegSetValueExA(hklm
, "Value11", 0, REG_SZ
,
7725 (const BYTE
*)path
, lstrlenA(path
) + 1);
7726 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7728 res
= RegSetValueExA(hklm
, "Value12", 0, REG_SZ
,
7729 (const BYTE
*)"", 1);
7730 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7732 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7733 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
7734 res
= RegSetValueExA(hklm
, "Value13", 0, REG_SZ
,
7735 (const BYTE
*)path
, lstrlenA(path
) + 1);
7736 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7738 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7739 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
7740 res
= RegSetValueExA(hklm
, "Value14", 0, REG_SZ
,
7741 (const BYTE
*)path
, lstrlenA(path
) + 1);
7742 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7744 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7745 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
7746 res
= RegSetValueExA(hklm
, "Value15", 0, REG_SZ
,
7747 (const BYTE
*)path
, lstrlenA(path
) + 1);
7748 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7750 sprintf(path
, "\"%s\\FileName1\" -option", CURR_DIR
);
7751 res
= RegSetValueExA(hklm
, "value16", 0, REG_SZ
,
7752 (const BYTE
*)path
, lstrlenA(path
) + 1);
7754 space
= (strchr(CURR_DIR
, ' ')) ? TRUE
: FALSE
;
7755 sprintf(path
, "%s\\FileName1 -option", CURR_DIR
);
7756 res
= RegSetValueExA(hklm
, "value17", 0, REG_SZ
,
7757 (const BYTE
*)path
, lstrlenA(path
) + 1);
7759 hdb
= create_package_db();
7760 ok(hdb
, "Expected a valid database handle\n");
7762 r
= create_appsearch_table(hdb
);
7763 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7765 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
7766 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7768 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
7769 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7771 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
7772 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7774 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
7775 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7777 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
7778 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7780 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
7781 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7783 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
7784 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7786 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
7787 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7789 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
7790 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7792 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
7793 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7795 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
7796 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7798 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
7799 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7801 r
= add_appsearch_entry(hdb
, "'SIGPROP13', 'NewSignature13'");
7802 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7804 r
= add_appsearch_entry(hdb
, "'SIGPROP14', 'NewSignature14'");
7805 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7807 r
= add_appsearch_entry(hdb
, "'SIGPROP15', 'NewSignature15'");
7808 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7810 r
= add_appsearch_entry(hdb
, "'SIGPROP16', 'NewSignature16'");
7811 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7813 r
= add_appsearch_entry(hdb
, "'SIGPROP17', 'NewSignature17'");
7814 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7816 r
= add_appsearch_entry(hdb
, "'SIGPROP18', 'NewSignature18'");
7817 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7819 r
= add_appsearch_entry(hdb
, "'SIGPROP19', 'NewSignature19'");
7820 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7822 r
= add_appsearch_entry(hdb
, "'SIGPROP20', 'NewSignature20'");
7823 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7825 r
= add_appsearch_entry(hdb
, "'SIGPROP21', 'NewSignature21'");
7826 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7828 r
= add_appsearch_entry(hdb
, "'SIGPROP22', 'NewSignature22'");
7829 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7831 r
= add_appsearch_entry(hdb
, "'SIGPROP23', 'NewSignature23'");
7832 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7834 r
= add_appsearch_entry(hdb
, "'SIGPROP24', 'NewSignature24'");
7835 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7837 r
= add_appsearch_entry(hdb
, "'SIGPROP25', 'NewSignature25'");
7838 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7840 r
= add_appsearch_entry(hdb
, "'SIGPROP26', 'NewSignature26'");
7841 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7843 r
= add_appsearch_entry(hdb
, "'SIGPROP27', 'NewSignature27'");
7844 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7846 r
= add_appsearch_entry(hdb
, "'SIGPROP28', 'NewSignature28'");
7847 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7849 r
= add_appsearch_entry(hdb
, "'SIGPROP29', 'NewSignature29'");
7850 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7852 r
= add_appsearch_entry(hdb
, "'SIGPROP30', 'NewSignature30'");
7853 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7855 r
= create_reglocator_table(hdb
);
7856 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7858 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7859 str
= "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7860 r
= add_reglocator_entry(hdb
, str
);
7861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7863 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7864 str
= "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7865 r
= add_reglocator_entry(hdb
, str
);
7866 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7868 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7869 str
= "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7870 r
= add_reglocator_entry(hdb
, str
);
7871 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7873 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7874 str
= "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7875 r
= add_reglocator_entry(hdb
, str
);
7876 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7878 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7879 str
= "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7880 r
= add_reglocator_entry(hdb
, str
);
7881 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7883 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7884 str
= "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7885 r
= add_reglocator_entry(hdb
, str
);
7886 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7888 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7889 str
= "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7890 r
= add_reglocator_entry(hdb
, str
);
7891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7893 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7894 str
= "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7895 r
= add_reglocator_entry(hdb
, str
);
7896 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7898 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7899 str
= "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7900 r
= add_reglocator_entry(hdb
, str
);
7901 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7903 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7904 str
= "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7905 r
= add_reglocator_entry(hdb
, str
);
7906 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7908 /* HKLM, msidbLocatorTypeFileName, no signature */
7909 str
= "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7910 r
= add_reglocator_entry(hdb
, str
);
7911 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7913 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7914 str
= "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7915 r
= add_reglocator_entry(hdb
, str
);
7916 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7918 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7919 str
= "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7920 r
= add_reglocator_entry(hdb
, str
);
7921 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7923 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
7924 str
= "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
7925 r
= add_reglocator_entry(hdb
, str
);
7926 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7928 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
7929 str
= "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
7930 r
= add_reglocator_entry(hdb
, str
);
7931 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7933 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
7934 str
= "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
7935 r
= add_reglocator_entry(hdb
, str
);
7936 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7938 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
7939 str
= "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
7940 r
= add_reglocator_entry(hdb
, str
);
7941 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7943 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
7944 str
= "'NewSignature18', 2, 'Software\\Wine', '', 2";
7945 r
= add_reglocator_entry(hdb
, str
);
7946 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7948 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
7949 str
= "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
7950 r
= add_reglocator_entry(hdb
, str
);
7951 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7953 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
7954 str
= "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
7955 r
= add_reglocator_entry(hdb
, str
);
7956 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7958 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
7959 str
= "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
7960 r
= add_reglocator_entry(hdb
, str
);
7961 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7963 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
7964 str
= "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
7965 r
= add_reglocator_entry(hdb
, str
);
7966 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7968 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
7969 str
= "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
7970 r
= add_reglocator_entry(hdb
, str
);
7971 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7973 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
7974 str
= "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
7975 r
= add_reglocator_entry(hdb
, str
);
7976 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7978 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
7979 str
= "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
7980 r
= add_reglocator_entry(hdb
, str
);
7981 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7983 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
7984 str
= "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
7985 r
= add_reglocator_entry(hdb
, str
);
7986 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7988 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
7989 str
= "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
7990 r
= add_reglocator_entry(hdb
, str
);
7991 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7993 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
7994 str
= "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
7995 r
= add_reglocator_entry(hdb
, str
);
7996 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7998 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
7999 str
= "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
8000 r
= add_reglocator_entry(hdb
, str
);
8001 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8003 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8004 str
= "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
8005 r
= add_reglocator_entry(hdb
, str
);
8006 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8008 r
= create_signature_table(hdb
);
8009 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8011 str
= "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8012 r
= add_signature_entry(hdb
, str
);
8013 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8015 str
= "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8016 r
= add_signature_entry(hdb
, str
);
8017 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8019 str
= "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8020 r
= add_signature_entry(hdb
, str
);
8021 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8023 str
= "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8024 r
= add_signature_entry(hdb
, str
);
8025 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8027 str
= "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8028 r
= add_signature_entry(hdb
, str
);
8029 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8031 str
= "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8032 r
= add_signature_entry(hdb
, str
);
8033 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8035 ptr
= strrchr(CURR_DIR
, '\\') + 1;
8036 sprintf(path
, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr
);
8037 r
= add_signature_entry(hdb
, path
);
8038 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8040 str
= "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8041 r
= add_signature_entry(hdb
, str
);
8042 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8044 str
= "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8045 r
= add_signature_entry(hdb
, str
);
8046 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8048 str
= "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8049 r
= add_signature_entry(hdb
, str
);
8050 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8052 hpkg
= package_from_db(hdb
);
8053 ok(hpkg
, "Expected a valid package handle\n");
8055 r
= MsiDoAction(hpkg
, "AppSearch");
8056 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8059 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8060 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8061 ok(!lstrcmpA(prop
, "regszdata"),
8062 "Expected \"regszdata\", got \"%s\"\n", prop
);
8065 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8067 ok(!lstrcmpA(prop
, "#42"), "Expected \"#42\", got \"%s\"\n", prop
);
8070 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8071 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8072 ok(!lstrcmpA(prop
, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop
);
8074 size
= ExpandEnvironmentStringsA("%PATH%", NULL
, 0);
8075 if (size
== 0 && GetLastError() == ERROR_INVALID_PARAMETER
)
8077 /* Workaround for Win95 */
8079 size
= ExpandEnvironmentStringsA("%PATH%", tempbuf
, 0);
8081 pathvar
= HeapAlloc(GetProcessHeap(), 0, size
);
8082 ExpandEnvironmentStringsA("%PATH%", pathvar
, size
);
8085 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", NULL
, &size
);
8086 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8088 pathdata
= HeapAlloc(GetProcessHeap(), 0, ++size
);
8089 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", pathdata
, &size
);
8090 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8091 ok(!lstrcmpA(pathdata
, pathvar
),
8092 "Expected \"%s\", got \"%s\"\n", pathvar
, pathdata
);
8094 HeapFree(GetProcessHeap(), 0, pathvar
);
8095 HeapFree(GetProcessHeap(), 0, pathdata
);
8098 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8099 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8101 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop
);
8104 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8105 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8108 ok(!memcmp(prop
, "\0one\0two\0\0", 10),
8109 "Expected \"\\0one\\0two\\0\\0\"\n");
8113 lstrcpyA(path
, "#xCDAB3412EF907856");
8114 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8115 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8116 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8119 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8120 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8121 ok(!lstrcmpA(prop
, "##regszdata"),
8122 "Expected \"##regszdata\", got \"%s\"\n", prop
);
8125 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8126 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8127 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8128 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8131 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8132 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8133 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8136 sprintf(path
, "%s\\", CURR_DIR
);
8137 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8138 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8139 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8142 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
8143 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8144 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8147 sprintf(path
, "%s\\", CURR_DIR
);
8148 r
= MsiGetPropertyA(hpkg
, "SIGPROP13", prop
, &size
);
8149 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8150 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8153 r
= MsiGetPropertyA(hpkg
, "SIGPROP14", prop
, &size
);
8154 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8155 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8158 r
= MsiGetPropertyA(hpkg
, "SIGPROP15", prop
, &size
);
8159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8160 ok(!lstrcmpA(prop
, "regszdata"),
8161 "Expected \"regszdata\", got \"%s\"\n", prop
);
8164 r
= MsiGetPropertyA(hpkg
, "SIGPROP16", prop
, &size
);
8165 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8166 ok(!lstrcmpA(prop
, "regszdata"),
8167 "Expected \"regszdata\", got \"%s\"\n", prop
);
8172 r
= MsiGetPropertyA(hpkg
, "SIGPROP17", prop
, &size
);
8173 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8174 ok(!lstrcmpA(prop
, "regszdata"),
8175 "Expected \"regszdata\", got \"%s\"\n", prop
);
8179 r
= MsiGetPropertyA(hpkg
, "SIGPROP18", prop
, &size
);
8180 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8181 ok(!lstrcmpA(prop
, "defvalue"),
8182 "Expected \"defvalue\", got \"%s\"\n", prop
);
8185 r
= MsiGetPropertyA(hpkg
, "SIGPROP19", prop
, &size
);
8186 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8187 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8190 r
= MsiGetPropertyA(hpkg
, "SIGPROP20", prop
, &size
);
8191 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8192 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8197 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8198 r
= MsiGetPropertyA(hpkg
, "SIGPROP21", prop
, &size
);
8199 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8200 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8203 r
= MsiGetPropertyA(hpkg
, "SIGPROP22", prop
, &size
);
8204 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8205 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8208 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
8209 r
= MsiGetPropertyA(hpkg
, "SIGPROP23", prop
, &size
);
8210 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8211 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8215 lstrcpyA(path
, CURR_DIR
);
8216 ptr
= strrchr(path
, '\\') + 1;
8218 r
= MsiGetPropertyA(hpkg
, "SIGPROP24", prop
, &size
);
8219 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8220 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8223 sprintf(path
, "%s\\", CURR_DIR
);
8224 r
= MsiGetPropertyA(hpkg
, "SIGPROP25", prop
, &size
);
8225 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8226 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8229 r
= MsiGetPropertyA(hpkg
, "SIGPROP26", prop
, &size
);
8230 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8231 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8234 r
= MsiGetPropertyA(hpkg
, "SIGPROP27", prop
, &size
);
8235 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8236 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8239 r
= MsiGetPropertyA(hpkg
, "SIGPROP28", prop
, &size
);
8240 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8241 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8244 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8245 r
= MsiGetPropertyA(hpkg
, "SIGPROP29", prop
, &size
);
8246 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8247 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8250 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8251 r
= MsiGetPropertyA(hpkg
, "SIGPROP30", prop
, &size
);
8252 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8254 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8256 todo_wine
ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8258 RegSetValueA(hklm
, NULL
, REG_SZ
, "", 0);
8259 RegDeleteValueA(hklm
, "Value1");
8260 RegDeleteValueA(hklm
, "Value2");
8261 RegDeleteValueA(hklm
, "Value3");
8262 RegDeleteValueA(hklm
, "Value4");
8263 RegDeleteValueA(hklm
, "Value5");
8264 RegDeleteValueA(hklm
, "Value6");
8265 RegDeleteValueA(hklm
, "Value7");
8266 RegDeleteValueA(hklm
, "Value8");
8267 RegDeleteValueA(hklm
, "Value9");
8268 RegDeleteValueA(hklm
, "Value10");
8269 RegDeleteValueA(hklm
, "Value11");
8270 RegDeleteValueA(hklm
, "Value12");
8271 RegDeleteValueA(hklm
, "Value13");
8272 RegDeleteValueA(hklm
, "Value14");
8273 RegDeleteValueA(hklm
, "Value15");
8274 RegDeleteValueA(hklm
, "Value16");
8275 RegDeleteValueA(hklm
, "Value17");
8276 RegDeleteKeyA(hklm
, "");
8279 RegDeleteValueA(classes
, "Value1");
8280 RegDeleteKeyA(classes
, "");
8281 RegCloseKey(classes
);
8283 RegDeleteValueA(hkcu
, "Value1");
8284 RegDeleteKeyA(hkcu
, "");
8287 RegDeleteValueA(users
, "Value1");
8288 RegDeleteKeyA(users
, "");
8291 DeleteFileA("FileName1");
8292 DeleteFileA("FileName3.dll");
8293 DeleteFileA("FileName4.dll");
8294 DeleteFileA("FileName5.dll");
8295 MsiCloseHandle(hpkg
);
8296 DeleteFileA(msifile
);
8299 static void delete_win_ini(LPCSTR file
)
8301 CHAR path
[MAX_PATH
];
8303 GetWindowsDirectoryA(path
, MAX_PATH
);
8304 lstrcatA(path
, "\\");
8305 lstrcatA(path
, file
);
8310 static void test_appsearch_inilocator(void)
8312 MSIHANDLE hpkg
, hdb
;
8313 CHAR path
[MAX_PATH
];
8314 CHAR prop
[MAX_PATH
];
8322 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8325 DeleteFileA("test.dll");
8327 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8329 create_test_file("FileName1");
8330 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8331 WritePrivateProfileStringA("Section", "Key2", path
, "IniFile.ini");
8333 WritePrivateProfileStringA("Section", "Key3", CURR_DIR
, "IniFile.ini");
8335 sprintf(path
, "%s\\IDontExist", CURR_DIR
);
8336 WritePrivateProfileStringA("Section", "Key4", path
, "IniFile.ini");
8338 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8339 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
8340 WritePrivateProfileStringA("Section", "Key5", path
, "IniFile.ini");
8342 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8343 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8344 WritePrivateProfileStringA("Section", "Key6", path
, "IniFile.ini");
8346 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8347 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
8348 WritePrivateProfileStringA("Section", "Key7", path
, "IniFile.ini");
8350 hdb
= create_package_db();
8351 ok(hdb
, "Expected a valid database handle\n");
8353 r
= create_appsearch_table(hdb
);
8354 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8356 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8357 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8359 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8360 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8362 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8363 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8365 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8366 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8368 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8369 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8371 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8372 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8374 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8375 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8377 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8378 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8380 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8381 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8383 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8384 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8386 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8387 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8389 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
8390 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8392 r
= create_inilocator_table(hdb
);
8393 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8395 /* msidbLocatorTypeRawValue, field 1 */
8396 str
= "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8397 r
= add_inilocator_entry(hdb
, str
);
8398 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8400 /* msidbLocatorTypeRawValue, field 2 */
8401 str
= "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8402 r
= add_inilocator_entry(hdb
, str
);
8403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8405 /* msidbLocatorTypeRawValue, entire field */
8406 str
= "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8407 r
= add_inilocator_entry(hdb
, str
);
8408 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8410 /* msidbLocatorTypeFile */
8411 str
= "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8412 r
= add_inilocator_entry(hdb
, str
);
8413 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8415 /* msidbLocatorTypeDirectory, file */
8416 str
= "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8417 r
= add_inilocator_entry(hdb
, str
);
8418 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8420 /* msidbLocatorTypeDirectory, directory */
8421 str
= "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8422 r
= add_inilocator_entry(hdb
, str
);
8423 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8425 /* msidbLocatorTypeFile, file, no signature */
8426 str
= "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8427 r
= add_inilocator_entry(hdb
, str
);
8428 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8430 /* msidbLocatorTypeFile, dir, no signature */
8431 str
= "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8432 r
= add_inilocator_entry(hdb
, str
);
8433 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8435 /* msidbLocatorTypeFile, file does not exist */
8436 str
= "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8437 r
= add_inilocator_entry(hdb
, str
);
8438 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8440 /* msidbLocatorTypeFile, signature with version */
8441 str
= "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8442 r
= add_inilocator_entry(hdb
, str
);
8443 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8445 /* msidbLocatorTypeFile, signature with version, ver > max */
8446 str
= "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8447 r
= add_inilocator_entry(hdb
, str
);
8448 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8450 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8451 str
= "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8452 r
= add_inilocator_entry(hdb
, str
);
8453 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8455 r
= create_signature_table(hdb
);
8456 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8458 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8459 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8461 r
= add_signature_entry(hdb
, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8462 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8464 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8465 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8467 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8468 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8470 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8473 hpkg
= package_from_db(hdb
);
8474 ok(hpkg
, "Expected a valid package handle\n");
8476 r
= MsiDoAction(hpkg
, "AppSearch");
8477 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8480 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8481 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8482 ok(!lstrcmpA(prop
, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop
);
8485 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8486 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8487 ok(!lstrcmpA(prop
, "field2"), "Expected \"field2\", got \"%s\"\n", prop
);
8490 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8492 ok(!lstrcmpA(prop
, "keydata,field2"),
8493 "Expected \"keydata,field2\", got \"%s\"\n", prop
);
8496 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8497 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
8498 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8499 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8502 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8503 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8504 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8507 sprintf(path
, "%s\\", CURR_DIR
);
8508 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8510 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8513 sprintf(path
, "%s\\", CURR_DIR
);
8514 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8516 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8519 lstrcpyA(path
, CURR_DIR
);
8520 ptr
= strrchr(path
, '\\');
8522 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8523 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8524 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8527 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8528 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8529 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8534 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
8535 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8536 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8537 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8540 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8541 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8542 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8545 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
8546 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
8547 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8548 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8551 delete_win_ini("IniFile.ini");
8552 DeleteFileA("FileName1");
8553 DeleteFileA("FileName2.dll");
8554 DeleteFileA("FileName3.dll");
8555 DeleteFileA("FileName4.dll");
8556 MsiCloseHandle(hpkg
);
8557 DeleteFileA(msifile
);
8561 * MSI AppSearch action on DrLocator table always returns absolute paths.
8562 * If a relative path was set, it returns the first absolute path that
8563 * matches or an empty string if it didn't find anything.
8564 * This helper function replicates this behaviour.
8566 static void search_absolute_directory(LPSTR absolute
, LPCSTR relative
)
8571 size
= lstrlenA(relative
);
8572 drives
= GetLogicalDrives();
8573 lstrcpyA(absolute
, "A:\\");
8574 for (i
= 0; i
< 26; absolute
[0] = '\0', i
++)
8576 if (!(drives
& (1 << i
)))
8579 absolute
[0] = 'A' + i
;
8580 if (GetDriveType(absolute
) != DRIVE_FIXED
)
8583 lstrcpynA(absolute
+ 3, relative
, size
+ 1);
8584 attr
= GetFileAttributesA(absolute
);
8585 if (attr
!= INVALID_FILE_ATTRIBUTES
&&
8586 (attr
& FILE_ATTRIBUTE_DIRECTORY
))
8588 if (absolute
[3 + size
- 1] != '\\')
8589 lstrcatA(absolute
, "\\");
8596 static void test_appsearch_drlocator(void)
8598 MSIHANDLE hpkg
, hdb
;
8599 CHAR path
[MAX_PATH
];
8600 CHAR prop
[MAX_PATH
];
8607 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8610 DeleteFileA("test.dll");
8612 create_test_file("FileName1");
8613 CreateDirectoryA("one", NULL
);
8614 CreateDirectoryA("one\\two", NULL
);
8615 CreateDirectoryA("one\\two\\three", NULL
);
8616 create_test_file("one\\two\\three\\FileName2");
8617 CreateDirectoryA("another", NULL
);
8618 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8619 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8620 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8622 hdb
= create_package_db();
8623 ok(hdb
, "Expected a valid database handle\n");
8625 r
= create_appsearch_table(hdb
);
8626 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8628 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8629 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8631 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8632 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8634 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8635 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8637 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8638 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8640 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8641 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8643 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8644 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8646 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8647 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8649 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8650 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8652 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8653 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8655 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8656 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8658 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8659 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8661 r
= create_drlocator_table(hdb
);
8662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8664 /* no parent, full path, depth 0, signature */
8665 sprintf(path
, "'NewSignature1', '', '%s', 0", CURR_DIR
);
8666 r
= add_drlocator_entry(hdb
, path
);
8667 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8669 /* no parent, full path, depth 0, no signature */
8670 sprintf(path
, "'NewSignature2', '', '%s', 0", CURR_DIR
);
8671 r
= add_drlocator_entry(hdb
, path
);
8672 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8674 /* no parent, relative path, depth 0, no signature */
8675 sprintf(path
, "'NewSignature3', '', '%s', 0", CURR_DIR
+ 3);
8676 r
= add_drlocator_entry(hdb
, path
);
8677 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8679 /* no parent, full path, depth 2, signature */
8680 sprintf(path
, "'NewSignature4', '', '%s', 2", CURR_DIR
);
8681 r
= add_drlocator_entry(hdb
, path
);
8682 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8684 /* no parent, full path, depth 3, signature */
8685 sprintf(path
, "'NewSignature5', '', '%s', 3", CURR_DIR
);
8686 r
= add_drlocator_entry(hdb
, path
);
8687 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8689 /* no parent, full path, depth 1, signature is dir */
8690 sprintf(path
, "'NewSignature6', '', '%s', 1", CURR_DIR
);
8691 r
= add_drlocator_entry(hdb
, path
);
8692 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8694 /* parent is in DrLocator, relative path, depth 0, signature */
8695 sprintf(path
, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8696 r
= add_drlocator_entry(hdb
, path
);
8697 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8699 /* no parent, full path, depth 0, signature w/ version */
8700 sprintf(path
, "'NewSignature8', '', '%s', 0", CURR_DIR
);
8701 r
= add_drlocator_entry(hdb
, path
);
8702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8704 /* no parent, full path, depth 0, signature w/ version, ver > max */
8705 sprintf(path
, "'NewSignature9', '', '%s', 0", CURR_DIR
);
8706 r
= add_drlocator_entry(hdb
, path
);
8707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8709 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8710 sprintf(path
, "'NewSignature10', '', '%s', 0", CURR_DIR
);
8711 r
= add_drlocator_entry(hdb
, path
);
8712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8714 /* no parent, relative empty path, depth 0, no signature */
8715 sprintf(path
, "'NewSignature11', '', '', 0");
8716 r
= add_drlocator_entry(hdb
, path
);
8717 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8719 r
= create_signature_table(hdb
);
8720 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8722 str
= "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8723 r
= add_signature_entry(hdb
, str
);
8724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8726 str
= "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8727 r
= add_signature_entry(hdb
, str
);
8728 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8730 str
= "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8731 r
= add_signature_entry(hdb
, str
);
8732 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8734 str
= "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8735 r
= add_signature_entry(hdb
, str
);
8736 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8738 str
= "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8739 r
= add_signature_entry(hdb
, str
);
8740 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8742 str
= "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8743 r
= add_signature_entry(hdb
, str
);
8744 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8746 str
= "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8747 r
= add_signature_entry(hdb
, str
);
8748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8750 str
= "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8751 r
= add_signature_entry(hdb
, str
);
8752 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8754 hpkg
= package_from_db(hdb
);
8755 ok(hpkg
, "Expected a valid package handle\n");
8757 r
= MsiDoAction(hpkg
, "AppSearch");
8758 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8761 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8762 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8763 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8764 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8767 sprintf(path
, "%s\\", CURR_DIR
);
8768 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8769 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8770 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8773 search_absolute_directory(path
, CURR_DIR
+ 3);
8774 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8775 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8776 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8779 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
8780 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8781 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8784 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
8785 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8787 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8790 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8791 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8792 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8795 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
8796 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8798 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8803 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8804 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8805 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8806 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8809 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8810 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8811 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8814 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8815 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8816 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8820 search_absolute_directory(path
, "");
8821 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8822 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8823 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8825 DeleteFileA("FileName1");
8826 DeleteFileA("FileName3.dll");
8827 DeleteFileA("FileName4.dll");
8828 DeleteFileA("FileName5.dll");
8829 DeleteFileA("one\\two\\three\\FileName2");
8830 RemoveDirectoryA("one\\two\\three");
8831 RemoveDirectoryA("one\\two");
8832 RemoveDirectoryA("one");
8833 RemoveDirectoryA("another");
8834 MsiCloseHandle(hpkg
);
8835 DeleteFileA(msifile
);
8838 static void test_featureparents(void)
8843 INSTALLSTATE state
, action
;
8845 hdb
= create_package_db();
8846 ok ( hdb
, "failed to create package database\n" );
8848 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
8849 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
8851 r
= create_feature_table( hdb
);
8852 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
8854 r
= create_component_table( hdb
);
8855 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
8857 r
= create_feature_components_table( hdb
);
8858 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
8860 r
= create_file_table( hdb
);
8861 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
8863 /* msidbFeatureAttributesFavorLocal */
8864 r
= add_feature_entry( hdb
, "'zodiac', '', '', '', 2, 1, '', 0" );
8865 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8867 /* msidbFeatureAttributesFavorSource */
8868 r
= add_feature_entry( hdb
, "'perseus', '', '', '', 2, 1, '', 1" );
8869 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8871 /* msidbFeatureAttributesFavorLocal */
8872 r
= add_feature_entry( hdb
, "'orion', '', '', '', 2, 1, '', 0" );
8873 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8875 /* disabled because of install level */
8876 r
= add_feature_entry( hdb
, "'waters', '', '', '', 15, 101, '', 9" );
8877 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8879 /* child feature of disabled feature */
8880 r
= add_feature_entry( hdb
, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8881 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8883 /* component of disabled feature (install level) */
8884 r
= add_component_entry( hdb
, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8885 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8887 /* component of disabled child feature (install level) */
8888 r
= add_component_entry( hdb
, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8889 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8891 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8892 r
= add_component_entry( hdb
, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8893 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8895 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8896 r
= add_component_entry( hdb
, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8897 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8899 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8900 r
= add_component_entry( hdb
, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8901 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8903 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8904 r
= add_component_entry( hdb
, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8905 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8907 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8908 r
= add_component_entry( hdb
, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8909 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8911 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8912 r
= add_component_entry( hdb
, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8913 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8915 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8916 r
= add_component_entry( hdb
, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8917 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8919 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8920 r
= add_component_entry( hdb
, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8921 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8923 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8924 r
= add_component_entry( hdb
, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
8926 r
= add_feature_components_entry( hdb
, "'zodiac', 'leo'" );
8927 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8929 r
= add_feature_components_entry( hdb
, "'zodiac', 'virgo'" );
8930 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8932 r
= add_feature_components_entry( hdb
, "'zodiac', 'libra'" );
8933 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8935 r
= add_feature_components_entry( hdb
, "'perseus', 'cassiopeia'" );
8936 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8938 r
= add_feature_components_entry( hdb
, "'perseus', 'cepheus'" );
8939 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8941 r
= add_feature_components_entry( hdb
, "'perseus', 'andromeda'" );
8942 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8944 r
= add_feature_components_entry( hdb
, "'orion', 'leo'" );
8945 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8947 r
= add_feature_components_entry( hdb
, "'orion', 'virgo'" );
8948 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8950 r
= add_feature_components_entry( hdb
, "'orion', 'libra'" );
8951 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8953 r
= add_feature_components_entry( hdb
, "'orion', 'cassiopeia'" );
8954 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8956 r
= add_feature_components_entry( hdb
, "'orion', 'cepheus'" );
8957 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8959 r
= add_feature_components_entry( hdb
, "'orion', 'andromeda'" );
8960 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8962 r
= add_feature_components_entry( hdb
, "'orion', 'canis'" );
8963 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8965 r
= add_feature_components_entry( hdb
, "'orion', 'monoceros'" );
8966 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8968 r
= add_feature_components_entry( hdb
, "'orion', 'lepus'" );
8969 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8971 r
= add_feature_components_entry( hdb
, "'waters', 'delphinus'" );
8972 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8974 r
= add_feature_components_entry( hdb
, "'bayer', 'hydrus'" );
8975 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8977 r
= add_file_entry( hdb
, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
8978 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8980 r
= add_file_entry( hdb
, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
8981 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8983 r
= add_file_entry( hdb
, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
8984 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8986 r
= add_file_entry( hdb
, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
8987 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8989 r
= add_file_entry( hdb
, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
8990 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8992 r
= add_file_entry( hdb
, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
8993 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8995 r
= add_file_entry( hdb
, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
8996 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8998 r
= add_file_entry( hdb
, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
8999 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9001 r
= add_file_entry( hdb
, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9002 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9004 r
= add_file_entry( hdb
, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9005 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9007 r
= add_file_entry( hdb
, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9008 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9010 hpkg
= package_from_db( hdb
);
9011 ok( hpkg
, "failed to create package\n");
9013 MsiCloseHandle( hdb
);
9015 r
= MsiDoAction( hpkg
, "CostInitialize");
9016 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
9018 r
= MsiDoAction( hpkg
, "FileCost");
9019 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
9021 r
= MsiDoAction( hpkg
, "CostFinalize");
9022 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
9026 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
9027 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9028 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9029 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9033 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
9034 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9035 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9036 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
9040 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
9041 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9042 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9043 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9047 r
= MsiGetFeatureState(hpkg
, "waters", &state
, &action
);
9048 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9049 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9050 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
9054 r
= MsiGetFeatureState(hpkg
, "bayer", &state
, &action
);
9055 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9056 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9057 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
9061 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
9062 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9063 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
9064 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9068 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
9069 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9070 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9071 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
9075 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
9076 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9077 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
9078 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
9082 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
9083 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9084 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
9085 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
9089 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
9090 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9091 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9092 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
9096 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
9097 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9098 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
9099 ok( action
== INSTALLSTATE_LOCAL
, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action
);
9103 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
9104 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9105 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
9106 ok( action
== INSTALLSTATE_LOCAL
, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action
);
9110 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
9111 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9112 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
9113 ok( action
== INSTALLSTATE_SOURCE
, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action
);
9117 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
9118 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9119 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9120 ok( action
== INSTALLSTATE_LOCAL
, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action
);
9124 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
9125 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9126 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9127 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9131 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
9132 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9133 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9134 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9136 r
= MsiSetFeatureState(hpkg
, "orion", INSTALLSTATE_ABSENT
);
9137 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
9141 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
9142 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9143 ok( state
== INSTALLSTATE_ABSENT
, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state
);
9144 ok( action
== INSTALLSTATE_LOCAL
, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action
);
9148 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
9149 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9150 ok( state
== INSTALLSTATE_ABSENT
, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state
);
9151 ok( action
== INSTALLSTATE_SOURCE
, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action
);
9155 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
9156 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9157 ok( state
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state
);
9158 ok( action
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action
);
9162 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
9163 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9164 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9165 ok( action
== INSTALLSTATE_LOCAL
, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action
);
9169 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
9170 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9171 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9172 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
9176 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
9177 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9178 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
9179 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
9183 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
9184 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9185 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
9186 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
9190 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
9191 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9192 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9193 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
9197 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
9198 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9199 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
9200 ok( action
== INSTALLSTATE_SOURCE
, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action
);
9204 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
9205 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9206 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
9207 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action
);
9211 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
9212 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9213 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
9214 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action
);
9218 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
9219 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9220 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9221 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9225 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
9226 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9227 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9228 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9232 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
9233 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9234 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9235 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9237 MsiCloseHandle(hpkg
);
9238 DeleteFileA(msifile
);
9241 static void test_installprops(void)
9243 MSIHANDLE hpkg
, hdb
;
9244 CHAR path
[MAX_PATH
];
9252 GetCurrentDirectory(MAX_PATH
, path
);
9253 lstrcat(path
, "\\");
9254 lstrcat(path
, msifile
);
9256 hdb
= create_package_db();
9257 ok( hdb
, "failed to create database\n");
9259 hpkg
= package_from_db(hdb
);
9260 ok( hpkg
, "failed to create package\n");
9262 MsiCloseHandle(hdb
);
9265 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
9266 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9267 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
9269 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
9271 RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2
);
9276 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
9280 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
9283 /* win9x doesn't set this */
9287 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
9288 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9289 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
9295 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
9299 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
9305 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
9306 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9307 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
9311 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
9312 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9313 trace("VersionDatabase = %s\n", buf
);
9316 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
9317 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9318 trace("VersionMsi = %s\n", buf
);
9321 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
9322 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9323 trace("Date = %s\n", buf
);
9326 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
9327 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9328 trace("Time = %s\n", buf
);
9331 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
9332 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
9333 trace("PackageCode = %s\n", buf
);
9335 langid
= GetUserDefaultLangID();
9336 sprintf(path
, "%d", langid
);
9339 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
9340 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS< got %d\n", r
);
9341 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
9343 res
= GetSystemMetrics(SM_CXSCREEN
);
9345 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
9346 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
9348 res
= GetSystemMetrics(SM_CYSCREEN
);
9350 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
9351 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
9355 MsiCloseHandle(hpkg
);
9356 DeleteFile(msifile
);
9359 static void test_launchconditions(void)
9365 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9367 hdb
= create_package_db();
9368 ok( hdb
, "failed to create package database\n" );
9370 r
= create_launchcondition_table( hdb
);
9371 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
9373 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
9374 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
9376 /* invalid condition */
9377 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
9378 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
9380 hpkg
= package_from_db( hdb
);
9381 ok( hpkg
, "failed to create package\n");
9383 MsiCloseHandle( hdb
);
9385 r
= MsiSetProperty( hpkg
, "X", "1" );
9386 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
9388 /* invalid conditions are ignored */
9389 r
= MsiDoAction( hpkg
, "LaunchConditions" );
9390 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
9392 /* verify LaunchConditions still does some verification */
9393 r
= MsiSetProperty( hpkg
, "X", "2" );
9394 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
9396 r
= MsiDoAction( hpkg
, "LaunchConditions" );
9397 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
9399 MsiCloseHandle( hpkg
);
9400 DeleteFile( msifile
);
9403 static void test_ccpsearch(void)
9405 MSIHANDLE hdb
, hpkg
;
9406 CHAR prop
[MAX_PATH
];
9407 DWORD size
= MAX_PATH
;
9410 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9412 hdb
= create_package_db();
9413 ok(hdb
, "failed to create package database\n");
9415 r
= create_ccpsearch_table(hdb
);
9416 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9418 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
9419 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9421 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
9422 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9424 r
= create_reglocator_table(hdb
);
9425 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9427 r
= add_reglocator_entry(hdb
, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9428 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9430 r
= create_drlocator_table(hdb
);
9431 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9433 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
9434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9436 r
= create_signature_table(hdb
);
9437 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9439 hpkg
= package_from_db(hdb
);
9440 ok(hpkg
, "failed to create package\n");
9442 MsiCloseHandle(hdb
);
9444 r
= MsiDoAction(hpkg
, "CCPSearch");
9445 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9447 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
9448 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9449 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
9451 MsiCloseHandle(hpkg
);
9452 DeleteFileA(msifile
);
9455 static void test_complocator(void)
9457 MSIHANDLE hdb
, hpkg
;
9459 CHAR prop
[MAX_PATH
];
9460 CHAR expected
[MAX_PATH
];
9461 DWORD size
= MAX_PATH
;
9463 hdb
= create_package_db();
9464 ok(hdb
, "failed to create package database\n");
9466 r
= create_appsearch_table(hdb
);
9467 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9469 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
9470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9472 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
9473 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9475 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
9476 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9478 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
9479 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9481 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
9482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9484 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
9485 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9487 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
9488 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9490 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
9491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9493 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
9494 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9496 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
9497 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9499 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
9500 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9502 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
9503 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9505 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
9506 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9508 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
9509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9511 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
9512 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9514 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
9515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9517 r
= create_complocator_table(hdb
);
9518 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9520 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9523 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9524 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9526 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9527 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9529 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9530 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9532 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9533 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9535 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9536 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9538 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9539 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9541 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9542 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9544 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9545 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9547 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9548 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9550 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9551 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9553 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9554 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9556 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9557 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9559 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9560 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9562 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9563 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9565 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9566 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9568 r
= create_signature_table(hdb
);
9569 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9571 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9572 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9574 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9575 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9577 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9580 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9581 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9583 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9584 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9586 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9587 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9589 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9590 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9592 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9593 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9595 hpkg
= package_from_db(hdb
);
9596 ok(hpkg
, "failed to create package\n");
9598 MsiCloseHandle(hdb
);
9600 create_test_file("abelisaurus");
9601 create_test_file("bactrosaurus");
9602 create_test_file("camelotia");
9603 create_test_file("diclonius");
9604 create_test_file("echinodon");
9605 create_test_file("falcarius");
9606 create_test_file("gallimimus");
9607 create_test_file("hagryphus");
9608 CreateDirectoryA("iguanodon", NULL
);
9609 CreateDirectoryA("jobaria", NULL
);
9610 CreateDirectoryA("kakuru", NULL
);
9611 CreateDirectoryA("labocania", NULL
);
9612 CreateDirectoryA("megaraptor", NULL
);
9613 CreateDirectoryA("neosodon", NULL
);
9614 CreateDirectoryA("olorotitan", NULL
);
9615 CreateDirectoryA("pantydraco", NULL
);
9617 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE
,
9618 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL
, FALSE
);
9619 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE
,
9620 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL
, FALSE
);
9621 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE
,
9622 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL
, FALSE
);
9623 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE
,
9624 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL
, FALSE
);
9625 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE
,
9626 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL
, FALSE
);
9627 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE
,
9628 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL
, FALSE
);
9629 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE
,
9630 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL
, FALSE
);
9631 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE
,
9632 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL
, FALSE
);
9634 r
= MsiDoAction(hpkg
, "AppSearch");
9635 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9638 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
9639 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9641 lstrcpyA(expected
, CURR_DIR
);
9642 lstrcatA(expected
, "\\abelisaurus");
9643 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9644 "Expected %s or empty string, got %s\n", expected
, prop
);
9647 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", prop
, &size
);
9648 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9649 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9652 r
= MsiGetPropertyA(hpkg
, "CAMELOTIA", prop
, &size
);
9653 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9654 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9657 r
= MsiGetPropertyA(hpkg
, "DICLONIUS", prop
, &size
);
9658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9659 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9662 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
9663 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9665 lstrcpyA(expected
, CURR_DIR
);
9666 lstrcatA(expected
, "\\");
9667 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9668 "Expected %s or empty string, got %s\n", expected
, prop
);
9671 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
9672 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9673 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9676 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
9677 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9678 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9681 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
9682 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9683 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9686 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
9687 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9688 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9691 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
9692 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9693 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9696 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
9697 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9698 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9701 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
9702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9703 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9706 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
9707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9709 lstrcpyA(expected
, CURR_DIR
);
9710 lstrcatA(expected
, "\\");
9711 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9712 "Expected %s or empty string, got %s\n", expected
, prop
);
9715 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
9716 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9718 lstrcpyA(expected
, CURR_DIR
);
9719 lstrcatA(expected
, "\\neosodon\\");
9720 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9721 "Expected %s or empty string, got %s\n", expected
, prop
);
9724 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
9725 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9726 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9729 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
9730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9731 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9733 MsiCloseHandle(hpkg
);
9734 DeleteFileA("abelisaurus");
9735 DeleteFileA("bactrosaurus");
9736 DeleteFileA("camelotia");
9737 DeleteFileA("diclonius");
9738 DeleteFileA("echinodon");
9739 DeleteFileA("falcarius");
9740 DeleteFileA("gallimimus");
9741 DeleteFileA("hagryphus");
9742 RemoveDirectoryA("iguanodon");
9743 RemoveDirectoryA("jobaria");
9744 RemoveDirectoryA("kakuru");
9745 RemoveDirectoryA("labocania");
9746 RemoveDirectoryA("megaraptor");
9747 RemoveDirectoryA("neosodon");
9748 RemoveDirectoryA("olorotitan");
9749 RemoveDirectoryA("pantydraco");
9750 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9751 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9752 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9753 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9754 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9755 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9756 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9757 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9758 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9759 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9760 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9761 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9762 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9763 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9764 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9765 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9766 DeleteFileA(msifile
);
9769 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
9774 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
9775 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9777 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
9778 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9780 r
= MsiSummaryInfoPersist(summary
);
9781 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
9783 MsiCloseHandle(summary
);
9786 static void test_MsiGetSourcePath(void)
9788 MSIHANDLE hdb
, hpkg
;
9789 CHAR path
[MAX_PATH
];
9791 CHAR subsrc
[MAX_PATH
];
9792 CHAR sub2
[MAX_PATH
];
9796 lstrcpyA(cwd
, CURR_DIR
);
9797 lstrcatA(cwd
, "\\");
9799 lstrcpyA(subsrc
, cwd
);
9800 lstrcatA(subsrc
, "subsource");
9801 lstrcatA(subsrc
, "\\");
9803 lstrcpyA(sub2
, subsrc
);
9804 lstrcatA(sub2
, "sub2");
9805 lstrcatA(sub2
, "\\");
9807 /* uncompressed source */
9809 hdb
= create_package_db();
9810 ok( hdb
, "failed to create database\n");
9812 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
9814 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
9815 ok(r
== S_OK
, "failed\n");
9817 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9818 ok(r
== S_OK
, "failed\n");
9820 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
9821 ok(r
== S_OK
, "failed\n");
9823 r
= MsiDatabaseCommit(hdb
);
9824 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
9826 hpkg
= package_from_db(hdb
);
9827 ok(hpkg
, "failed to create package\n");
9829 MsiCloseHandle(hdb
);
9831 /* invalid database handle */
9833 lstrcpyA(path
, "kiwi");
9834 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
9835 ok(r
== ERROR_INVALID_HANDLE
,
9836 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
9837 ok(!lstrcmpA(path
, "kiwi"),
9838 "Expected path to be unchanged, got \"%s\"\n", path
);
9839 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9843 lstrcpyA(path
, "kiwi");
9844 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
9845 ok(r
== ERROR_INVALID_PARAMETER
,
9846 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
9847 ok(!lstrcmpA(path
, "kiwi"),
9848 "Expected path to be unchanged, got \"%s\"\n", path
);
9849 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9851 /* empty szFolder */
9853 lstrcpyA(path
, "kiwi");
9854 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
9855 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9856 ok(!lstrcmpA(path
, "kiwi"),
9857 "Expected path to be unchanged, got \"%s\"\n", path
);
9858 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9862 lstrcpyA(path
, "kiwi");
9863 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9864 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9865 ok(!lstrcmpA(path
, "kiwi"),
9866 "Expected path to be unchanged, got \"%s\"\n", path
);
9867 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9871 lstrcpyA(path
, "kiwi");
9872 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9873 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9874 ok(!lstrcmpA(path
, "kiwi"),
9875 "Expected path to be unchanged, got \"%s\"\n", path
);
9876 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9880 lstrcpyA(path
, "kiwi");
9881 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9882 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9883 ok(!lstrcmpA(path
, "kiwi"),
9884 "Expected path to be unchanged, got \"%s\"\n", path
);
9885 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9887 /* source path does not exist, but the property exists */
9889 lstrcpyA(path
, "kiwi");
9890 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9892 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9893 ok(size
== 0, "Expected 0, got %d\n", size
);
9897 lstrcpyA(path
, "kiwi");
9898 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9899 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9900 ok(!lstrcmpA(path
, "kiwi"),
9901 "Expected path to be unchanged, got \"%s\"\n", path
);
9902 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9906 lstrcpyA(path
, "kiwi");
9907 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9908 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9909 ok(!lstrcmpA(path
, "kiwi"),
9910 "Expected path to be unchanged, got \"%s\"\n", path
);
9911 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9913 r
= MsiDoAction(hpkg
, "CostInitialize");
9914 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
9916 /* try TARGETDIR after CostInitialize */
9918 lstrcpyA(path
, "kiwi");
9919 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9920 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9921 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9922 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9924 /* try SourceDir after CostInitialize */
9926 lstrcpyA(path
, "kiwi");
9927 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9928 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9929 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9930 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9932 /* try SOURCEDIR after CostInitialize */
9934 lstrcpyA(path
, "kiwi");
9935 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9936 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9937 ok(!lstrcmpA(path
, "kiwi"),
9938 "Expected path to be unchanged, got \"%s\"\n", path
);
9939 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9941 /* source path does not exist, but the property exists */
9943 lstrcpyA(path
, "kiwi");
9944 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9945 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9948 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9949 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9952 /* try SubDir after CostInitialize */
9954 lstrcpyA(path
, "kiwi");
9955 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9956 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9957 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9958 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9960 /* try SubDir2 after CostInitialize */
9962 lstrcpyA(path
, "kiwi");
9963 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9964 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9965 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
9966 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
9968 r
= MsiDoAction(hpkg
, "ResolveSource");
9969 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9971 /* try TARGETDIR after ResolveSource */
9973 lstrcpyA(path
, "kiwi");
9974 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9975 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9976 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9977 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9979 /* try SourceDir after ResolveSource */
9981 lstrcpyA(path
, "kiwi");
9982 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9983 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9984 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9985 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9987 /* try SOURCEDIR after ResolveSource */
9989 lstrcpyA(path
, "kiwi");
9990 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9991 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9992 ok(!lstrcmpA(path
, "kiwi"),
9993 "Expected path to be unchanged, got \"%s\"\n", path
);
9994 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9996 /* source path does not exist, but the property exists */
9998 lstrcpyA(path
, "kiwi");
9999 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10000 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10001 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10002 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10004 /* try SubDir after ResolveSource */
10006 lstrcpyA(path
, "kiwi");
10007 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10008 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10009 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10010 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10012 /* try SubDir2 after ResolveSource */
10014 lstrcpyA(path
, "kiwi");
10015 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10016 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10017 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
10018 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
10020 r
= MsiDoAction(hpkg
, "FileCost");
10021 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10023 /* try TARGETDIR after FileCost */
10025 lstrcpyA(path
, "kiwi");
10026 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10027 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10028 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10029 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10031 /* try SourceDir after FileCost */
10033 lstrcpyA(path
, "kiwi");
10034 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10035 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10036 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10037 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10039 /* try SOURCEDIR after FileCost */
10041 lstrcpyA(path
, "kiwi");
10042 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10043 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10044 ok(!lstrcmpA(path
, "kiwi"),
10045 "Expected path to be unchanged, got \"%s\"\n", path
);
10046 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10048 /* try SubDir after FileCost */
10050 lstrcpyA(path
, "kiwi");
10051 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10052 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10053 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10054 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10056 /* try SubDir2 after FileCost */
10058 lstrcpyA(path
, "kiwi");
10059 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10060 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10061 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
10062 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
10064 r
= MsiDoAction(hpkg
, "CostFinalize");
10065 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10067 /* try TARGETDIR after CostFinalize */
10069 lstrcpyA(path
, "kiwi");
10070 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10071 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10072 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10073 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10075 /* try SourceDir after CostFinalize */
10077 lstrcpyA(path
, "kiwi");
10078 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10079 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10080 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10081 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10083 /* try SOURCEDIR after CostFinalize */
10085 lstrcpyA(path
, "kiwi");
10086 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10087 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10088 ok(!lstrcmpA(path
, "kiwi"),
10089 "Expected path to be unchanged, got \"%s\"\n", path
);
10090 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10092 /* try SubDir after CostFinalize */
10094 lstrcpyA(path
, "kiwi");
10095 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10096 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10097 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10098 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10100 /* try SubDir2 after CostFinalize */
10102 lstrcpyA(path
, "kiwi");
10103 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10104 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10105 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
10106 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
10108 /* nonexistent directory */
10110 lstrcpyA(path
, "kiwi");
10111 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
10112 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10113 ok(!lstrcmpA(path
, "kiwi"),
10114 "Expected path to be unchanged, got \"%s\"\n", path
);
10115 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10117 /* NULL szPathBuf */
10119 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
10120 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10121 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10123 /* NULL pcchPathBuf */
10124 lstrcpyA(path
, "kiwi");
10125 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
10126 ok(r
== ERROR_INVALID_PARAMETER
,
10127 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
10128 ok(!lstrcmpA(path
, "kiwi"),
10129 "Expected path to be unchanged, got \"%s\"\n", path
);
10131 /* pcchPathBuf is 0 */
10133 lstrcpyA(path
, "kiwi");
10134 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10135 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
10136 ok(!lstrcmpA(path
, "kiwi"),
10137 "Expected path to be unchanged, got \"%s\"\n", path
);
10138 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10140 /* pcchPathBuf does not have room for NULL terminator */
10141 size
= lstrlenA(cwd
);
10142 lstrcpyA(path
, "kiwi");
10143 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10144 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
10145 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
10146 "Expected path with no backslash, got \"%s\"\n", path
);
10147 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10149 /* pcchPathBuf has room for NULL terminator */
10150 size
= lstrlenA(cwd
) + 1;
10151 lstrcpyA(path
, "kiwi");
10152 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10153 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10154 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10155 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10157 MsiCloseHandle(hpkg
);
10159 /* compressed source */
10161 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
10162 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10164 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
10166 hpkg
= package_from_db(hdb
);
10167 ok(hpkg
, "failed to create package\n");
10169 r
= MsiDoAction(hpkg
, "CostInitialize");
10170 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10171 r
= MsiDoAction(hpkg
, "FileCost");
10172 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10173 r
= MsiDoAction(hpkg
, "CostFinalize");
10174 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10176 /* try TARGETDIR after CostFinalize */
10178 lstrcpyA(path
, "kiwi");
10179 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10180 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10181 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10182 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10184 /* try SourceDir after CostFinalize */
10186 lstrcpyA(path
, "kiwi");
10187 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10188 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10189 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10190 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10192 /* try SOURCEDIR after CostFinalize */
10194 lstrcpyA(path
, "kiwi");
10195 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10198 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10199 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10200 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10203 /* try SubDir after CostFinalize */
10205 lstrcpyA(path
, "kiwi");
10206 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10207 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10208 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10209 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10211 /* try SubDir2 after CostFinalize */
10213 lstrcpyA(path
, "kiwi");
10214 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10215 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10216 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10217 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10219 MsiCloseHandle(hpkg
);
10220 DeleteFile(msifile
);
10223 static void test_shortlongsource(void)
10225 MSIHANDLE hdb
, hpkg
;
10226 CHAR path
[MAX_PATH
];
10227 CHAR cwd
[MAX_PATH
];
10228 CHAR subsrc
[MAX_PATH
];
10232 lstrcpyA(cwd
, CURR_DIR
);
10233 lstrcatA(cwd
, "\\");
10235 lstrcpyA(subsrc
, cwd
);
10236 lstrcatA(subsrc
, "long");
10237 lstrcatA(subsrc
, "\\");
10239 /* long file names */
10241 hdb
= create_package_db();
10242 ok( hdb
, "failed to create database\n");
10244 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
10246 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
10247 ok(r
== S_OK
, "failed\n");
10249 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
10250 ok(r
== S_OK
, "failed\n");
10252 /* CostInitialize:short */
10253 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
10254 ok(r
== S_OK
, "failed\n");
10256 /* CostInitialize:long */
10257 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
10258 ok(r
== S_OK
, "failed\n");
10260 /* FileCost:short */
10261 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
10262 ok(r
== S_OK
, "failed\n");
10264 /* FileCost:long */
10265 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
10266 ok(r
== S_OK
, "failed\n");
10268 /* CostFinalize:short */
10269 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
10270 ok(r
== S_OK
, "failed\n");
10272 /* CostFinalize:long */
10273 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
10274 ok(r
== S_OK
, "failed\n");
10276 MsiDatabaseCommit(hdb
);
10278 hpkg
= package_from_db(hdb
);
10279 ok(hpkg
, "failed to create package\n");
10281 MsiCloseHandle(hdb
);
10283 CreateDirectoryA("one", NULL
);
10284 CreateDirectoryA("four", NULL
);
10286 r
= MsiDoAction(hpkg
, "CostInitialize");
10287 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10289 CreateDirectory("five", NULL
);
10290 CreateDirectory("eight", NULL
);
10292 r
= MsiDoAction(hpkg
, "FileCost");
10293 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10295 CreateDirectory("nine", NULL
);
10296 CreateDirectory("twelve", NULL
);
10298 r
= MsiDoAction(hpkg
, "CostFinalize");
10299 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10301 /* neither short nor long source directories exist */
10303 lstrcpyA(path
, "kiwi");
10304 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10305 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10306 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10307 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10309 CreateDirectoryA("short", NULL
);
10311 /* short source directory exists */
10313 lstrcpyA(path
, "kiwi");
10314 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10315 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10316 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10317 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10319 CreateDirectoryA("long", NULL
);
10321 /* both short and long source directories exist */
10323 lstrcpyA(path
, "kiwi");
10324 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10325 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10326 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10327 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10329 lstrcpyA(subsrc
, cwd
);
10330 lstrcatA(subsrc
, "two");
10331 lstrcatA(subsrc
, "\\");
10333 /* short dir exists before CostInitialize */
10335 lstrcpyA(path
, "kiwi");
10336 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10337 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10338 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10339 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10341 lstrcpyA(subsrc
, cwd
);
10342 lstrcatA(subsrc
, "four");
10343 lstrcatA(subsrc
, "\\");
10345 /* long dir exists before CostInitialize */
10347 lstrcpyA(path
, "kiwi");
10348 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
10349 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10350 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10351 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10353 lstrcpyA(subsrc
, cwd
);
10354 lstrcatA(subsrc
, "six");
10355 lstrcatA(subsrc
, "\\");
10357 /* short dir exists before FileCost */
10359 lstrcpyA(path
, "kiwi");
10360 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
10361 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10362 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10363 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10365 lstrcpyA(subsrc
, cwd
);
10366 lstrcatA(subsrc
, "eight");
10367 lstrcatA(subsrc
, "\\");
10369 /* long dir exists before FileCost */
10371 lstrcpyA(path
, "kiwi");
10372 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
10373 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10374 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10375 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10377 lstrcpyA(subsrc
, cwd
);
10378 lstrcatA(subsrc
, "ten");
10379 lstrcatA(subsrc
, "\\");
10381 /* short dir exists before CostFinalize */
10383 lstrcpyA(path
, "kiwi");
10384 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
10385 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10386 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10387 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10389 lstrcpyA(subsrc
, cwd
);
10390 lstrcatA(subsrc
, "twelve");
10391 lstrcatA(subsrc
, "\\");
10393 /* long dir exists before CostFinalize */
10395 lstrcpyA(path
, "kiwi");
10396 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
10397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10398 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10399 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10401 MsiCloseHandle(hpkg
);
10402 RemoveDirectoryA("short");
10403 RemoveDirectoryA("long");
10404 RemoveDirectoryA("one");
10405 RemoveDirectoryA("four");
10406 RemoveDirectoryA("five");
10407 RemoveDirectoryA("eight");
10408 RemoveDirectoryA("nine");
10409 RemoveDirectoryA("twelve");
10411 /* short file names */
10413 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
10414 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10416 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
10418 hpkg
= package_from_db(hdb
);
10419 ok(hpkg
, "failed to create package\n");
10421 MsiCloseHandle(hdb
);
10423 CreateDirectoryA("one", NULL
);
10424 CreateDirectoryA("four", NULL
);
10426 r
= MsiDoAction(hpkg
, "CostInitialize");
10427 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10429 CreateDirectory("five", NULL
);
10430 CreateDirectory("eight", NULL
);
10432 r
= MsiDoAction(hpkg
, "FileCost");
10433 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10435 CreateDirectory("nine", NULL
);
10436 CreateDirectory("twelve", NULL
);
10438 r
= MsiDoAction(hpkg
, "CostFinalize");
10439 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10441 lstrcpyA(subsrc
, cwd
);
10442 lstrcatA(subsrc
, "short");
10443 lstrcatA(subsrc
, "\\");
10445 /* neither short nor long source directories exist */
10447 lstrcpyA(path
, "kiwi");
10448 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10449 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10450 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10451 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10453 CreateDirectoryA("short", NULL
);
10455 /* short source directory exists */
10457 lstrcpyA(path
, "kiwi");
10458 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10459 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10460 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10461 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10463 CreateDirectoryA("long", NULL
);
10465 /* both short and long source directories exist */
10467 lstrcpyA(path
, "kiwi");
10468 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10469 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10470 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10471 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10473 lstrcpyA(subsrc
, cwd
);
10474 lstrcatA(subsrc
, "one");
10475 lstrcatA(subsrc
, "\\");
10477 /* short dir exists before CostInitialize */
10479 lstrcpyA(path
, "kiwi");
10480 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10481 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10482 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10483 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10485 lstrcpyA(subsrc
, cwd
);
10486 lstrcatA(subsrc
, "three");
10487 lstrcatA(subsrc
, "\\");
10489 /* long dir exists before CostInitialize */
10491 lstrcpyA(path
, "kiwi");
10492 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
10493 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10494 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10495 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10497 lstrcpyA(subsrc
, cwd
);
10498 lstrcatA(subsrc
, "five");
10499 lstrcatA(subsrc
, "\\");
10501 /* short dir exists before FileCost */
10503 lstrcpyA(path
, "kiwi");
10504 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
10505 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10506 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10507 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10509 lstrcpyA(subsrc
, cwd
);
10510 lstrcatA(subsrc
, "seven");
10511 lstrcatA(subsrc
, "\\");
10513 /* long dir exists before FileCost */
10515 lstrcpyA(path
, "kiwi");
10516 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
10517 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10518 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10519 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10521 lstrcpyA(subsrc
, cwd
);
10522 lstrcatA(subsrc
, "nine");
10523 lstrcatA(subsrc
, "\\");
10525 /* short dir exists before CostFinalize */
10527 lstrcpyA(path
, "kiwi");
10528 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
10529 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10530 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10531 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10533 lstrcpyA(subsrc
, cwd
);
10534 lstrcatA(subsrc
, "eleven");
10535 lstrcatA(subsrc
, "\\");
10537 /* long dir exists before CostFinalize */
10539 lstrcpyA(path
, "kiwi");
10540 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
10541 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10542 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10543 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10545 MsiCloseHandle(hpkg
);
10546 RemoveDirectoryA("short");
10547 RemoveDirectoryA("long");
10548 RemoveDirectoryA("one");
10549 RemoveDirectoryA("four");
10550 RemoveDirectoryA("five");
10551 RemoveDirectoryA("eight");
10552 RemoveDirectoryA("nine");
10553 RemoveDirectoryA("twelve");
10554 DeleteFileA(msifile
);
10557 static void test_sourcedir(void)
10559 MSIHANDLE hdb
, hpkg
;
10561 CHAR path
[MAX_PATH
];
10562 CHAR cwd
[MAX_PATH
];
10563 CHAR subsrc
[MAX_PATH
];
10567 lstrcpyA(cwd
, CURR_DIR
);
10568 lstrcatA(cwd
, "\\");
10570 lstrcpyA(subsrc
, cwd
);
10571 lstrcatA(subsrc
, "long");
10572 lstrcatA(subsrc
, "\\");
10574 hdb
= create_package_db();
10575 ok( hdb
, "failed to create database\n");
10577 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
10578 ok(r
== S_OK
, "failed\n");
10580 sprintf(package
, "#%i", hdb
);
10581 r
= MsiOpenPackage(package
, &hpkg
);
10582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10584 /* properties only */
10586 /* SourceDir prop */
10588 lstrcpyA(path
, "kiwi");
10589 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10590 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10591 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10592 ok(size
== 0, "Expected 0, got %d\n", size
);
10594 /* SOURCEDIR prop */
10596 lstrcpyA(path
, "kiwi");
10597 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10598 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10599 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10600 ok(size
== 0, "Expected 0, got %d\n", size
);
10602 r
= MsiDoAction(hpkg
, "CostInitialize");
10603 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10605 /* SourceDir after CostInitialize */
10607 lstrcpyA(path
, "kiwi");
10608 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10610 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10611 ok(size
== 0, "Expected 0, got %d\n", size
);
10613 /* SOURCEDIR after CostInitialize */
10615 lstrcpyA(path
, "kiwi");
10616 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10617 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10618 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10619 ok(size
== 0, "Expected 0, got %d\n", size
);
10621 r
= MsiDoAction(hpkg
, "FileCost");
10622 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10624 /* SourceDir after FileCost */
10626 lstrcpyA(path
, "kiwi");
10627 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10628 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10629 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10630 ok(size
== 0, "Expected 0, got %d\n", size
);
10632 /* SOURCEDIR after FileCost */
10634 lstrcpyA(path
, "kiwi");
10635 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10636 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10637 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10638 ok(size
== 0, "Expected 0, got %d\n", size
);
10640 r
= MsiDoAction(hpkg
, "CostFinalize");
10641 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10643 /* SourceDir after CostFinalize */
10645 lstrcpyA(path
, "kiwi");
10646 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10647 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10648 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10649 ok(size
== 0, "Expected 0, got %d\n", size
);
10651 /* SOURCEDIR after CostFinalize */
10653 lstrcpyA(path
, "kiwi");
10654 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10655 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10656 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10657 ok(size
== 0, "Expected 0, got %d\n", size
);
10659 r
= MsiDoAction(hpkg
, "ResolveSource");
10660 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10662 /* SourceDir after ResolveSource */
10664 lstrcpyA(path
, "kiwi");
10665 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10666 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10667 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10668 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10670 /* SOURCEDIR after ResolveSource */
10672 lstrcpyA(path
, "kiwi");
10673 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10674 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10675 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10676 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10678 /* random casing */
10680 lstrcpyA(path
, "kiwi");
10681 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
10682 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10683 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10684 ok(size
== 0, "Expected 0, got %d\n", size
);
10686 MsiCloseHandle(hpkg
);
10688 /* reset the package state */
10689 sprintf(package
, "#%i", hdb
);
10690 r
= MsiOpenPackage(package
, &hpkg
);
10691 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10693 /* test how MsiGetSourcePath affects the properties */
10695 /* SourceDir prop */
10697 lstrcpyA(path
, "kiwi");
10698 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10699 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10702 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10703 ok(size
== 0, "Expected 0, got %d\n", size
);
10707 lstrcpyA(path
, "kiwi");
10708 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10709 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10710 ok(!lstrcmpA(path
, "kiwi"),
10711 "Expected path to be unchanged, got \"%s\"\n", path
);
10712 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10714 /* SourceDir after MsiGetSourcePath */
10716 lstrcpyA(path
, "kiwi");
10717 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10718 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10721 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10722 ok(size
== 0, "Expected 0, got %d\n", size
);
10725 /* SOURCEDIR prop */
10727 lstrcpyA(path
, "kiwi");
10728 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10729 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10732 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10733 ok(size
== 0, "Expected 0, got %d\n", size
);
10737 lstrcpyA(path
, "kiwi");
10738 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10739 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10740 ok(!lstrcmpA(path
, "kiwi"),
10741 "Expected path to be unchanged, got \"%s\"\n", path
);
10742 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10744 /* SOURCEDIR prop after MsiGetSourcePath */
10746 lstrcpyA(path
, "kiwi");
10747 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10751 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10752 ok(size
== 0, "Expected 0, got %d\n", size
);
10755 r
= MsiDoAction(hpkg
, "CostInitialize");
10756 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10758 /* SourceDir after CostInitialize */
10760 lstrcpyA(path
, "kiwi");
10761 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10762 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10765 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10766 ok(size
== 0, "Expected 0, got %d\n", size
);
10770 lstrcpyA(path
, "kiwi");
10771 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10772 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10773 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10774 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10776 /* SourceDir after MsiGetSourcePath */
10778 lstrcpyA(path
, "kiwi");
10779 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10780 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10781 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10782 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10784 /* SOURCEDIR after CostInitialize */
10786 lstrcpyA(path
, "kiwi");
10787 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10788 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10789 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10790 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10792 /* SOURCEDIR source path still does not exist */
10794 lstrcpyA(path
, "kiwi");
10795 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10796 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10797 ok(!lstrcmpA(path
, "kiwi"),
10798 "Expected path to be unchanged, got \"%s\"\n", path
);
10799 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10801 r
= MsiDoAction(hpkg
, "FileCost");
10802 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10804 /* SourceDir after FileCost */
10806 lstrcpyA(path
, "kiwi");
10807 r
= MsiGetProperty(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
);
10812 /* SOURCEDIR after FileCost */
10814 lstrcpyA(path
, "kiwi");
10815 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10816 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10817 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10818 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10820 /* SOURCEDIR source path still does not exist */
10822 lstrcpyA(path
, "kiwi");
10823 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10824 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10825 ok(!lstrcmpA(path
, "kiwi"),
10826 "Expected path to be unchanged, got \"%s\"\n", path
);
10827 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10829 r
= MsiDoAction(hpkg
, "CostFinalize");
10830 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10832 /* SourceDir after CostFinalize */
10834 lstrcpyA(path
, "kiwi");
10835 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10836 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10837 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10838 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10840 /* SOURCEDIR after CostFinalize */
10842 lstrcpyA(path
, "kiwi");
10843 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10844 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10845 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10846 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10848 /* SOURCEDIR source path still does not exist */
10850 lstrcpyA(path
, "kiwi");
10851 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10852 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10853 ok(!lstrcmpA(path
, "kiwi"),
10854 "Expected path to be unchanged, got \"%s\"\n", path
);
10855 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10857 r
= MsiDoAction(hpkg
, "ResolveSource");
10858 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10860 /* SourceDir after ResolveSource */
10862 lstrcpyA(path
, "kiwi");
10863 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10865 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10866 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10868 /* SOURCEDIR after ResolveSource */
10870 lstrcpyA(path
, "kiwi");
10871 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10872 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10873 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10874 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10876 /* SOURCEDIR source path still does not exist */
10878 lstrcpyA(path
, "kiwi");
10879 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10880 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10881 ok(!lstrcmpA(path
, "kiwi"),
10882 "Expected path to be unchanged, got \"%s\"\n", path
);
10883 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10885 MsiCloseHandle(hdb
);
10886 MsiCloseHandle(hpkg
);
10887 DeleteFileA(msifile
);
10897 static const struct access_res create
[16] =
10899 { TRUE
, ERROR_SUCCESS
, TRUE
},
10900 { TRUE
, ERROR_SUCCESS
, TRUE
},
10901 { TRUE
, ERROR_SUCCESS
, FALSE
},
10902 { TRUE
, ERROR_SUCCESS
, FALSE
},
10903 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10904 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10905 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10906 { TRUE
, ERROR_SUCCESS
, FALSE
},
10907 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10908 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10909 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10910 { TRUE
, ERROR_SUCCESS
, TRUE
},
10911 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10912 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10913 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10914 { TRUE
, ERROR_SUCCESS
, TRUE
}
10917 static const struct access_res create_commit
[16] =
10919 { TRUE
, ERROR_SUCCESS
, TRUE
},
10920 { TRUE
, ERROR_SUCCESS
, TRUE
},
10921 { TRUE
, ERROR_SUCCESS
, FALSE
},
10922 { TRUE
, ERROR_SUCCESS
, FALSE
},
10923 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10924 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10925 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10926 { TRUE
, ERROR_SUCCESS
, FALSE
},
10927 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10928 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10929 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10930 { TRUE
, ERROR_SUCCESS
, TRUE
},
10931 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10932 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10933 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10934 { TRUE
, ERROR_SUCCESS
, TRUE
}
10937 static const struct access_res create_close
[16] =
10939 { TRUE
, ERROR_SUCCESS
, FALSE
},
10940 { TRUE
, ERROR_SUCCESS
, FALSE
},
10941 { TRUE
, ERROR_SUCCESS
, FALSE
},
10942 { TRUE
, ERROR_SUCCESS
, FALSE
},
10943 { TRUE
, ERROR_SUCCESS
, FALSE
},
10944 { TRUE
, ERROR_SUCCESS
, FALSE
},
10945 { TRUE
, ERROR_SUCCESS
, FALSE
},
10946 { TRUE
, ERROR_SUCCESS
, FALSE
},
10947 { TRUE
, ERROR_SUCCESS
, FALSE
},
10948 { TRUE
, ERROR_SUCCESS
, FALSE
},
10949 { TRUE
, ERROR_SUCCESS
, FALSE
},
10950 { TRUE
, ERROR_SUCCESS
, FALSE
},
10951 { TRUE
, ERROR_SUCCESS
, FALSE
},
10952 { TRUE
, ERROR_SUCCESS
, FALSE
},
10953 { TRUE
, ERROR_SUCCESS
, FALSE
},
10954 { TRUE
, ERROR_SUCCESS
}
10957 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
10959 DWORD access
= 0, share
= 0;
10964 for (i
= 0; i
< 4; i
++)
10966 if (i
== 0) access
= 0;
10967 if (i
== 1) access
= GENERIC_READ
;
10968 if (i
== 2) access
= GENERIC_WRITE
;
10969 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
10971 for (j
= 0; j
< 4; j
++)
10973 if (ares
[idx
].ignore
)
10976 if (j
== 0) share
= 0;
10977 if (j
== 1) share
= FILE_SHARE_READ
;
10978 if (j
== 2) share
= FILE_SHARE_WRITE
;
10979 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
10981 SetLastError(0xdeadbeef);
10982 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
10983 FILE_ATTRIBUTE_NORMAL
, 0);
10984 lasterr
= GetLastError();
10986 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
10987 "(%d, handle, %d): Expected %d, got %d\n",
10988 line
, idx
, ares
[idx
].gothandle
,
10989 (hfile
!= INVALID_HANDLE_VALUE
));
10991 ok(lasterr
== ares
[idx
].lasterr
||
10992 lasterr
== 0xdeadbeef, /* win9x */
10993 "(%d, lasterr, %d): Expected %d, got %d\n",
10994 line
, idx
, ares
[idx
].lasterr
, lasterr
);
10996 CloseHandle(hfile
);
11002 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
11004 static void test_access(void)
11009 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
11010 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11012 test_file_access(msifile
, create
);
11014 r
= MsiDatabaseCommit(hdb
);
11015 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11017 test_file_access(msifile
, create_commit
);
11019 MsiCloseHandle(hdb
);
11021 test_file_access(msifile
, create_close
);
11023 DeleteFileA(msifile
);
11025 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
11026 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11028 test_file_access(msifile
, create
);
11030 r
= MsiDatabaseCommit(hdb
);
11031 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11033 test_file_access(msifile
, create_commit
);
11035 MsiCloseHandle(hdb
);
11037 test_file_access(msifile
, create_close
);
11039 DeleteFileA(msifile
);
11042 static void test_emptypackage(void)
11044 MSIHANDLE hpkg
, hdb
, hsuminfo
;
11045 MSIHANDLE hview
, hrec
;
11046 MSICONDITION condition
;
11047 CHAR buffer
[MAX_PATH
];
11051 r
= MsiOpenPackageA("", &hpkg
);
11054 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11057 hdb
= MsiGetActiveDatabase(hpkg
);
11060 ok(hdb
!= 0, "Expected a valid database handle\n");
11063 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Tables`", &hview
);
11066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11068 r
= MsiViewExecute(hview
, 0);
11071 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11074 r
= MsiViewFetch(hview
, &hrec
);
11077 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11081 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
11084 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11085 ok(!lstrcmpA(buffer
, "_Property"),
11086 "Expected \"_Property\", got \"%s\"\n", buffer
);
11089 MsiCloseHandle(hrec
);
11091 r
= MsiViewFetch(hview
, &hrec
);
11094 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11098 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
11101 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11102 ok(!lstrcmpA(buffer
, "#_FolderCache"),
11103 "Expected \"_Property\", got \"%s\"\n", buffer
);
11106 MsiCloseHandle(hrec
);
11107 MsiViewClose(hview
);
11108 MsiCloseHandle(hview
);
11110 condition
= MsiDatabaseIsTablePersistentA(hdb
, "_Property");
11113 ok(condition
== MSICONDITION_FALSE
,
11114 "Expected MSICONDITION_FALSE, got %d\n", condition
);
11117 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
11120 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11122 r
= MsiViewExecute(hview
, 0);
11125 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11128 /* _Property table is not empty */
11129 r
= MsiViewFetch(hview
, &hrec
);
11132 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11135 MsiCloseHandle(hrec
);
11136 MsiViewClose(hview
);
11137 MsiCloseHandle(hview
);
11139 condition
= MsiDatabaseIsTablePersistentA(hdb
, "#_FolderCache");
11142 ok(condition
== MSICONDITION_FALSE
,
11143 "Expected MSICONDITION_FALSE, got %d\n", condition
);
11146 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `#_FolderCache`", &hview
);
11149 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11151 r
= MsiViewExecute(hview
, 0);
11154 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11157 /* #_FolderCache is not empty */
11158 r
= MsiViewFetch(hview
, &hrec
);
11161 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11164 MsiCloseHandle(hrec
);
11165 MsiViewClose(hview
);
11166 MsiCloseHandle(hview
);
11168 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Streams`", &hview
);
11171 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
11172 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
11175 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Storages`", &hview
);
11178 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
11179 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
11182 r
= MsiGetSummaryInformationA(hdb
, NULL
, 0, &hsuminfo
);
11185 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
11186 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
11189 MsiCloseHandle(hsuminfo
);
11191 r
= MsiDatabaseCommit(hdb
);
11194 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11197 MsiCloseHandle(hdb
);
11198 MsiCloseHandle(hpkg
);
11201 static void test_MsiGetProductProperty(void)
11203 MSIHANDLE hprod
, hdb
;
11204 CHAR val
[MAX_PATH
];
11205 CHAR path
[MAX_PATH
];
11206 CHAR query
[MAX_PATH
];
11207 CHAR keypath
[MAX_PATH
*2];
11208 CHAR prodcode
[MAX_PATH
];
11209 CHAR prod_squashed
[MAX_PATH
];
11210 HKEY prodkey
, userkey
, props
;
11217 scm
= OpenSCManager(NULL
, NULL
, SC_MANAGER_CONNECT
);
11218 if (!scm
&& (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED
))
11220 win_skip("Different registry keys on Win9x and WinMe\n");
11223 CloseServiceHandle(scm
);
11225 GetCurrentDirectoryA(MAX_PATH
, path
);
11226 lstrcatA(path
, "\\");
11228 create_test_guid(prodcode
, prod_squashed
);
11229 get_user_sid(&usersid
);
11231 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
11232 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11234 r
= MsiDatabaseCommit(hdb
);
11235 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11237 r
= set_summary_info(hdb
);
11238 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11241 "CREATE TABLE `Directory` ( "
11242 "`Directory` CHAR(255) NOT NULL, "
11243 "`Directory_Parent` CHAR(255), "
11244 "`DefaultDir` CHAR(255) NOT NULL "
11245 "PRIMARY KEY `Directory`)");
11246 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11249 "CREATE TABLE `Property` ( "
11250 "`Property` CHAR(72) NOT NULL, "
11251 "`Value` CHAR(255) "
11252 "PRIMARY KEY `Property`)");
11253 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11255 sprintf(query
, "INSERT INTO `Property` "
11256 "(`Property`, `Value`) "
11257 "VALUES( 'ProductCode', '%s' )", prodcode
);
11258 r
= run_query(hdb
, query
);
11259 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11261 r
= MsiDatabaseCommit(hdb
);
11262 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11264 MsiCloseHandle(hdb
);
11266 lstrcpyA(keypath
, "Software\\Classes\\Installer\\Products\\");
11267 lstrcatA(keypath
, prod_squashed
);
11269 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, keypath
, &prodkey
);
11270 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11272 lstrcpyA(keypath
, "Software\\Microsoft\\Windows\\CurrentVersion\\");
11273 lstrcatA(keypath
, "Installer\\UserData\\S-1-5-18\\Products\\");
11274 lstrcatA(keypath
, prod_squashed
);
11276 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, keypath
, &userkey
);
11277 if (res
== ERROR_ACCESS_DENIED
)
11279 skip("Not enough rights to perform tests\n");
11280 RegDeleteKeyA(prodkey
, "");
11281 RegCloseKey(prodkey
);
11284 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11286 res
= RegCreateKeyA(userkey
, "InstallProperties", &props
);
11287 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11289 lstrcpyA(val
, path
);
11290 lstrcatA(val
, "\\winetest.msi");
11291 res
= RegSetValueExA(props
, "LocalPackage", 0, REG_SZ
,
11292 (const BYTE
*)val
, lstrlenA(val
) + 1);
11293 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
11295 hprod
= 0xdeadbeef;
11296 r
= MsiOpenProductA(prodcode
, &hprod
);
11297 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11298 ok(hprod
!= 0 && hprod
!= 0xdeadbeef, "Expected a valid product handle\n");
11300 /* hProduct is invalid */
11302 lstrcpyA(val
, "apple");
11303 r
= MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val
, &size
);
11304 ok(r
== ERROR_INVALID_HANDLE
,
11305 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
11306 ok(!lstrcmpA(val
, "apple"),
11307 "Expected val to be unchanged, got \"%s\"\n", val
);
11308 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11310 /* szProperty is NULL */
11312 lstrcpyA(val
, "apple");
11313 r
= MsiGetProductPropertyA(hprod
, NULL
, val
, &size
);
11314 ok(r
== ERROR_INVALID_PARAMETER
,
11315 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11316 ok(!lstrcmpA(val
, "apple"),
11317 "Expected val to be unchanged, got \"%s\"\n", val
);
11318 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11320 /* szProperty is empty */
11322 lstrcpyA(val
, "apple");
11323 r
= MsiGetProductPropertyA(hprod
, "", val
, &size
);
11324 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11325 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
11326 ok(size
== 0, "Expected 0, got %d\n", size
);
11328 /* get the property */
11330 lstrcpyA(val
, "apple");
11331 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11332 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11333 ok(!lstrcmpA(val
, prodcode
),
11334 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
11335 ok(size
== lstrlenA(prodcode
),
11336 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11338 /* lpValueBuf is NULL */
11340 r
= MsiGetProductPropertyA(hprod
, "ProductCode", NULL
, &size
);
11341 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11342 ok(size
== lstrlenA(prodcode
),
11343 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11345 /* pcchValueBuf is NULL */
11346 lstrcpyA(val
, "apple");
11347 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, NULL
);
11348 ok(r
== ERROR_INVALID_PARAMETER
,
11349 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11350 ok(!lstrcmpA(val
, "apple"),
11351 "Expected val to be unchanged, got \"%s\"\n", val
);
11352 ok(size
== lstrlenA(prodcode
),
11353 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11355 /* pcchValueBuf is too small */
11357 lstrcpyA(val
, "apple");
11358 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11359 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11360 ok(!strncmp(val
, prodcode
, 3),
11361 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
11362 ok(size
== lstrlenA(prodcode
),
11363 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11365 /* pcchValueBuf does not leave room for NULL terminator */
11366 size
= lstrlenA(prodcode
);
11367 lstrcpyA(val
, "apple");
11368 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11369 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11370 ok(!strncmp(val
, prodcode
, lstrlenA(prodcode
) - 1),
11371 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
11372 ok(size
== lstrlenA(prodcode
),
11373 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11375 /* pcchValueBuf has enough room for NULL terminator */
11376 size
= lstrlenA(prodcode
) + 1;
11377 lstrcpyA(val
, "apple");
11378 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11379 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11380 ok(!lstrcmpA(val
, prodcode
),
11381 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
11382 ok(size
== lstrlenA(prodcode
),
11383 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11385 /* nonexistent property */
11387 lstrcpyA(val
, "apple");
11388 r
= MsiGetProductPropertyA(hprod
, "IDontExist", val
, &size
);
11389 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11390 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
11391 ok(size
== 0, "Expected 0, got %d\n", size
);
11393 r
= MsiSetPropertyA(hprod
, "NewProperty", "value");
11394 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11396 /* non-product property set */
11398 lstrcpyA(val
, "apple");
11399 r
= MsiGetProductPropertyA(hprod
, "NewProperty", val
, &size
);
11400 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11401 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
11402 ok(size
== 0, "Expected 0, got %d\n", size
);
11404 r
= MsiSetPropertyA(hprod
, "ProductCode", "value");
11405 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11407 /* non-product property that is also a product property set */
11409 lstrcpyA(val
, "apple");
11410 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11411 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11412 ok(!lstrcmpA(val
, prodcode
),
11413 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
11414 ok(size
== lstrlenA(prodcode
),
11415 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11417 MsiCloseHandle(hprod
);
11419 RegDeleteValueA(props
, "LocalPackage");
11420 RegDeleteKeyA(props
, "");
11421 RegCloseKey(props
);
11422 RegDeleteKeyA(userkey
, "");
11423 RegCloseKey(userkey
);
11424 RegDeleteKeyA(prodkey
, "");
11425 RegCloseKey(prodkey
);
11426 DeleteFileA(msifile
);
11429 static void test_MsiSetProperty(void)
11431 MSIHANDLE hpkg
, hdb
, hrec
;
11432 CHAR buf
[MAX_PATH
];
11437 hpkg
= package_from_db(create_package_db());
11438 ok(hpkg
!= 0, "Expected a valid package\n");
11440 /* invalid hInstall */
11441 r
= MsiSetPropertyA(0, "Prop", "Val");
11442 ok(r
== ERROR_INVALID_HANDLE
,
11443 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
11445 /* invalid hInstall */
11446 r
= MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
11447 ok(r
== ERROR_INVALID_HANDLE
,
11448 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
11450 /* szName is NULL */
11451 r
= MsiSetPropertyA(hpkg
, NULL
, "Val");
11452 ok(r
== ERROR_INVALID_PARAMETER
,
11453 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11455 /* both szName and szValue are NULL */
11456 r
= MsiSetPropertyA(hpkg
, NULL
, NULL
);
11457 ok(r
== ERROR_INVALID_PARAMETER
,
11458 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11460 /* szName is empty */
11461 r
= MsiSetPropertyA(hpkg
, "", "Val");
11462 ok(r
== ERROR_FUNCTION_FAILED
,
11463 "Expected ERROR_FUNCTION_FAILED, got %d\n", r
);
11465 /* szName is empty and szValue is NULL */
11466 r
= MsiSetPropertyA(hpkg
, "", NULL
);
11467 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11469 /* set a property */
11470 r
= MsiSetPropertyA(hpkg
, "Prop", "Val");
11471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11473 /* get the property */
11475 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
11476 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11477 ok(!lstrcmpA(buf
, "Val"), "Expected \"Val\", got \"%s\"\n", buf
);
11478 ok(size
== 3, "Expected 3, got %d\n", size
);
11480 /* update the property */
11481 r
= MsiSetPropertyA(hpkg
, "Prop", "Nuvo");
11482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11484 /* get the property */
11486 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
11487 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11488 ok(!lstrcmpA(buf
, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf
);
11489 ok(size
== 4, "Expected 4, got %d\n", size
);
11491 hdb
= MsiGetActiveDatabase(hpkg
);
11492 ok(hdb
!= 0, "Expected a valid database handle\n");
11494 /* set prop is not in the _Property table */
11495 query
= "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
11496 r
= do_query(hdb
, query
, &hrec
);
11497 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
11498 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
11500 /* set prop is not in the Property table */
11501 query
= "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
11502 r
= do_query(hdb
, query
, &hrec
);
11503 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
11504 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
11506 MsiCloseHandle(hdb
);
11508 /* szValue is an empty string */
11509 r
= MsiSetPropertyA(hpkg
, "Prop", "");
11510 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11512 /* try to get the property */
11514 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
11515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11516 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
11517 ok(size
== 0, "Expected 0, got %d\n", size
);
11519 /* reset the property */
11520 r
= MsiSetPropertyA(hpkg
, "Prop", "BlueTap");
11521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11523 /* delete the property */
11524 r
= MsiSetPropertyA(hpkg
, "Prop", NULL
);
11525 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11527 /* try to get the property */
11529 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
11530 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11531 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
11532 ok(size
== 0, "Expected 0, got %d\n", size
);
11534 MsiCloseHandle(hpkg
);
11535 DeleteFileA(msifile
);
11538 static void test_MsiApplyMultiplePatches(void)
11540 UINT r
, type
= GetDriveType(NULL
);
11542 if (!pMsiApplyMultiplePatchesA
) {
11543 win_skip("MsiApplyMultiplePatchesA not found\n");
11547 r
= pMsiApplyMultiplePatchesA(NULL
, NULL
, NULL
);
11548 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
11550 r
= pMsiApplyMultiplePatchesA("", NULL
, NULL
);
11551 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
11553 r
= pMsiApplyMultiplePatchesA(";", NULL
, NULL
);
11556 if (type
== DRIVE_FIXED
)
11557 ok(r
== ERROR_PATH_NOT_FOUND
,
11558 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
11560 ok(r
== ERROR_INVALID_NAME
,
11561 "Expected ERROR_INVALID_NAME, got %u\n", r
);
11564 r
= pMsiApplyMultiplePatchesA(" ;", NULL
, NULL
);
11567 if (type
== DRIVE_FIXED
)
11568 ok(r
== ERROR_PATCH_PACKAGE_OPEN_FAILED
,
11569 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r
);
11571 ok(r
== ERROR_INVALID_NAME
,
11572 "Expected ERROR_INVALID_NAME, got %u\n", r
);
11575 r
= pMsiApplyMultiplePatchesA(";;", NULL
, NULL
);
11578 if (type
== DRIVE_FIXED
)
11579 ok(r
== ERROR_PATH_NOT_FOUND
,
11580 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
11582 ok(r
== ERROR_INVALID_NAME
,
11583 "Expected ERROR_INVALID_NAME, got %u\n", r
);
11586 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL
, NULL
);
11587 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
11589 r
= pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL
, NULL
);
11592 if (type
== DRIVE_FIXED
)
11593 ok(r
== ERROR_PATH_NOT_FOUND
,
11594 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
11596 ok(r
== ERROR_INVALID_NAME
,
11597 "Expected ERROR_INVALID_NAME, got %u\n", r
);
11600 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL
, NULL
);
11601 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
11603 r
= pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL
, NULL
);
11604 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
11607 static void test_MsiApplyPatch(void)
11611 r
= MsiApplyPatch(NULL
, NULL
, INSTALLTYPE_DEFAULT
, NULL
);
11612 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
11614 r
= MsiApplyPatch("", NULL
, INSTALLTYPE_DEFAULT
, NULL
);
11615 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
11618 START_TEST(package
)
11620 HMODULE hmsi
= GetModuleHandleA("msi.dll");
11622 pMsiApplyMultiplePatchesA
= (void *)GetProcAddress(hmsi
, "MsiApplyMultiplePatchesA");
11624 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
11626 test_createpackage();
11628 test_gettargetpath_bad();
11629 test_settargetpath();
11631 test_property_table();
11634 test_formatrecord2();
11636 test_getproperty();
11637 test_removefiles();
11639 test_appsearch_complocator();
11640 test_appsearch_reglocator();
11641 test_appsearch_inilocator();
11642 test_appsearch_drlocator();
11643 test_featureparents();
11644 test_installprops();
11645 test_launchconditions();
11647 test_complocator();
11648 test_MsiGetSourcePath();
11649 test_shortlongsource();
11652 test_emptypackage();
11653 test_MsiGetProductProperty();
11654 test_MsiSetProperty();
11655 test_MsiApplyMultiplePatches();
11656 test_MsiApplyPatch();