2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <srrestoreptapi.h>
32 #include "wine/test.h"
35 static const char msifile
[] = "winetest-package.msi";
36 static char CURR_DIR
[MAX_PATH
];
38 static UINT (WINAPI
*pMsiApplyMultiplePatchesA
)(LPCSTR
, LPCSTR
, LPCSTR
);
39 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)(LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
40 static HRESULT (WINAPI
*pSHGetFolderPathA
)(HWND
, int, HANDLE
, DWORD
, LPSTR
);
42 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
43 static BOOL (WINAPI
*pGetTokenInformation
)( HANDLE
, TOKEN_INFORMATION_CLASS
, LPVOID
, DWORD
, PDWORD
);
44 static BOOL (WINAPI
*pOpenProcessToken
)( HANDLE
, DWORD
, PHANDLE
);
45 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
46 static LONG (WINAPI
*pRegDeleteKeyExW
)(HKEY
, LPCWSTR
, REGSAM
, DWORD
);
47 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
48 static void (WINAPI
*pGetSystemInfo
)(LPSYSTEM_INFO
);
49 static void (WINAPI
*pGetNativeSystemInfo
)(LPSYSTEM_INFO
);
50 static UINT (WINAPI
*pGetSystemWow64DirectoryA
)(LPSTR
, UINT
);
52 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
53 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
55 static void init_functionpointers(void)
57 HMODULE hmsi
= GetModuleHandleA("msi.dll");
58 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
59 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
60 HMODULE hshell32
= GetModuleHandleA("shell32.dll");
63 #define GET_PROC(mod, func) \
64 p ## func = (void*)GetProcAddress(mod, #func);
66 GET_PROC(hmsi
, MsiApplyMultiplePatchesA
);
67 GET_PROC(hmsi
, MsiGetComponentPathExA
);
68 GET_PROC(hshell32
, SHGetFolderPathA
);
70 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
71 GET_PROC(hadvapi32
, GetTokenInformation
);
72 GET_PROC(hadvapi32
, OpenProcessToken
);
73 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
74 GET_PROC(hadvapi32
, RegDeleteKeyExW
)
75 GET_PROC(hkernel32
, IsWow64Process
)
76 GET_PROC(hkernel32
, GetNativeSystemInfo
)
77 GET_PROC(hkernel32
, GetSystemInfo
)
78 GET_PROC(hkernel32
, GetSystemWow64DirectoryA
)
80 hsrclient
= LoadLibraryA("srclient.dll");
81 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
82 GET_PROC(hsrclient
, SRSetRestorePointA
);
86 static BOOL
is_process_limited(void)
90 if (!pOpenProcessToken
|| !pGetTokenInformation
) return FALSE
;
92 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
95 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
98 ret
= pGetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
100 return (ret
&& type
== TokenElevationTypeLimited
);
105 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
107 if (pRegDeleteKeyExA
)
108 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
109 return RegDeleteKeyA( key
, subkey
);
112 static char *get_user_sid(void)
117 char *usersid
= NULL
;
119 if (!pConvertSidToStringSidA
)
121 win_skip("ConvertSidToStringSidA is not available\n");
124 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
125 GetTokenInformation(token
, TokenUser
, NULL
, size
, &size
);
127 user
= HeapAlloc(GetProcessHeap(), 0, size
);
128 GetTokenInformation(token
, TokenUser
, user
, size
, &size
);
129 pConvertSidToStringSidA(user
->User
.Sid
, &usersid
);
130 HeapFree(GetProcessHeap(), 0, user
);
136 /* RegDeleteTreeW from dlls/advapi32/registry.c */
137 static LSTATUS
package_RegDeleteTreeW(HKEY hKey
, LPCWSTR lpszSubKey
, REGSAM access
)
140 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
141 DWORD dwMaxLen
, dwSize
;
142 WCHAR szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
147 ret
= RegOpenKeyExW(hKey
, lpszSubKey
, 0, access
, &hSubKey
);
151 ret
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, NULL
,
152 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
153 if (ret
) goto cleanup
;
157 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
158 if (dwMaxLen
> sizeof(szNameBuf
)/sizeof(WCHAR
))
160 /* Name too big: alloc a buffer for it */
161 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
*sizeof(WCHAR
))))
163 ret
= ERROR_NOT_ENOUGH_MEMORY
;
168 /* Recursively delete all the subkeys */
172 if (RegEnumKeyExW(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
173 NULL
, NULL
, NULL
)) break;
175 ret
= package_RegDeleteTreeW(hSubKey
, lpszName
, access
);
176 if (ret
) goto cleanup
;
181 if (pRegDeleteKeyExW
)
182 ret
= pRegDeleteKeyExW(hKey
, lpszSubKey
, access
, 0);
184 ret
= RegDeleteKeyW(hKey
, lpszSubKey
);
190 if (RegEnumValueW(hKey
, 0, lpszName
, &dwSize
,
191 NULL
, NULL
, NULL
, NULL
)) break;
193 ret
= RegDeleteValueW(hKey
, lpszName
);
194 if (ret
) goto cleanup
;
198 if (lpszName
!= szNameBuf
)
199 HeapFree(GetProcessHeap(), 0, lpszName
);
201 RegCloseKey(hSubKey
);
205 static BOOL
squash_guid(LPCWSTR in
, LPWSTR out
)
210 if (FAILED(CLSIDFromString((LPCOLESTR
)in
, &guid
)))
224 out
[17+i
*2] = in
[n
++];
225 out
[16+i
*2] = in
[n
++];
230 out
[17+i
*2] = in
[n
++];
231 out
[16+i
*2] = in
[n
++];
237 static void create_test_guid(LPSTR prodcode
, LPSTR squashed
)
239 WCHAR guidW
[MAX_PATH
];
240 WCHAR squashedW
[MAX_PATH
];
245 hr
= CoCreateGuid(&guid
);
246 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
248 size
= StringFromGUID2(&guid
, guidW
, MAX_PATH
);
249 ok(size
== 39, "Expected 39, got %d\n", hr
);
251 WideCharToMultiByte(CP_ACP
, 0, guidW
, size
, prodcode
, MAX_PATH
, NULL
, NULL
);
252 squash_guid(guidW
, squashedW
);
253 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
256 static void set_component_path(LPCSTR filename
, MSIINSTALLCONTEXT context
,
257 LPCSTR guid
, LPSTR usersid
, BOOL dir
)
259 WCHAR guidW
[MAX_PATH
];
260 WCHAR squashedW
[MAX_PATH
];
261 CHAR squashed
[MAX_PATH
];
262 CHAR comppath
[MAX_PATH
];
263 CHAR prodpath
[MAX_PATH
];
267 REGSAM access
= KEY_ALL_ACCESS
;
270 access
|= KEY_WOW64_64KEY
;
272 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
273 squash_guid(guidW
, squashedW
);
274 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
276 if (context
== MSIINSTALLCONTEXT_MACHINE
)
278 prod
= "3D0DAE300FACA1300AD792060BCDAA92";
280 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
281 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
283 "SOFTWARE\\Classes\\Installer\\"
284 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
286 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
288 prod
= "7D2F387510109040002000060BECB6AB";
290 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
291 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
293 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
294 "Installer\\%s\\Installer\\Products\\"
295 "7D2F387510109040002000060BECB6AB", usersid
);
297 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
299 prod
= "7D2F387510109040002000060BECB6AB";
301 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
302 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
304 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
305 "Installer\\Managed\\%s\\Installer\\Products\\"
306 "7D2F387510109040002000060BECB6AB", usersid
);
309 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, comppath
, 0, NULL
, 0, access
, NULL
, &hkey
, NULL
);
311 lstrcpyA(path
, CURR_DIR
);
312 lstrcatA(path
, "\\");
313 if (!dir
) lstrcatA(path
, filename
);
315 RegSetValueExA(hkey
, prod
, 0, REG_SZ
, (LPBYTE
)path
, lstrlenA(path
));
318 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, prodpath
, 0, NULL
, 0, access
, NULL
, &hkey
, NULL
);
322 static void delete_component_path(LPCSTR guid
, MSIINSTALLCONTEXT context
, LPSTR usersid
)
324 WCHAR guidW
[MAX_PATH
];
325 WCHAR squashedW
[MAX_PATH
];
326 WCHAR substrW
[MAX_PATH
];
327 CHAR squashed
[MAX_PATH
];
328 CHAR comppath
[MAX_PATH
];
329 CHAR prodpath
[MAX_PATH
];
330 REGSAM access
= KEY_ALL_ACCESS
;
333 access
|= KEY_WOW64_64KEY
;
335 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
336 squash_guid(guidW
, squashedW
);
337 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
339 if (context
== MSIINSTALLCONTEXT_MACHINE
)
342 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
343 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
345 "SOFTWARE\\Classes\\Installer\\"
346 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
348 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
351 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
352 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
354 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
355 "Installer\\%s\\Installer\\Products\\"
356 "7D2F387510109040002000060BECB6AB", usersid
);
358 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
361 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
362 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
364 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
365 "Installer\\Managed\\%s\\Installer\\Products\\"
366 "7D2F387510109040002000060BECB6AB", usersid
);
369 MultiByteToWideChar(CP_ACP
, 0, comppath
, -1, substrW
, MAX_PATH
);
370 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
, access
);
372 MultiByteToWideChar(CP_ACP
, 0, prodpath
, -1, substrW
, MAX_PATH
);
373 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
, access
);
376 static UINT
do_query(MSIHANDLE hdb
, const char *query
, MSIHANDLE
*phrec
)
381 /* open a select query */
382 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
383 if (r
!= ERROR_SUCCESS
)
385 r
= MsiViewExecute(hview
, 0);
386 if (r
!= ERROR_SUCCESS
)
388 ret
= MsiViewFetch(hview
, phrec
);
389 r
= MsiViewClose(hview
);
390 if (r
!= ERROR_SUCCESS
)
392 r
= MsiCloseHandle(hview
);
393 if (r
!= ERROR_SUCCESS
)
398 static UINT
run_query( MSIHANDLE hdb
, const char *query
)
403 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
404 if( r
!= ERROR_SUCCESS
)
407 r
= MsiViewExecute(hview
, 0);
408 if( r
== ERROR_SUCCESS
)
409 r
= MsiViewClose(hview
);
410 MsiCloseHandle(hview
);
414 static UINT
create_component_table( MSIHANDLE hdb
)
416 return run_query( hdb
,
417 "CREATE TABLE `Component` ( "
418 "`Component` CHAR(72) NOT NULL, "
419 "`ComponentId` CHAR(38), "
420 "`Directory_` CHAR(72) NOT NULL, "
421 "`Attributes` SHORT NOT NULL, "
422 "`Condition` CHAR(255), "
423 "`KeyPath` CHAR(72) "
424 "PRIMARY KEY `Component`)" );
427 static UINT
create_feature_table( MSIHANDLE hdb
)
429 return run_query( hdb
,
430 "CREATE TABLE `Feature` ( "
431 "`Feature` CHAR(38) NOT NULL, "
432 "`Feature_Parent` CHAR(38), "
434 "`Description` CHAR(255), "
435 "`Display` SHORT NOT NULL, "
436 "`Level` SHORT NOT NULL, "
437 "`Directory_` CHAR(72), "
438 "`Attributes` SHORT NOT NULL "
439 "PRIMARY KEY `Feature`)" );
442 static UINT
create_feature_components_table( MSIHANDLE hdb
)
444 return run_query( hdb
,
445 "CREATE TABLE `FeatureComponents` ( "
446 "`Feature_` CHAR(38) NOT NULL, "
447 "`Component_` CHAR(72) NOT NULL "
448 "PRIMARY KEY `Feature_`, `Component_` )" );
451 static UINT
create_file_table( MSIHANDLE hdb
)
453 return run_query( hdb
,
454 "CREATE TABLE `File` ("
455 "`File` CHAR(72) NOT NULL, "
456 "`Component_` CHAR(72) NOT NULL, "
457 "`FileName` CHAR(255) NOT NULL, "
458 "`FileSize` LONG NOT NULL, "
459 "`Version` CHAR(72), "
460 "`Language` CHAR(20), "
461 "`Attributes` SHORT, "
462 "`Sequence` SHORT NOT NULL "
463 "PRIMARY KEY `File`)" );
466 static UINT
create_remove_file_table( MSIHANDLE hdb
)
468 return run_query( hdb
,
469 "CREATE TABLE `RemoveFile` ("
470 "`FileKey` CHAR(72) NOT NULL, "
471 "`Component_` CHAR(72) NOT NULL, "
472 "`FileName` CHAR(255) LOCALIZABLE, "
473 "`DirProperty` CHAR(72) NOT NULL, "
474 "`InstallMode` SHORT NOT NULL "
475 "PRIMARY KEY `FileKey`)" );
478 static UINT
create_appsearch_table( MSIHANDLE hdb
)
480 return run_query( hdb
,
481 "CREATE TABLE `AppSearch` ("
482 "`Property` CHAR(72) NOT NULL, "
483 "`Signature_` CHAR(72) NOT NULL "
484 "PRIMARY KEY `Property`, `Signature_`)" );
487 static UINT
create_reglocator_table( MSIHANDLE hdb
)
489 return run_query( hdb
,
490 "CREATE TABLE `RegLocator` ("
491 "`Signature_` CHAR(72) NOT NULL, "
492 "`Root` SHORT NOT NULL, "
493 "`Key` CHAR(255) NOT NULL, "
496 "PRIMARY KEY `Signature_`)" );
499 static UINT
create_signature_table( MSIHANDLE hdb
)
501 return run_query( hdb
,
502 "CREATE TABLE `Signature` ("
503 "`Signature` CHAR(72) NOT NULL, "
504 "`FileName` CHAR(255) NOT NULL, "
505 "`MinVersion` CHAR(20), "
506 "`MaxVersion` CHAR(20), "
511 "`Languages` CHAR(255) "
512 "PRIMARY KEY `Signature`)" );
515 static UINT
create_launchcondition_table( MSIHANDLE hdb
)
517 return run_query( hdb
,
518 "CREATE TABLE `LaunchCondition` ("
519 "`Condition` CHAR(255) NOT NULL, "
520 "`Description` CHAR(255) NOT NULL "
521 "PRIMARY KEY `Condition`)" );
524 static UINT
create_property_table( MSIHANDLE hdb
)
526 return run_query( hdb
,
527 "CREATE TABLE `Property` ("
528 "`Property` CHAR(72) NOT NULL, "
530 "PRIMARY KEY `Property`)" );
533 static UINT
create_install_execute_sequence_table( MSIHANDLE hdb
)
535 return run_query( hdb
,
536 "CREATE TABLE `InstallExecuteSequence` ("
537 "`Action` CHAR(72) NOT NULL, "
538 "`Condition` CHAR(255), "
540 "PRIMARY KEY `Action`)" );
543 static UINT
create_media_table( MSIHANDLE hdb
)
545 return run_query( hdb
,
546 "CREATE TABLE `Media` ("
547 "`DiskId` SHORT NOT NULL, "
548 "`LastSequence` SHORT NOT NULL, "
549 "`DiskPrompt` CHAR(64), "
550 "`Cabinet` CHAR(255), "
551 "`VolumeLabel` CHAR(32), "
553 "PRIMARY KEY `DiskId`)" );
556 static UINT
create_ccpsearch_table( MSIHANDLE hdb
)
558 return run_query( hdb
,
559 "CREATE TABLE `CCPSearch` ("
560 "`Signature_` CHAR(72) NOT NULL "
561 "PRIMARY KEY `Signature_`)" );
564 static UINT
create_drlocator_table( MSIHANDLE hdb
)
566 return run_query( hdb
,
567 "CREATE TABLE `DrLocator` ("
568 "`Signature_` CHAR(72) NOT NULL, "
569 "`Parent` CHAR(72), "
572 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
575 static UINT
create_complocator_table( MSIHANDLE hdb
)
577 return run_query( hdb
,
578 "CREATE TABLE `CompLocator` ("
579 "`Signature_` CHAR(72) NOT NULL, "
580 "`ComponentId` CHAR(38) NOT NULL, "
582 "PRIMARY KEY `Signature_`)" );
585 static UINT
create_inilocator_table( MSIHANDLE hdb
)
587 return run_query( hdb
,
588 "CREATE TABLE `IniLocator` ("
589 "`Signature_` CHAR(72) NOT NULL, "
590 "`FileName` CHAR(255) NOT NULL, "
591 "`Section` CHAR(96)NOT NULL, "
592 "`Key` CHAR(128)NOT NULL, "
595 "PRIMARY KEY `Signature_`)" );
598 #define make_add_entry(type, qtext) \
599 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
601 char insert[] = qtext; \
604 sz = strlen(values) + sizeof insert; \
605 query = HeapAlloc(GetProcessHeap(),0,sz); \
606 sprintf(query,insert,values); \
607 r = run_query( hdb, query ); \
608 HeapFree(GetProcessHeap(), 0, query); \
612 make_add_entry(component
,
613 "INSERT INTO `Component` "
614 "(`Component`, `ComponentId`, `Directory_`, "
615 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
617 make_add_entry(directory
,
618 "INSERT INTO `Directory` "
619 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
621 make_add_entry(feature
,
622 "INSERT INTO `Feature` "
623 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
624 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
626 make_add_entry(feature_components
,
627 "INSERT INTO `FeatureComponents` "
628 "(`Feature_`, `Component_`) VALUES( %s )")
631 "INSERT INTO `File` "
632 "(`File`, `Component_`, `FileName`, `FileSize`, "
633 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
635 make_add_entry(appsearch
,
636 "INSERT INTO `AppSearch` "
637 "(`Property`, `Signature_`) VALUES( %s )")
639 make_add_entry(signature
,
640 "INSERT INTO `Signature` "
641 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
642 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
645 make_add_entry(launchcondition
,
646 "INSERT INTO `LaunchCondition` "
647 "(`Condition`, `Description`) VALUES( %s )")
649 make_add_entry(property
,
650 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
652 make_add_entry(install_execute_sequence
,
653 "INSERT INTO `InstallExecuteSequence` "
654 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
656 make_add_entry(media
,
657 "INSERT INTO `Media` "
658 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
659 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
661 make_add_entry(ccpsearch
,
662 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
664 make_add_entry(drlocator
,
665 "INSERT INTO `DrLocator` "
666 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
668 make_add_entry(complocator
,
669 "INSERT INTO `CompLocator` "
670 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
672 make_add_entry(inilocator
,
673 "INSERT INTO `IniLocator` "
674 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
677 static UINT
add_reglocator_entry( MSIHANDLE hdb
, const char *sig
, UINT root
, const char *path
,
678 const char *name
, UINT type
)
680 const char insert
[] =
681 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
682 "VALUES( '%s', %u, '%s', '%s', %u )";
686 sz
= strlen( sig
) + 10 + strlen( path
) + strlen( name
) + 10 + sizeof( insert
);
687 query
= HeapAlloc( GetProcessHeap(), 0, sz
);
688 sprintf( query
, insert
, sig
, root
, path
, name
, type
);
689 r
= run_query( hdb
, query
);
690 HeapFree( GetProcessHeap(), 0, query
);
694 static UINT
set_summary_info(MSIHANDLE hdb
)
699 /* build summary info */
700 res
= MsiGetSummaryInformation(hdb
, NULL
, 7, &suminfo
);
701 ok( res
== ERROR_SUCCESS
, "Failed to open summaryinfo\n" );
703 res
= MsiSummaryInfoSetProperty(suminfo
,2, VT_LPSTR
, 0,NULL
,
704 "Installation Database");
705 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
707 res
= MsiSummaryInfoSetProperty(suminfo
,3, VT_LPSTR
, 0,NULL
,
708 "Installation Database");
709 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
711 res
= MsiSummaryInfoSetProperty(suminfo
,4, VT_LPSTR
, 0,NULL
,
713 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
715 res
= MsiSummaryInfoSetProperty(suminfo
,7, VT_LPSTR
, 0,NULL
,
717 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
719 res
= MsiSummaryInfoSetProperty(suminfo
,9, VT_LPSTR
, 0,NULL
,
720 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
721 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
723 res
= MsiSummaryInfoSetProperty(suminfo
, 14, VT_I4
, 100, NULL
, NULL
);
724 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
726 res
= MsiSummaryInfoSetProperty(suminfo
, 15, VT_I4
, 0, NULL
, NULL
);
727 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
729 res
= MsiSummaryInfoPersist(suminfo
);
730 ok( res
== ERROR_SUCCESS
, "Failed to make summary info persist\n" );
732 res
= MsiCloseHandle( suminfo
);
733 ok( res
== ERROR_SUCCESS
, "Failed to close suminfo\n" );
739 static MSIHANDLE
create_package_db(void)
746 /* create an empty database */
747 res
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
748 ok( res
== ERROR_SUCCESS
, "Failed to create database %u\n", res
);
749 if( res
!= ERROR_SUCCESS
)
752 res
= MsiDatabaseCommit( hdb
);
753 ok( res
== ERROR_SUCCESS
, "Failed to commit database\n" );
755 res
= set_summary_info(hdb
);
756 ok( res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", res
);
758 res
= run_query( hdb
,
759 "CREATE TABLE `Directory` ( "
760 "`Directory` CHAR(255) NOT NULL, "
761 "`Directory_Parent` CHAR(255), "
762 "`DefaultDir` CHAR(255) NOT NULL "
763 "PRIMARY KEY `Directory`)" );
764 ok( res
== ERROR_SUCCESS
, "Failed to create directory table\n" );
769 static UINT
package_from_db(MSIHANDLE hdb
, MSIHANDLE
*handle
)
775 sprintf(szPackage
, "#%u", hdb
);
776 res
= MsiOpenPackage(szPackage
, &hPackage
);
777 if (res
!= ERROR_SUCCESS
)
783 res
= MsiCloseHandle(hdb
);
784 if (res
!= ERROR_SUCCESS
)
786 MsiCloseHandle(hPackage
);
791 return ERROR_SUCCESS
;
794 static void create_test_file(const CHAR
*name
)
799 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
800 ok(file
!= INVALID_HANDLE_VALUE
, "Failure to open file %s\n", name
);
801 WriteFile(file
, name
, strlen(name
), &written
, NULL
);
802 WriteFile(file
, "\n", strlen("\n"), &written
, NULL
);
806 typedef struct _tagVS_VERSIONINFO
813 VS_FIXEDFILEINFO Value
;
818 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
819 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
821 static BOOL
create_file_with_version(const CHAR
*name
, LONG ms
, LONG ls
)
823 VS_VERSIONINFO
*pVerInfo
;
824 VS_FIXEDFILEINFO
*pFixedInfo
;
831 GetSystemDirectory(path
, MAX_PATH
);
832 /* Some dlls can't be updated on Vista/W2K8 */
833 lstrcatA(path
, "\\version.dll");
835 CopyFileA(path
, name
, FALSE
);
837 size
= GetFileVersionInfoSize(path
, &handle
);
838 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
840 GetFileVersionInfoA(path
, 0, size
, buffer
);
842 pVerInfo
= (VS_VERSIONINFO
*)buffer
;
843 ofs
= (BYTE
*)&pVerInfo
->szKey
[lstrlenW(pVerInfo
->szKey
) + 1];
844 pFixedInfo
= (VS_FIXEDFILEINFO
*)roundpos(pVerInfo
, ofs
, 4);
846 pFixedInfo
->dwFileVersionMS
= ms
;
847 pFixedInfo
->dwFileVersionLS
= ls
;
848 pFixedInfo
->dwProductVersionMS
= ms
;
849 pFixedInfo
->dwProductVersionLS
= ls
;
851 resource
= BeginUpdateResource(name
, FALSE
);
855 if (!UpdateResource(resource
, RT_VERSION
, MAKEINTRESOURCE(VS_VERSION_INFO
),
856 MAKELANGID(LANG_NEUTRAL
, SUBLANG_NEUTRAL
), buffer
, size
))
859 if (!EndUpdateResource(resource
, FALSE
))
865 HeapFree(GetProcessHeap(), 0, buffer
);
869 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
871 RESTOREPOINTINFOA spec
;
873 spec
.dwEventType
= event_type
;
874 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
875 spec
.llSequenceNumber
= status
->llSequenceNumber
;
876 lstrcpyA(spec
.szDescription
, "msitest restore point");
878 return pSRSetRestorePointA(&spec
, status
);
881 static void remove_restore_point(DWORD seq_number
)
885 res
= pSRRemoveRestorePoint(seq_number
);
886 if (res
!= ERROR_SUCCESS
)
887 trace("Failed to remove the restore point : %08x\n", res
);
890 static void test_createpackage(void)
892 MSIHANDLE hPackage
= 0;
895 res
= package_from_db(create_package_db(), &hPackage
);
896 if (res
== ERROR_INSTALL_PACKAGE_REJECTED
)
898 skip("Not enough rights to perform tests\n");
902 ok( res
== ERROR_SUCCESS
, " Failed to create package %u\n", res
);
904 res
= MsiCloseHandle( hPackage
);
905 ok( res
== ERROR_SUCCESS
, "Failed to close package\n" );
909 static void test_doaction( void )
914 r
= MsiDoAction( -1, NULL
);
915 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
917 r
= package_from_db(create_package_db(), &hpkg
);
918 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
920 skip("Not enough rights to perform tests\n");
924 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
926 r
= MsiDoAction(hpkg
, NULL
);
927 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
929 r
= MsiDoAction(0, "boo");
930 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
932 r
= MsiDoAction(hpkg
, "boo");
933 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "wrong return val\n");
935 MsiCloseHandle( hpkg
);
939 static void test_gettargetpath_bad(void)
941 static const WCHAR boo
[] = {'b','o','o',0};
942 static const WCHAR empty
[] = {0};
949 r
= package_from_db(create_package_db(), &hpkg
);
950 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
952 skip("Not enough rights to perform tests\n");
956 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
958 r
= MsiGetTargetPath( 0, NULL
, NULL
, NULL
);
959 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
961 r
= MsiGetTargetPath( 0, NULL
, NULL
, &sz
);
962 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
964 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
965 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
967 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
968 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
970 r
= MsiGetTargetPath( hpkg
, "boo", NULL
, NULL
);
971 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
973 r
= MsiGetTargetPath( hpkg
, "boo", buffer
, NULL
);
974 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
977 r
= MsiGetTargetPath( hpkg
, "", buffer
, &sz
);
978 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
980 r
= MsiGetTargetPathW( 0, NULL
, NULL
, NULL
);
981 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
983 r
= MsiGetTargetPathW( 0, NULL
, NULL
, &sz
);
984 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
986 r
= MsiGetTargetPathW( 0, boo
, NULL
, NULL
);
987 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
989 r
= MsiGetTargetPathW( 0, boo
, NULL
, NULL
);
990 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
992 r
= MsiGetTargetPathW( hpkg
, boo
, NULL
, NULL
);
993 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
995 r
= MsiGetTargetPathW( hpkg
, boo
, bufferW
, NULL
);
996 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
999 r
= MsiGetTargetPathW( hpkg
, empty
, bufferW
, &sz
);
1000 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
1002 MsiCloseHandle( hpkg
);
1003 DeleteFile(msifile
);
1006 static void query_file_path(MSIHANDLE hpkg
, LPCSTR file
, LPSTR buff
)
1012 rec
= MsiCreateRecord( 1 );
1013 ok(rec
, "MsiCreate record failed\n");
1015 r
= MsiRecordSetString( rec
, 0, file
);
1016 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1019 r
= MsiFormatRecord( hpkg
, rec
, buff
, &size
);
1020 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1022 MsiCloseHandle( rec
);
1025 static void test_settargetpath(void)
1027 char tempdir
[MAX_PATH
+8], buffer
[MAX_PATH
], file
[MAX_PATH
];
1033 hdb
= create_package_db();
1034 ok ( hdb
, "failed to create package database\n" );
1036 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
1037 ok( r
== S_OK
, "failed to add directory entry: %d\n" , r
);
1039 r
= create_component_table( hdb
);
1040 ok( r
== S_OK
, "cannot create Component table: %d\n", r
);
1042 r
= add_component_entry( hdb
, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1043 ok( r
== S_OK
, "cannot add dummy component: %d\n", r
);
1045 r
= add_component_entry( hdb
, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1046 ok( r
== S_OK
, "cannot add test component: %d\n", r
);
1048 r
= create_feature_table( hdb
);
1049 ok( r
== S_OK
, "cannot create Feature table: %d\n", r
);
1051 r
= add_feature_entry( hdb
, "'TestFeature', '', '', '', 0, 1, '', 0" );
1052 ok( r
== ERROR_SUCCESS
, "cannot add TestFeature to Feature table: %d\n", r
);
1054 r
= create_feature_components_table( hdb
);
1055 ok( r
== S_OK
, "cannot create FeatureComponents table: %d\n", r
);
1057 r
= add_feature_components_entry( hdb
, "'TestFeature', 'RootComp'" );
1058 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
1060 r
= add_feature_components_entry( hdb
, "'TestFeature', 'TestComp'" );
1061 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
1063 add_directory_entry( hdb
, "'TestParent', 'TARGETDIR', 'TestParent'" );
1064 add_directory_entry( hdb
, "'TestDir', 'TestParent', 'TestDir'" );
1066 r
= create_file_table( hdb
);
1067 ok( r
== S_OK
, "cannot create File table: %d\n", r
);
1069 r
= add_file_entry( hdb
, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1070 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
1072 r
= add_file_entry( hdb
, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1073 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
1075 r
= package_from_db( hdb
, &hpkg
);
1076 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
1078 skip("Not enough rights to perform tests\n");
1079 DeleteFile(msifile
);
1082 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
1084 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
1086 r
= MsiDoAction( hpkg
, "CostInitialize");
1087 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
1089 r
= MsiDoAction( hpkg
, "FileCost");
1090 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
1092 r
= MsiDoAction( hpkg
, "CostFinalize");
1093 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
1095 r
= MsiSetTargetPath( 0, NULL
, NULL
);
1096 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1098 r
= MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1099 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1101 r
= MsiSetTargetPath( hpkg
, "boo", NULL
);
1102 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1104 r
= MsiSetTargetPath( hpkg
, "boo", "c:\\bogusx" );
1105 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
1107 sz
= sizeof tempdir
- 1;
1108 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", tempdir
, &sz
);
1109 sprintf( file
, "%srootfile.txt", tempdir
);
1111 query_file_path( hpkg
, "[#RootFile]", buffer
);
1112 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1113 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
1115 GetTempFileName( tempdir
, "_wt", 0, buffer
);
1116 sprintf( tempdir
, "%s\\subdir", buffer
);
1118 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
1119 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
1120 "MsiSetTargetPath on file returned %d\n", r
);
1122 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
1123 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
1124 "MsiSetTargetPath on 'subdir' of file returned %d\n", r
);
1126 DeleteFile( buffer
);
1128 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
1129 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1131 r
= GetFileAttributes( buffer
);
1132 ok ( r
== INVALID_FILE_ATTRIBUTES
, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r
);
1134 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
1135 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath on subsubdir returned %d\n", r
);
1138 sz
= sizeof buffer
- 1;
1139 lstrcat( tempdir
, "\\" );
1140 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", buffer
, &sz
);
1141 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1142 ok( !lstrcmp(buffer
, tempdir
), "Expected %s, got %s\n", tempdir
, buffer
);
1144 sprintf( file
, "%srootfile.txt", tempdir
);
1145 query_file_path( hpkg
, "[#RootFile]", buffer
);
1146 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
1149 sz
= sizeof(buffer
);
1150 r
= MsiGetPropertyA( hpkg
, "TestParent", buffer
, &sz
);
1151 ok( r
== ERROR_SUCCESS
, "MsiGetProperty returned %u\n", r
);
1152 lstrcatA( tempdir
, "TestParent\\" );
1153 ok( !lstrcmpi(buffer
, tempdir
), "Expected \"%s\", got \"%s\"\n", tempdir
, buffer
);
1155 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two" );
1156 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1159 sz
= sizeof(buffer
);
1160 r
= MsiGetPropertyA( hpkg
, "TestParent", buffer
, &sz
);
1161 ok( r
== ERROR_SUCCESS
, "MsiGetProperty returned %u\n", r
);
1162 ok( lstrcmpi(buffer
, "C:\\one\\two\\TestDir\\"),
1163 "Expected \"C:\\one\\two\\TestDir\\\", got \"%s\"\n", buffer
);
1166 query_file_path( hpkg
, "[#TestFile]", buffer
);
1167 ok( !lstrcmpi(buffer
, "C:\\one\\two\\TestDir\\testfile.txt"),
1168 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer
);
1171 sz
= sizeof buffer
- 1;
1172 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
1173 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1174 ok( !lstrcmpi(buffer
, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer
);
1176 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two\\three" );
1177 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1180 sz
= sizeof buffer
- 1;
1181 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
1182 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1183 ok( !lstrcmpi(buffer
, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer
);
1185 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\\\one\\\\two " );
1186 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1189 sz
= sizeof buffer
- 1;
1190 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
1191 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1192 ok( !lstrcmpi(buffer
, "C:\\one\\two\\"), "Expected \"C:\\one\\two\\\", got %s\n", buffer
);
1194 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\\\ Program Files \\\\ " );
1195 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
1198 sz
= sizeof buffer
- 1;
1199 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
1200 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
1201 ok( !lstrcmpi(buffer
, "C:\\Program Files\\"), "Expected \"C:\\Program Files\\\", got %s\n", buffer
);
1203 MsiCloseHandle( hpkg
);
1206 static void test_condition(void)
1208 static const WCHAR cond1
[] = {'\"','a',0x30a,'\"','<','\"',0xe5,'\"',0};
1209 static const WCHAR cond2
[] = {'\"','a',0x30a,'\"','>','\"',0xe5,'\"',0};
1210 static const WCHAR cond3
[] = {'\"','a',0x30a,'\"','<','>','\"',0xe5,'\"',0};
1211 static const WCHAR cond4
[] = {'\"','a',0x30a,'\"','=','\"',0xe5,'\"',0};
1215 r
= package_from_db(create_package_db(), &hpkg
);
1216 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
1218 skip("Not enough rights to perform tests\n");
1219 DeleteFile(msifile
);
1222 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
1224 r
= MsiEvaluateCondition(0, NULL
);
1225 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1227 r
= MsiEvaluateCondition(hpkg
, NULL
);
1228 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1230 r
= MsiEvaluateCondition(hpkg
, "");
1231 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1233 r
= MsiEvaluateCondition(hpkg
, "1");
1234 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1236 r
= MsiEvaluateCondition(hpkg
, "0");
1237 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1239 r
= MsiEvaluateCondition(hpkg
, "-1");
1240 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1242 r
= MsiEvaluateCondition(hpkg
, "0 = 0");
1243 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1245 r
= MsiEvaluateCondition(hpkg
, "0 <> 0");
1246 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1248 r
= MsiEvaluateCondition(hpkg
, "0 = 1");
1249 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1251 r
= MsiEvaluateCondition(hpkg
, "0 > 1");
1252 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1254 r
= MsiEvaluateCondition(hpkg
, "0 ~> 1");
1255 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1257 r
= MsiEvaluateCondition(hpkg
, "1 > 1");
1258 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1260 r
= MsiEvaluateCondition(hpkg
, "1 ~> 1");
1261 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1263 r
= MsiEvaluateCondition(hpkg
, "0 >= 1");
1264 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1266 r
= MsiEvaluateCondition(hpkg
, "0 ~>= 1");
1267 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1269 r
= MsiEvaluateCondition(hpkg
, "1 >= 1");
1270 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1272 r
= MsiEvaluateCondition(hpkg
, "1 ~>= 1");
1273 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1275 r
= MsiEvaluateCondition(hpkg
, "0 < 1");
1276 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1278 r
= MsiEvaluateCondition(hpkg
, "0 ~< 1");
1279 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1281 r
= MsiEvaluateCondition(hpkg
, "1 < 1");
1282 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1284 r
= MsiEvaluateCondition(hpkg
, "1 ~< 1");
1285 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1287 r
= MsiEvaluateCondition(hpkg
, "0 <= 1");
1288 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1290 r
= MsiEvaluateCondition(hpkg
, "0 ~<= 1");
1291 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1293 r
= MsiEvaluateCondition(hpkg
, "1 <= 1");
1294 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1296 r
= MsiEvaluateCondition(hpkg
, "1 ~<= 1");
1297 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1299 r
= MsiEvaluateCondition(hpkg
, "0 >=");
1300 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1302 r
= MsiEvaluateCondition(hpkg
, " ");
1303 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1305 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"1\"");
1306 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1308 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"0\"");
1309 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1311 r
= MsiEvaluateCondition(hpkg
, "LicView <> LicView");
1312 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1314 r
= MsiEvaluateCondition(hpkg
, "not 0");
1315 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1317 r
= MsiEvaluateCondition(hpkg
, "not LicView");
1318 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1320 r
= MsiEvaluateCondition(hpkg
, "\"Testing\" ~<< \"Testing\"");
1321 ok (r
== MSICONDITION_TRUE
, "wrong return val\n");
1323 r
= MsiEvaluateCondition(hpkg
, "LicView ~<< \"Testing\"");
1324 ok (r
== MSICONDITION_FALSE
, "wrong return val\n");
1326 r
= MsiEvaluateCondition(hpkg
, "Not LicView ~<< \"Testing\"");
1327 ok (r
== MSICONDITION_TRUE
, "wrong return val\n");
1329 r
= MsiEvaluateCondition(hpkg
, "not \"A\"");
1330 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1332 r
= MsiEvaluateCondition(hpkg
, "~not \"A\"");
1333 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1335 r
= MsiEvaluateCondition(hpkg
, "\"0\"");
1336 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1338 r
= MsiEvaluateCondition(hpkg
, "1 and 2");
1339 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1341 r
= MsiEvaluateCondition(hpkg
, "not 0 and 3");
1342 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1344 r
= MsiEvaluateCondition(hpkg
, "not 0 and 0");
1345 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1347 r
= MsiEvaluateCondition(hpkg
, "not 0 or 1");
1348 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1350 r
= MsiEvaluateCondition(hpkg
, "(0)");
1351 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1353 r
= MsiEvaluateCondition(hpkg
, "(((((1))))))");
1354 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1356 r
= MsiEvaluateCondition(hpkg
, "(((((1)))))");
1357 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1359 r
= MsiEvaluateCondition(hpkg
, " \"A\" < \"B\" ");
1360 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1362 r
= MsiEvaluateCondition(hpkg
, " \"A\" > \"B\" ");
1363 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1365 r
= MsiEvaluateCondition(hpkg
, " \"1\" > \"12\" ");
1366 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1368 r
= MsiEvaluateCondition(hpkg
, " \"100\" < \"21\" ");
1369 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1371 r
= MsiEvaluateCondition(hpkg
, "0 < > 0");
1372 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1374 r
= MsiEvaluateCondition(hpkg
, "(1<<1) == 2");
1375 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1377 r
= MsiEvaluateCondition(hpkg
, " \"A\" = \"a\" ");
1378 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1380 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~ = \"a\" ");
1381 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1383 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= \"a\" ");
1384 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1386 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= 1 ");
1387 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1389 r
= MsiEvaluateCondition(hpkg
, " \"A\" = 1 ");
1390 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1392 r
= MsiEvaluateCondition(hpkg
, " 1 ~= 1 ");
1393 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1395 r
= MsiEvaluateCondition(hpkg
, " 1 ~= \"1\" ");
1396 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1398 r
= MsiEvaluateCondition(hpkg
, " 1 = \"1\" ");
1399 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1401 r
= MsiEvaluateCondition(hpkg
, " 0 = \"1\" ");
1402 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1404 r
= MsiEvaluateCondition(hpkg
, " 0 < \"100\" ");
1405 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1407 r
= MsiEvaluateCondition(hpkg
, " 100 > \"0\" ");
1408 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1410 r
= MsiEvaluateCondition(hpkg
, "1 XOR 1");
1411 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1413 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1");
1414 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1416 r
= MsiEvaluateCondition(hpkg
, "1 IMP 0");
1417 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1419 r
= MsiEvaluateCondition(hpkg
, "0 IMP 0");
1420 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1422 r
= MsiEvaluateCondition(hpkg
, "0 EQV 0");
1423 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1425 r
= MsiEvaluateCondition(hpkg
, "0 EQV 1");
1426 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1428 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1 OR 0");
1429 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1431 r
= MsiEvaluateCondition(hpkg
, "1 IMPL 1");
1432 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1434 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" >< \"S\" ");
1435 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1437 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"s\" ");
1438 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1440 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"\" ");
1441 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1443 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"sss\" ");
1444 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1446 MsiSetProperty(hpkg
, "mm", "5" );
1448 r
= MsiEvaluateCondition(hpkg
, "mm = 5");
1449 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1451 r
= MsiEvaluateCondition(hpkg
, "mm < 6");
1452 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1454 r
= MsiEvaluateCondition(hpkg
, "mm <= 5");
1455 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1457 r
= MsiEvaluateCondition(hpkg
, "mm > 4");
1458 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1460 r
= MsiEvaluateCondition(hpkg
, "mm < 12");
1461 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1463 r
= MsiEvaluateCondition(hpkg
, "mm = \"5\"");
1464 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1466 r
= MsiEvaluateCondition(hpkg
, "0 = \"\"");
1467 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1469 r
= MsiEvaluateCondition(hpkg
, "0 AND \"\"");
1470 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1472 r
= MsiEvaluateCondition(hpkg
, "1 AND \"\"");
1473 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1475 r
= MsiEvaluateCondition(hpkg
, "1 AND \"1\"");
1476 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1478 r
= MsiEvaluateCondition(hpkg
, "3 >< 1");
1479 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1481 r
= MsiEvaluateCondition(hpkg
, "3 >< 4");
1482 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1484 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 0");
1485 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1487 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1");
1488 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1490 r
= MsiEvaluateCondition(hpkg
, "NOT 1 OR 0");
1491 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1493 r
= MsiEvaluateCondition(hpkg
, "0 AND 1 OR 1");
1494 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1496 r
= MsiEvaluateCondition(hpkg
, "0 AND 0 OR 1");
1497 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1499 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1 OR 0");
1500 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1502 r
= MsiEvaluateCondition(hpkg
, "_1 = _1");
1503 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1505 r
= MsiEvaluateCondition(hpkg
, "( 1 AND 1 ) = 2");
1506 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1508 r
= MsiEvaluateCondition(hpkg
, "NOT ( 1 AND 1 )");
1509 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1511 r
= MsiEvaluateCondition(hpkg
, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1512 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1514 r
= MsiEvaluateCondition(hpkg
, "Installed<>\"\"");
1515 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1517 r
= MsiEvaluateCondition(hpkg
, "NOT 1 AND 0");
1518 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1520 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1521 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1523 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1524 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1526 r
= MsiEvaluateCondition(hpkg
, "bandalmael<0");
1527 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1529 r
= MsiEvaluateCondition(hpkg
, "bandalmael>0");
1530 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1532 r
= MsiEvaluateCondition(hpkg
, "bandalmael>=0");
1533 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1535 r
= MsiEvaluateCondition(hpkg
, "bandalmael<=0");
1536 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1538 r
= MsiEvaluateCondition(hpkg
, "bandalmael~<>0");
1539 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1541 MsiSetProperty(hpkg
, "bandalmael", "0" );
1542 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1543 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1545 MsiSetProperty(hpkg
, "bandalmael", "" );
1546 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1547 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1549 MsiSetProperty(hpkg
, "bandalmael", "asdf" );
1550 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1551 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1553 MsiSetProperty(hpkg
, "bandalmael", "0asdf" );
1554 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1555 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1557 MsiSetProperty(hpkg
, "bandalmael", "0 " );
1558 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1559 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1561 MsiSetProperty(hpkg
, "bandalmael", "-0" );
1562 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1563 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1565 MsiSetProperty(hpkg
, "bandalmael", "0000000000000" );
1566 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1567 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1569 MsiSetProperty(hpkg
, "bandalmael", "--0" );
1570 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1571 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1573 MsiSetProperty(hpkg
, "bandalmael", "0x00" );
1574 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1575 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1577 MsiSetProperty(hpkg
, "bandalmael", "-" );
1578 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1579 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1581 MsiSetProperty(hpkg
, "bandalmael", "+0" );
1582 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1583 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1585 MsiSetProperty(hpkg
, "bandalmael", "0.0" );
1586 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1587 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1588 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1589 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1591 MsiSetProperty(hpkg
, "one", "hi");
1592 MsiSetProperty(hpkg
, "two", "hithere");
1593 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1594 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1596 MsiSetProperty(hpkg
, "one", "hithere");
1597 MsiSetProperty(hpkg
, "two", "hi");
1598 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1599 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1601 MsiSetProperty(hpkg
, "one", "hello");
1602 MsiSetProperty(hpkg
, "two", "hi");
1603 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1604 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1606 MsiSetProperty(hpkg
, "one", "hellohithere");
1607 MsiSetProperty(hpkg
, "two", "hi");
1608 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1609 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1611 MsiSetProperty(hpkg
, "one", "");
1612 MsiSetProperty(hpkg
, "two", "hi");
1613 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1614 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1616 MsiSetProperty(hpkg
, "one", "hi");
1617 MsiSetProperty(hpkg
, "two", "");
1618 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1619 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1621 MsiSetProperty(hpkg
, "one", "");
1622 MsiSetProperty(hpkg
, "two", "");
1623 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1624 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1626 MsiSetProperty(hpkg
, "one", "1234");
1627 MsiSetProperty(hpkg
, "two", "1");
1628 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1629 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1631 MsiSetProperty(hpkg
, "one", "one 1234");
1632 MsiSetProperty(hpkg
, "two", "1");
1633 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1634 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1636 MsiSetProperty(hpkg
, "one", "hithere");
1637 MsiSetProperty(hpkg
, "two", "hi");
1638 r
= MsiEvaluateCondition(hpkg
, "one << two");
1639 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1641 MsiSetProperty(hpkg
, "one", "hi");
1642 MsiSetProperty(hpkg
, "two", "hithere");
1643 r
= MsiEvaluateCondition(hpkg
, "one << two");
1644 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1646 MsiSetProperty(hpkg
, "one", "hi");
1647 MsiSetProperty(hpkg
, "two", "hi");
1648 r
= MsiEvaluateCondition(hpkg
, "one << two");
1649 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1651 MsiSetProperty(hpkg
, "one", "abcdhithere");
1652 MsiSetProperty(hpkg
, "two", "hi");
1653 r
= MsiEvaluateCondition(hpkg
, "one << two");
1654 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1656 MsiSetProperty(hpkg
, "one", "");
1657 MsiSetProperty(hpkg
, "two", "hi");
1658 r
= MsiEvaluateCondition(hpkg
, "one << two");
1659 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1661 MsiSetProperty(hpkg
, "one", "hithere");
1662 MsiSetProperty(hpkg
, "two", "");
1663 r
= MsiEvaluateCondition(hpkg
, "one << two");
1664 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1666 MsiSetProperty(hpkg
, "one", "");
1667 MsiSetProperty(hpkg
, "two", "");
1668 r
= MsiEvaluateCondition(hpkg
, "one << two");
1669 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1671 MsiSetProperty(hpkg
, "one", "1234");
1672 MsiSetProperty(hpkg
, "two", "1");
1673 r
= MsiEvaluateCondition(hpkg
, "one << two");
1674 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1676 MsiSetProperty(hpkg
, "one", "1234 one");
1677 MsiSetProperty(hpkg
, "two", "1");
1678 r
= MsiEvaluateCondition(hpkg
, "one << two");
1679 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1681 MsiSetProperty(hpkg
, "one", "hithere");
1682 MsiSetProperty(hpkg
, "two", "there");
1683 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1684 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1686 MsiSetProperty(hpkg
, "one", "hithere");
1687 MsiSetProperty(hpkg
, "two", "hi");
1688 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1689 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1691 MsiSetProperty(hpkg
, "one", "there");
1692 MsiSetProperty(hpkg
, "two", "hithere");
1693 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1694 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1696 MsiSetProperty(hpkg
, "one", "there");
1697 MsiSetProperty(hpkg
, "two", "there");
1698 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1699 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1701 MsiSetProperty(hpkg
, "one", "abcdhithere");
1702 MsiSetProperty(hpkg
, "two", "hi");
1703 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1704 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1706 MsiSetProperty(hpkg
, "one", "");
1707 MsiSetProperty(hpkg
, "two", "there");
1708 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1709 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1711 MsiSetProperty(hpkg
, "one", "there");
1712 MsiSetProperty(hpkg
, "two", "");
1713 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1714 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1716 MsiSetProperty(hpkg
, "one", "");
1717 MsiSetProperty(hpkg
, "two", "");
1718 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1719 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1721 MsiSetProperty(hpkg
, "one", "1234");
1722 MsiSetProperty(hpkg
, "two", "4");
1723 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1724 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1726 MsiSetProperty(hpkg
, "one", "one 1234");
1727 MsiSetProperty(hpkg
, "two", "4");
1728 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1729 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1731 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", NULL
); /* make sure it's empty */
1733 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1734 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1736 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport > \"1.1.4322\"");
1737 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1739 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport >= \"1.1.4322\"");
1740 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1742 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <= \"1.1.4322\"");
1743 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1745 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <> \"1.1.4322\"");
1746 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1748 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1749 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1751 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"abcd\"");
1752 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1754 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a1.1.4322\"");
1755 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1757 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322a\"");
1758 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1760 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1761 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1763 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1764 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1766 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1767 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1769 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1");
1770 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1772 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1\"");
1773 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1775 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"12.1\"");
1776 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1778 r
= MsiEvaluateCondition(hpkg
, "\"02.1\" < \"2.11\"");
1779 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1781 r
= MsiEvaluateCondition(hpkg
, "\"02.1.1\" < \"2.1\"");
1782 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1784 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1785 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1787 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1788 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1790 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0\"");
1791 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1793 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"-1\"");
1794 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1796 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a\"");
1797 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1799 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1800 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1802 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1803 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1805 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"/\"");
1806 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1808 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \" \"");
1809 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1811 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"azAZ_\"");
1812 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1814 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]\"");
1815 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1817 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]a\"");
1818 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1820 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]\"");
1821 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1823 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]a\"");
1824 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1826 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a}\"");
1827 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1829 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a\"");
1830 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1832 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a\"");
1833 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1835 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a{\"");
1836 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1838 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a]\"");
1839 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1841 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"A\"");
1842 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1844 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", "1.1.4322");
1845 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1846 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1848 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.14322\"");
1849 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1851 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.5\"");
1852 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1854 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1855 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1857 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1858 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1860 MsiSetProperty(hpkg
, "one", "1");
1861 r
= MsiEvaluateCondition(hpkg
, "one < \"1\"");
1862 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1864 MsiSetProperty(hpkg
, "X", "5.0");
1866 r
= MsiEvaluateCondition(hpkg
, "X != \"\"");
1867 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1869 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\"");
1870 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1872 r
= MsiEvaluateCondition(hpkg
, "X =\"5.1\"");
1873 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1875 r
= MsiEvaluateCondition(hpkg
, "X =\"6.0\"");
1876 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1878 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1879 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1881 r
= MsiEvaluateCondition(hpkg
, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1882 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1884 r
= MsiEvaluateCondition(hpkg
, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1885 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1887 /* feature doesn't exist */
1888 r
= MsiEvaluateCondition(hpkg
, "&nofeature");
1889 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1891 MsiSetProperty(hpkg
, "A", "2");
1892 MsiSetProperty(hpkg
, "X", "50");
1894 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1895 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1897 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1898 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1900 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1901 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1903 MsiSetProperty(hpkg
, "X", "50val");
1905 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1906 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1908 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1909 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1911 MsiSetProperty(hpkg
, "A", "7");
1912 MsiSetProperty(hpkg
, "X", "50");
1914 r
= MsiEvaluateCondition(hpkg
, "7 <= X");
1915 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1917 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1918 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1920 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1921 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1923 MsiSetProperty(hpkg
, "X", "50val");
1925 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1926 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1928 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1929 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1931 r
= MsiEvaluateConditionW(hpkg
, cond1
);
1932 ok( r
== MSICONDITION_TRUE
|| broken(r
== MSICONDITION_FALSE
),
1933 "wrong return val (%d)\n", r
);
1935 r
= MsiEvaluateConditionW(hpkg
, cond2
);
1936 ok( r
== MSICONDITION_FALSE
|| broken(r
== MSICONDITION_TRUE
),
1937 "wrong return val (%d)\n", r
);
1939 r
= MsiEvaluateConditionW(hpkg
, cond3
);
1940 ok( r
== MSICONDITION_TRUE
|| broken(r
== MSICONDITION_FALSE
),
1941 "wrong return val (%d)\n", r
);
1943 r
= MsiEvaluateConditionW(hpkg
, cond4
);
1944 ok( r
== MSICONDITION_FALSE
|| broken(r
== MSICONDITION_TRUE
),
1945 "wrong return val (%d)\n", r
);
1947 MsiCloseHandle( hpkg
);
1948 DeleteFile(msifile
);
1951 static BOOL
check_prop_empty( MSIHANDLE hpkg
, const char * prop
)
1959 r
= MsiGetProperty( hpkg
, prop
, buffer
, &sz
);
1960 return r
== ERROR_SUCCESS
&& buffer
[0] == 0 && sz
== 0;
1963 static void test_props(void)
1965 MSIHANDLE hpkg
, hdb
;
1970 hdb
= create_package_db();
1972 "CREATE TABLE `Property` ( "
1973 "`Property` CHAR(255) NOT NULL, "
1974 "`Value` CHAR(255) "
1975 "PRIMARY KEY `Property`)" );
1976 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1979 "INSERT INTO `Property` "
1980 "(`Property`, `Value`) "
1981 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1982 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1984 r
= package_from_db( hdb
, &hpkg
);
1985 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
1987 skip("Not enough rights to perform tests\n");
1988 DeleteFile(msifile
);
1991 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
1993 /* test invalid values */
1994 r
= MsiGetProperty( 0, NULL
, NULL
, NULL
);
1995 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1997 r
= MsiGetProperty( hpkg
, NULL
, NULL
, NULL
);
1998 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
2000 r
= MsiGetProperty( hpkg
, "boo", NULL
, NULL
);
2001 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2003 r
= MsiGetProperty( hpkg
, "boo", buffer
, NULL
);
2004 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
2006 /* test retrieving an empty/nonexistent property */
2008 r
= MsiGetProperty( hpkg
, "boo", NULL
, &sz
);
2009 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2010 ok( sz
== 0, "wrong size returned\n");
2012 check_prop_empty( hpkg
, "boo");
2015 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
2016 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
2017 ok( !strcmp(buffer
,"x"), "buffer was changed\n");
2018 ok( sz
== 0, "wrong size returned\n");
2022 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
2023 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2024 ok( buffer
[0] == 0, "buffer was not changed\n");
2025 ok( sz
== 0, "wrong size returned\n");
2027 /* set the property to something */
2028 r
= MsiSetProperty( 0, NULL
, NULL
);
2029 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
2031 r
= MsiSetProperty( hpkg
, NULL
, NULL
);
2032 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
2034 r
= MsiSetProperty( hpkg
, "", NULL
);
2035 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2037 /* try set and get some illegal property identifiers */
2038 r
= MsiSetProperty( hpkg
, "", "asdf" );
2039 ok( r
== ERROR_FUNCTION_FAILED
, "wrong return val\n");
2041 r
= MsiSetProperty( hpkg
, "=", "asdf" );
2042 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2044 r
= MsiSetProperty( hpkg
, " ", "asdf" );
2045 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2047 r
= MsiSetProperty( hpkg
, "'", "asdf" );
2048 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2052 r
= MsiGetProperty( hpkg
, "'", buffer
, &sz
);
2053 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2054 ok( !strcmp(buffer
,"asdf"), "buffer was not changed\n");
2056 /* set empty values */
2057 r
= MsiSetProperty( hpkg
, "boo", NULL
);
2058 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2059 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
2061 r
= MsiSetProperty( hpkg
, "boo", "" );
2062 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2063 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
2065 /* set a non-empty value */
2066 r
= MsiSetProperty( hpkg
, "boo", "xyz" );
2067 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2071 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
2072 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
2073 ok( buffer
[0] == 0, "buffer was not changed\n");
2074 ok( sz
== 3, "wrong size returned\n");
2078 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
2079 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2080 ok( !strcmp(buffer
,"xyz"), "buffer was not changed\n");
2081 ok( sz
== 3, "wrong size returned\n");
2085 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
2086 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
2087 ok( !strcmp(buffer
,"xy"), "buffer was not changed\n");
2088 ok( sz
== 3, "wrong size returned\n");
2090 r
= MsiSetProperty(hpkg
, "SourceDir", "foo");
2091 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2094 r
= MsiGetProperty(hpkg
, "SOURCEDIR", buffer
, &sz
);
2095 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2096 ok( !strcmp(buffer
,""), "buffer wrong\n");
2097 ok( sz
== 0, "wrong size returned\n");
2100 r
= MsiGetProperty(hpkg
, "SOMERANDOMNAME", buffer
, &sz
);
2101 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2102 ok( !strcmp(buffer
,""), "buffer wrong\n");
2103 ok( sz
== 0, "wrong size returned\n");
2106 r
= MsiGetProperty(hpkg
, "SourceDir", buffer
, &sz
);
2107 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2108 ok( !strcmp(buffer
,"foo"), "buffer wrong\n");
2109 ok( sz
== 3, "wrong size returned\n");
2111 r
= MsiSetProperty(hpkg
, "MetadataCompName", "Photoshop.dll");
2112 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
2115 r
= MsiGetProperty(hpkg
, "MetadataCompName", NULL
, &sz
);
2116 ok( r
== ERROR_SUCCESS
, "return wrong\n");
2117 ok( sz
== 13, "size wrong (%d)\n", sz
);
2120 r
= MsiGetProperty(hpkg
, "MetadataCompName", buffer
, &sz
);
2121 ok( r
== ERROR_MORE_DATA
, "return wrong\n");
2122 ok( !strcmp(buffer
,"Photoshop.dl"), "buffer wrong\n");
2124 r
= MsiSetProperty(hpkg
, "property", "value");
2125 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2128 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
2129 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2130 ok( !strcmp(buffer
, "value"), "Expected value, got %s\n", buffer
);
2132 r
= MsiSetProperty(hpkg
, "property", NULL
);
2133 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2136 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
2137 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2138 ok( !strlen(buffer
), "Expected empty string, got %s\n", buffer
);
2140 MsiCloseHandle( hpkg
);
2141 DeleteFile(msifile
);
2144 static BOOL
find_prop_in_property(MSIHANDLE hdb
, LPCSTR prop
, LPCSTR val
)
2146 MSIHANDLE hview
, hrec
;
2148 CHAR buffer
[MAX_PATH
];
2152 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
2153 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2154 r
= MsiViewExecute(hview
, 0);
2155 ok(r
== ERROR_SUCCESS
, "MsiViewExecute failed\n");
2158 while (r
== ERROR_SUCCESS
&& !found
)
2160 r
= MsiViewFetch(hview
, &hrec
);
2161 if (r
!= ERROR_SUCCESS
) break;
2164 r
= MsiRecordGetString(hrec
, 1, buffer
, &sz
);
2165 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, prop
))
2168 r
= MsiRecordGetString(hrec
, 2, buffer
, &sz
);
2169 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, val
))
2173 MsiCloseHandle(hrec
);
2176 MsiViewClose(hview
);
2177 MsiCloseHandle(hview
);
2182 static void test_property_table(void)
2186 MSIHANDLE hpkg
, hdb
, hrec
;
2187 char buffer
[MAX_PATH
], package
[10];
2191 hdb
= create_package_db();
2192 ok( hdb
, "failed to create package\n");
2194 r
= package_from_db(hdb
, &hpkg
);
2195 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2197 skip("Not enough rights to perform tests\n");
2198 DeleteFile(msifile
);
2201 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2203 MsiCloseHandle(hdb
);
2205 hdb
= MsiGetActiveDatabase(hpkg
);
2207 query
= "CREATE TABLE `_Property` ( "
2208 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2209 r
= run_query(hdb
, query
);
2210 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
2212 MsiCloseHandle(hdb
);
2213 MsiCloseHandle(hpkg
);
2214 DeleteFile(msifile
);
2216 hdb
= create_package_db();
2217 ok( hdb
, "failed to create package\n");
2219 query
= "CREATE TABLE `_Property` ( "
2220 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2221 r
= run_query(hdb
, query
);
2222 ok(r
== ERROR_SUCCESS
, "failed to create table\n");
2224 query
= "ALTER `_Property` ADD `foo` INTEGER";
2225 r
= run_query(hdb
, query
);
2226 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
2228 query
= "ALTER TABLE `_Property` ADD `foo` INTEGER";
2229 r
= run_query(hdb
, query
);
2230 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
2232 query
= "ALTER TABLE `_Property` ADD `extra` INTEGER";
2233 r
= run_query(hdb
, query
);
2234 ok(r
== ERROR_SUCCESS
, "failed to add column\n");
2236 sprintf(package
, "#%i", hdb
);
2237 r
= MsiOpenPackage(package
, &hpkg
);
2238 todo_wine
ok(r
!= ERROR_SUCCESS
, "MsiOpenPackage succeeded\n");
2239 if (r
== ERROR_SUCCESS
)
2240 MsiCloseHandle(hpkg
);
2242 r
= MsiCloseHandle(hdb
);
2243 ok(r
== ERROR_SUCCESS
, "MsiCloseHandle failed %u\n", r
);
2245 hdb
= create_package_db();
2246 ok (hdb
, "failed to create package database\n");
2248 r
= create_property_table(hdb
);
2249 ok(r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2251 r
= add_property_entry(hdb
, "'prop', 'val'");
2252 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2254 r
= package_from_db(hdb
, &hpkg
);
2255 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2257 MsiCloseHandle(hdb
);
2260 r
= MsiGetProperty(hpkg
, "prop", buffer
, &sz
);
2261 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2262 ok(!lstrcmp(buffer
, "val"), "Expected val, got %s\n", buffer
);
2264 hdb
= MsiGetActiveDatabase(hpkg
);
2266 found
= find_prop_in_property(hdb
, "prop", "val");
2267 ok(found
, "prop should be in the _Property table\n");
2269 r
= add_property_entry(hdb
, "'dantes', 'mercedes'");
2270 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2272 query
= "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2273 r
= do_query(hdb
, query
, &hrec
);
2274 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
2276 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2277 ok(found
== FALSE
, "dantes should not be in the _Property table\n");
2280 lstrcpy(buffer
, "aaa");
2281 r
= MsiGetProperty(hpkg
, "dantes", buffer
, &sz
);
2282 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2283 ok(lstrlenA(buffer
) == 0, "Expected empty string, got %s\n", buffer
);
2285 r
= MsiSetProperty(hpkg
, "dantes", "mercedes");
2286 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2288 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2289 ok(found
== TRUE
, "dantes should be in the _Property table\n");
2291 MsiCloseHandle(hdb
);
2292 MsiCloseHandle(hpkg
);
2293 DeleteFile(msifile
);
2296 static UINT
try_query_param( MSIHANDLE hdb
, LPCSTR szQuery
, MSIHANDLE hrec
)
2301 res
= MsiDatabaseOpenView( hdb
, szQuery
, &htab
);
2302 if( res
== ERROR_SUCCESS
)
2306 r
= MsiViewExecute( htab
, hrec
);
2307 if( r
!= ERROR_SUCCESS
)
2310 fprintf(stderr
,"MsiViewExecute failed %08x\n", res
);
2313 r
= MsiViewClose( htab
);
2314 if( r
!= ERROR_SUCCESS
)
2317 r
= MsiCloseHandle( htab
);
2318 if( r
!= ERROR_SUCCESS
)
2324 static UINT
try_query( MSIHANDLE hdb
, LPCSTR szQuery
)
2326 return try_query_param( hdb
, szQuery
, 0 );
2329 static void set_summary_str(MSIHANDLE hdb
, DWORD pid
, LPCSTR value
)
2334 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2335 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2337 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_LPSTR
, 0, NULL
, value
);
2338 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2340 r
= MsiSummaryInfoPersist(summary
);
2341 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2343 MsiCloseHandle(summary
);
2346 static void set_summary_dword(MSIHANDLE hdb
, DWORD pid
, DWORD value
)
2351 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2352 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2354 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_I4
, value
, NULL
, NULL
);
2355 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2357 r
= MsiSummaryInfoPersist(summary
);
2358 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2360 MsiCloseHandle(summary
);
2363 static void test_msipackage(void)
2365 MSIHANDLE hdb
= 0, hpack
= 100;
2370 /* NULL szPackagePath */
2371 r
= MsiOpenPackage(NULL
, &hpack
);
2372 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2374 /* empty szPackagePath */
2375 r
= MsiOpenPackage("", &hpack
);
2376 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2378 skip("Not enough rights to perform tests\n");
2383 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2386 if (r
== ERROR_SUCCESS
)
2387 MsiCloseHandle(hpack
);
2389 /* nonexistent szPackagePath */
2390 r
= MsiOpenPackage("nonexistent", &hpack
);
2391 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r
);
2394 r
= MsiOpenPackage(msifile
, NULL
);
2395 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2399 r
= MsiOpenPackage(name
, &hpack
);
2400 ok(r
== ERROR_INVALID_HANDLE
, "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
2402 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2405 /* database exists, but is emtpy */
2406 sprintf(name
, "#%d", hdb
);
2407 r
= MsiOpenPackage(name
, &hpack
);
2408 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2409 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2411 query
= "CREATE TABLE `Property` ( "
2412 "`Property` CHAR(72), `Value` CHAR(0) "
2413 "PRIMARY KEY `Property`)";
2414 r
= try_query(hdb
, query
);
2415 ok(r
== ERROR_SUCCESS
, "failed to create Properties table\n");
2417 query
= "CREATE TABLE `InstallExecuteSequence` ("
2418 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2419 "PRIMARY KEY `Action`)";
2420 r
= try_query(hdb
, query
);
2421 ok(r
== ERROR_SUCCESS
, "failed to create InstallExecuteSequence table\n");
2423 /* a few key tables exist */
2424 sprintf(name
, "#%d", hdb
);
2425 r
= MsiOpenPackage(name
, &hpack
);
2426 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2427 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2429 MsiCloseHandle(hdb
);
2430 DeleteFile(msifile
);
2432 /* start with a clean database to show what constitutes a valid package */
2433 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2436 sprintf(name
, "#%d", hdb
);
2438 /* The following summary information props must exist:
2443 set_summary_dword(hdb
, PID_PAGECOUNT
, 100);
2444 r
= MsiOpenPackage(name
, &hpack
);
2445 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2446 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2448 set_summary_str(hdb
, PID_REVNUMBER
, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2449 r
= MsiOpenPackage(name
, &hpack
);
2450 ok(r
== ERROR_SUCCESS
,
2451 "Expected ERROR_SUCCESS, got %d\n", r
);
2453 MsiCloseHandle(hpack
);
2454 MsiCloseHandle(hdb
);
2455 DeleteFile(msifile
);
2458 static void test_formatrecord2(void)
2460 MSIHANDLE hpkg
, hrec
;
2465 r
= package_from_db(create_package_db(), &hpkg
);
2466 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2468 skip("Not enough rights to perform tests\n");
2469 DeleteFile(msifile
);
2472 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2474 r
= MsiSetProperty(hpkg
, "Manufacturer", " " );
2475 ok( r
== ERROR_SUCCESS
, "set property failed\n");
2477 hrec
= MsiCreateRecord(2);
2478 ok(hrec
, "create record failed\n");
2480 r
= MsiRecordSetString( hrec
, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2481 ok( r
== ERROR_SUCCESS
, "format record failed\n");
2485 r
= MsiFormatRecord( hpkg
, hrec
, buffer
, &sz
);
2486 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2488 r
= MsiRecordSetString(hrec
, 0, "[foo][1]");
2489 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2490 r
= MsiRecordSetString(hrec
, 1, "hoo");
2491 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2493 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2494 ok( sz
== 3, "size wrong\n");
2495 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2496 ok( r
== ERROR_SUCCESS
, "format failed\n");
2498 r
= MsiRecordSetString(hrec
, 0, "x[~]x");
2499 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2501 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2502 ok( sz
== 3, "size wrong\n");
2503 ok( 0 == strcmp(buffer
,"x"), "wrong output %s\n",buffer
);
2504 ok( r
== ERROR_SUCCESS
, "format failed\n");
2506 r
= MsiRecordSetString(hrec
, 0, "[foo.$%}][1]");
2507 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2508 r
= MsiRecordSetString(hrec
, 1, "hoo");
2509 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2511 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2512 ok( sz
== 3, "size wrong\n");
2513 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2514 ok( r
== ERROR_SUCCESS
, "format failed\n");
2516 r
= MsiRecordSetString(hrec
, 0, "[\\[]");
2517 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2519 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2520 ok( sz
== 1, "size wrong\n");
2521 ok( 0 == strcmp(buffer
,"["), "wrong output %s\n",buffer
);
2522 ok( r
== ERROR_SUCCESS
, "format failed\n");
2524 SetEnvironmentVariable("FOO", "BAR");
2525 r
= MsiRecordSetString(hrec
, 0, "[%FOO]");
2526 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2528 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2529 ok( sz
== 3, "size wrong\n");
2530 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2531 ok( r
== ERROR_SUCCESS
, "format failed\n");
2533 r
= MsiRecordSetString(hrec
, 0, "[[1]]");
2534 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2535 r
= MsiRecordSetString(hrec
, 1, "%FOO");
2536 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
2538 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2539 ok( sz
== 3, "size wrong\n");
2540 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2541 ok( r
== ERROR_SUCCESS
, "format failed\n");
2543 MsiCloseHandle( hrec
);
2544 MsiCloseHandle( hpkg
);
2545 DeleteFile(msifile
);
2548 static void test_states(void)
2553 INSTALLSTATE state
, action
;
2555 static const CHAR msifile2
[] = "winetest2-package.msi";
2556 static const CHAR msifile3
[] = "winetest3-package.msi";
2557 static const CHAR msifile4
[] = "winetest4-package.msi";
2559 if (is_process_limited())
2561 skip("process is limited\n");
2565 hdb
= create_package_db();
2566 ok ( hdb
, "failed to create package database\n" );
2568 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
2569 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
2571 r
= create_property_table( hdb
);
2572 ok( r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2574 r
= add_property_entry( hdb
, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2575 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2577 r
= add_property_entry( hdb
, "'ProductLanguage', '1033'" );
2578 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2580 r
= add_property_entry( hdb
, "'ProductName', 'MSITEST'" );
2581 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2583 r
= add_property_entry( hdb
, "'ProductVersion', '1.1.1'" );
2584 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2586 r
= add_property_entry( hdb
, "'MSIFASTINSTALL', '1'" );
2587 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2589 r
= create_install_execute_sequence_table( hdb
);
2590 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table: %d\n", r
);
2592 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
2593 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2595 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
2596 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2598 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
2599 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2601 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1400'" );
2602 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2604 r
= add_install_execute_sequence_entry( hdb
, "'InstallInitialize', '', '1500'" );
2605 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2607 r
= add_install_execute_sequence_entry( hdb
, "'ProcessComponents', '', '1600'" );
2608 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2610 r
= add_install_execute_sequence_entry( hdb
, "'UnpublishFeatures', '', '1800'" );
2611 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2613 r
= add_install_execute_sequence_entry( hdb
, "'RegisterProduct', '', '6100'" );
2614 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2616 r
= add_install_execute_sequence_entry( hdb
, "'PublishFeatures', '', '6300'" );
2617 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2619 r
= add_install_execute_sequence_entry( hdb
, "'PublishProduct', '', '6400'" );
2620 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2622 r
= add_install_execute_sequence_entry( hdb
, "'InstallFinalize', '', '6600'" );
2623 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2625 r
= create_media_table( hdb
);
2626 ok( r
== ERROR_SUCCESS
, "cannot create media table: %d\n", r
);
2628 r
= add_media_entry( hdb
, "'1', '3', '', '', 'DISK1', ''");
2629 ok( r
== ERROR_SUCCESS
, "cannot add media entry: %d\n", r
);
2631 r
= create_feature_table( hdb
);
2632 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
2634 r
= create_component_table( hdb
);
2635 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
2637 /* msidbFeatureAttributesFavorLocal */
2638 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
2639 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2641 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2642 r
= add_component_entry( hdb
, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2643 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2645 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2646 r
= add_component_entry( hdb
, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2647 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2649 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2650 r
= add_component_entry( hdb
, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2651 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2653 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2654 r
= add_component_entry( hdb
, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2655 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2657 /* msidbFeatureAttributesFavorSource */
2658 r
= add_feature_entry( hdb
, "'two', '', '', '', 2, 1, '', 1" );
2659 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2661 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2662 r
= add_component_entry( hdb
, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2663 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2665 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2666 r
= add_component_entry( hdb
, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2667 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2669 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2670 r
= add_component_entry( hdb
, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2671 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2673 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2674 r
= add_component_entry( hdb
, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2675 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2677 /* msidbFeatureAttributesFavorSource */
2678 r
= add_feature_entry( hdb
, "'three', '', '', '', 2, 1, '', 1" );
2679 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2681 /* msidbFeatureAttributesFavorLocal */
2682 r
= add_feature_entry( hdb
, "'four', '', '', '', 2, 1, '', 0" );
2683 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2686 r
= add_feature_entry( hdb
, "'five', '', '', '', 2, 0, '', 1" );
2687 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2689 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2690 r
= add_component_entry( hdb
, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2691 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2693 /* no feature parent:msidbComponentAttributesLocalOnly */
2694 r
= add_component_entry( hdb
, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2695 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2697 /* msidbFeatureAttributesFavorLocal:removed */
2698 r
= add_feature_entry( hdb
, "'six', '', '', '', 2, 1, '', 0" );
2699 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2701 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2702 r
= add_component_entry( hdb
, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2703 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2705 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2706 r
= add_component_entry( hdb
, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2707 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2709 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2710 r
= add_component_entry( hdb
, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2711 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2713 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2714 r
= add_component_entry( hdb
, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2715 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2717 /* msidbFeatureAttributesFavorSource:removed */
2718 r
= add_feature_entry( hdb
, "'seven', '', '', '', 2, 1, '', 1" );
2719 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2721 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2722 r
= add_component_entry( hdb
, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2723 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2725 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2726 r
= add_component_entry( hdb
, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2727 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2729 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2730 r
= add_component_entry( hdb
, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2731 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2733 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2734 r
= add_component_entry( hdb
, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2735 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2737 /* msidbFeatureAttributesFavorLocal */
2738 r
= add_feature_entry( hdb
, "'eight', '', '', '', 2, 1, '', 0" );
2739 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2741 r
= add_component_entry( hdb
, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2742 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2744 /* msidbFeatureAttributesFavorSource */
2745 r
= add_feature_entry( hdb
, "'nine', '', '', '', 2, 1, '', 1" );
2746 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2748 r
= add_component_entry( hdb
, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2749 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2751 /* msidbFeatureAttributesFavorAdvertise */
2752 r
= add_feature_entry( hdb
, "'ten', '', '', '', 2, 1, '', 4" );
2753 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2755 r
= add_component_entry( hdb
, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2756 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2758 /* msidbFeatureAttributesUIDisallowAbsent */
2759 r
= add_feature_entry( hdb
, "'eleven', '', '', '', 2, 1, '', 16" );
2760 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2762 r
= add_component_entry( hdb
, "'psi', '{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '', 'psi_file'" );
2763 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2765 r
= create_feature_components_table( hdb
);
2766 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
2768 r
= add_feature_components_entry( hdb
, "'one', 'alpha'" );
2769 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2771 r
= add_feature_components_entry( hdb
, "'one', 'beta'" );
2772 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2774 r
= add_feature_components_entry( hdb
, "'one', 'gamma'" );
2775 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2777 r
= add_feature_components_entry( hdb
, "'one', 'theta'" );
2778 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2780 r
= add_feature_components_entry( hdb
, "'two', 'delta'" );
2781 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2783 r
= add_feature_components_entry( hdb
, "'two', 'epsilon'" );
2784 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2786 r
= add_feature_components_entry( hdb
, "'two', 'zeta'" );
2787 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2789 r
= add_feature_components_entry( hdb
, "'two', 'iota'" );
2790 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2792 r
= add_feature_components_entry( hdb
, "'three', 'eta'" );
2793 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2795 r
= add_feature_components_entry( hdb
, "'four', 'eta'" );
2796 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2798 r
= add_feature_components_entry( hdb
, "'five', 'eta'" );
2799 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2801 r
= add_feature_components_entry( hdb
, "'six', 'lambda'" );
2802 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2804 r
= add_feature_components_entry( hdb
, "'six', 'mu'" );
2805 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2807 r
= add_feature_components_entry( hdb
, "'six', 'nu'" );
2808 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2810 r
= add_feature_components_entry( hdb
, "'six', 'xi'" );
2811 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2813 r
= add_feature_components_entry( hdb
, "'seven', 'omicron'" );
2814 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2816 r
= add_feature_components_entry( hdb
, "'seven', 'pi'" );
2817 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2819 r
= add_feature_components_entry( hdb
, "'seven', 'rho'" );
2820 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2822 r
= add_feature_components_entry( hdb
, "'seven', 'sigma'" );
2823 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2825 r
= add_feature_components_entry( hdb
, "'eight', 'tau'" );
2826 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2828 r
= add_feature_components_entry( hdb
, "'nine', 'phi'" );
2829 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2831 r
= add_feature_components_entry( hdb
, "'ten', 'chi'" );
2832 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2834 r
= add_feature_components_entry( hdb
, "'eleven', 'psi'" );
2835 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2837 r
= create_file_table( hdb
);
2838 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
2840 r
= add_file_entry( hdb
, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2841 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2843 r
= add_file_entry( hdb
, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2844 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2846 r
= add_file_entry( hdb
, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2847 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2849 r
= add_file_entry( hdb
, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2850 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2852 r
= add_file_entry( hdb
, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2853 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2855 r
= add_file_entry( hdb
, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2856 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2858 r
= add_file_entry( hdb
, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2859 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2861 r
= add_file_entry( hdb
, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2862 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2864 /* compressed file */
2865 r
= add_file_entry( hdb
, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2866 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2868 r
= add_file_entry( hdb
, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2869 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2871 r
= add_file_entry( hdb
, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2872 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2874 r
= add_file_entry( hdb
, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2875 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2877 r
= add_file_entry( hdb
, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2878 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2880 r
= add_file_entry( hdb
, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2881 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2883 r
= add_file_entry( hdb
, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2884 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2886 r
= add_file_entry( hdb
, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2887 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2889 r
= add_file_entry( hdb
, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2890 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2892 r
= add_file_entry( hdb
, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2893 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2895 r
= add_file_entry( hdb
, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2896 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2898 r
= add_file_entry( hdb
, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2899 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2901 r
= add_file_entry( hdb
, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2902 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2904 r
= add_file_entry( hdb
, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
2905 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2907 MsiDatabaseCommit(hdb
);
2909 /* these properties must not be in the saved msi file */
2910 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
2911 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2913 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
2914 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2916 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
2917 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2919 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine,ten'");
2920 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2922 r
= add_property_entry( hdb
, "'REINSTALLMODE', 'omus'");
2923 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2925 r
= package_from_db( hdb
, &hpkg
);
2926 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2928 skip("Not enough rights to perform tests\n");
2929 DeleteFile(msifile
);
2932 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
2934 MsiCloseHandle(hdb
);
2936 CopyFileA(msifile
, msifile2
, FALSE
);
2937 CopyFileA(msifile
, msifile3
, FALSE
);
2938 CopyFileA(msifile
, msifile4
, FALSE
);
2942 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2943 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2944 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2945 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2949 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2950 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2951 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2952 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2956 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2957 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2958 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2959 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2963 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2964 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2965 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2966 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2970 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2971 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2972 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2973 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2977 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2978 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2979 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2980 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2984 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2985 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2986 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2987 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2991 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
2992 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2993 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2994 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2998 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
2999 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3000 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3001 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3005 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3006 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3007 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3008 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3012 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
3013 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3014 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3015 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3019 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3020 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3021 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3022 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3026 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3027 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3028 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3029 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3033 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3034 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3035 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3036 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3040 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3041 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3042 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3043 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3047 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3048 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3049 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3050 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3054 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3055 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3056 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3057 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3061 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3062 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3063 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3064 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3068 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3069 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3070 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3071 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3075 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3076 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3077 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3078 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3082 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3083 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3084 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3085 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3089 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3090 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3091 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3092 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3096 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3097 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3098 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3099 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3103 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3104 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3105 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3106 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3110 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3111 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3112 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3113 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3117 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3118 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3119 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3120 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3124 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3125 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3126 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3127 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3131 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3132 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3133 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3134 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3138 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3139 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3140 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3141 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3145 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3146 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3147 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3148 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3152 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3153 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3154 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3155 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3159 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3160 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3161 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3162 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3166 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
3167 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3168 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3169 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3171 r
= MsiDoAction( hpkg
, "CostInitialize");
3172 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3176 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3177 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3178 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3179 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3183 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3184 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3185 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3186 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3190 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3191 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3192 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3193 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3197 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3198 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3199 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3200 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3204 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3205 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3206 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3207 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3211 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3212 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3213 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3214 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3218 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3219 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3220 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3221 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3225 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3226 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3227 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3228 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3232 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3233 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3234 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3235 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3239 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3240 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3241 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3242 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3246 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
3247 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3248 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3249 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3253 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3254 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3255 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3256 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3260 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3261 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3262 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3263 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3267 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3268 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3269 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3270 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3274 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3275 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3276 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3277 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3281 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3282 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3283 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3284 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3288 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3289 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3290 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3291 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3295 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3296 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3297 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3298 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3302 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3303 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3304 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3305 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3309 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3310 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3311 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3312 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3316 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3317 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3318 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3319 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3323 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3324 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3325 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3326 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3330 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3331 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3332 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3333 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3337 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3338 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3339 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3340 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3344 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3345 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3346 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3347 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3351 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3352 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3353 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3354 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3358 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3359 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3360 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3361 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3365 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3366 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3367 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3368 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3372 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3373 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3374 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3375 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3379 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3380 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3381 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3382 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3386 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3387 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3388 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3389 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3393 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3394 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3395 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3396 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3400 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
3401 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3402 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3403 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3405 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3407 r
= MsiDoAction( hpkg
, "FileCost");
3408 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3410 r
= MsiGetFeatureState(hpkg
, "one", NULL
, NULL
);
3411 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3414 r
= MsiGetFeatureState(hpkg
, "one", NULL
, &action
);
3415 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3416 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3419 r
= MsiGetFeatureState( hpkg
, "one", &state
, NULL
);
3420 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3421 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3425 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3426 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3427 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3428 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3432 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3433 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3434 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3435 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3439 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3440 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3441 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3442 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3446 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3447 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3448 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3449 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3453 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3454 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3455 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3456 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3460 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3461 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3462 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3463 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3467 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3468 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3469 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3470 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3474 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3475 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3476 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3477 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3481 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3482 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3483 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3484 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3488 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3489 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3490 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3491 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3495 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
3496 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3497 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3498 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3502 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3503 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3504 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3505 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3509 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3510 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3511 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3512 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3516 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3517 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3518 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3519 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3523 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3524 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3525 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3526 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3530 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3531 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3532 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3533 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3537 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3538 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3539 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3540 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3544 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3545 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3546 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3547 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3551 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3552 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3553 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3554 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3558 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3559 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3560 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3561 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3565 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3566 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3567 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3568 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3572 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3573 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3574 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3575 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3579 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3580 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3581 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3582 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3586 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3587 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3588 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3589 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3593 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3594 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3595 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3596 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3600 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3601 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3602 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3603 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3607 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3608 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3609 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3610 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3614 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3615 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3616 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3617 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3621 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3622 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3623 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3624 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3628 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3629 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3630 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3631 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3635 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3636 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3637 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3638 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3642 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3643 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3644 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3645 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3649 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
3650 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3651 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3652 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3654 r
= MsiDoAction( hpkg
, "CostFinalize");
3655 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3659 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3660 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3661 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3662 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3666 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3667 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3668 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3669 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3673 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3674 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3675 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3676 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3680 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3681 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3682 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3683 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3687 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3688 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3689 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3690 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3694 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3695 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3696 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3697 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3701 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3702 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3703 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3704 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3708 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3709 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3710 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3711 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3715 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3716 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3717 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3718 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3722 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3723 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3724 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3725 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3729 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
3730 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3731 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3732 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3736 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3737 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3738 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3739 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3743 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3744 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3745 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3746 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3750 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3751 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3752 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3753 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3757 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3758 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3759 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3760 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3764 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3765 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3766 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3767 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3771 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3772 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3773 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3774 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3778 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3779 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3780 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3781 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3785 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3786 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3787 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3788 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3792 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3793 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3794 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3795 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3799 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3800 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3801 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3802 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3806 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3807 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3808 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3809 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3813 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3814 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3815 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3816 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3820 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3821 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3822 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3823 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3827 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3828 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3829 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3830 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3834 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3835 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3836 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3837 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3841 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3842 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3843 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3844 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3848 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3849 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3850 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3851 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3855 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3856 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3857 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3858 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3862 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3863 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3864 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3865 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3869 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3870 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3871 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3872 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3876 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
3877 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3878 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3879 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3883 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
3884 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3885 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3886 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3888 MsiCloseHandle( hpkg
);
3890 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3892 /* publish the features and components */
3893 r
= MsiInstallProduct(msifile
, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3894 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3896 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
3897 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3899 /* these properties must not be in the saved msi file */
3900 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
3901 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3903 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
3904 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3906 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
3907 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3909 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine,ten'");
3910 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3912 r
= package_from_db( hdb
, &hpkg
);
3913 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
3915 MsiCloseHandle(hdb
);
3919 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3920 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3921 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3922 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3926 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3927 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3928 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3929 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3933 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3934 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3935 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3936 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3940 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3941 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3942 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3943 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3947 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3948 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3949 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3950 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3954 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3955 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3956 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3957 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3961 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3962 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3963 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3964 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3968 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3969 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3970 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3971 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3975 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3976 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3977 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3978 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3982 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
3983 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3984 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3985 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3989 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
3990 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3991 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3992 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3996 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3997 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3998 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3999 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4003 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4004 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4005 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4006 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4010 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4011 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4012 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4013 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4017 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4018 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4019 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4020 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4024 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4025 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4026 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4027 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4031 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4032 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4033 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4034 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4038 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4039 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4040 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4041 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4045 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4046 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4047 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4048 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4052 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4053 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4054 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4055 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4059 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4060 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4061 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4062 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4066 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4067 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4068 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4069 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4073 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4074 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4075 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4076 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4080 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4081 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4082 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4083 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4087 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4088 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4089 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4090 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4094 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4095 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4096 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4097 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4101 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4102 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4103 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4104 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4108 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4109 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4110 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4111 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4115 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4116 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4117 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4118 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4122 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4123 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4124 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4125 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4129 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4130 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4131 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4132 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4136 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4137 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4138 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4139 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4143 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
4144 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4145 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4146 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4148 r
= MsiDoAction( hpkg
, "CostInitialize");
4149 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4153 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4154 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4155 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4156 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4160 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4161 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4162 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4163 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4167 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4168 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4169 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4170 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4174 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4175 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4176 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4177 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4181 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4182 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4183 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4184 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4188 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4189 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4190 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4191 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4195 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4196 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4197 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4198 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4202 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4203 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4204 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4205 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4209 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4210 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4211 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4212 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4216 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4217 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4218 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4219 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4223 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
4224 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4225 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4226 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4230 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4231 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4232 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4233 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4237 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4238 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4239 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4240 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4244 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4245 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4246 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4247 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4251 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4252 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4253 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4254 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4258 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4259 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4260 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4261 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4265 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4266 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4267 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4268 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4272 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4273 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4274 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4275 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4279 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4280 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4281 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4282 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4286 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4287 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4288 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4289 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4293 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4294 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4295 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4296 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4300 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4301 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4302 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4303 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4307 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4308 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4309 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4310 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4314 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4315 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4316 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4317 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4321 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4322 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4323 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4324 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4328 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4329 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4330 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4331 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4335 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4336 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4337 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4338 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4342 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4343 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4344 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4345 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4349 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4350 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4351 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4352 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4356 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4357 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4358 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4359 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4363 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4364 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4365 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4366 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4370 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4371 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4372 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4373 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4377 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
4378 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4379 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4380 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4382 r
= MsiDoAction( hpkg
, "FileCost");
4383 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
4387 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4388 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4389 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4390 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4394 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4395 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4396 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4397 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4401 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4402 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4403 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4404 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4408 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4409 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4410 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4411 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4415 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4416 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4417 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4418 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4422 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4423 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4424 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4425 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4429 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4430 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4431 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4432 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4436 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4437 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4438 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4439 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4443 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4444 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4445 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4446 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4450 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4451 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4452 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4453 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4457 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4458 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4459 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4460 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4464 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4465 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4466 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4467 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4471 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4472 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4473 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4474 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4478 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4479 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4480 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4481 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4485 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4486 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4487 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4488 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4492 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4493 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4494 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4495 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4499 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4500 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4501 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4502 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4506 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4507 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4508 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4509 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4513 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4514 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4515 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4516 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4520 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4521 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4522 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4523 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4527 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4528 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4529 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4530 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4534 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4535 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4536 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4537 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4541 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4542 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4543 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4544 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4548 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4549 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4550 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4551 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4555 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4556 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4557 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4558 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4562 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4563 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4564 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4565 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4569 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4570 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4571 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4572 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4576 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4577 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4578 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4579 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4583 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4584 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4585 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4586 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4590 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4591 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4592 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4593 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4597 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
4598 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4599 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4600 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4602 r
= MsiDoAction( hpkg
, "CostFinalize");
4603 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4607 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4608 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4609 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4610 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4614 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4615 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4616 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4617 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4621 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4622 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4623 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4624 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4628 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4629 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4630 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4631 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4635 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4636 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4637 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4638 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4642 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4643 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4644 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4645 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4649 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4650 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4651 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4652 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4656 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4657 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4658 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4659 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4663 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4664 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4665 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4666 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4670 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4671 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4672 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4673 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4677 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
4678 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4679 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4680 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4684 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4685 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4686 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4687 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4691 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4692 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4693 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4694 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4698 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4699 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4700 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4701 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4705 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4706 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4707 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4708 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4712 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4713 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4714 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4715 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4719 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4720 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4721 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4722 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4726 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4727 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4728 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4729 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4733 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4734 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4735 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4736 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4740 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4741 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4742 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4743 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4747 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4748 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4749 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4750 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4754 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4755 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4756 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4757 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4761 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4762 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4763 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4764 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4768 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4769 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4770 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4771 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4775 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4776 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4777 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4778 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4782 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4783 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4784 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4785 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4789 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4790 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4791 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4792 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4796 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4797 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4798 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4799 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4803 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4804 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4805 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4806 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4810 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4811 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4812 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4813 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4817 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4818 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4819 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4820 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4824 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
4825 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4826 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4827 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4831 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
4832 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4833 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4834 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4836 MsiCloseHandle(hpkg
);
4838 /* uninstall the product */
4839 r
= MsiInstallProduct(msifile
, "REMOVE=ALL");
4840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4842 /* all features installed locally */
4843 r
= MsiInstallProduct(msifile2
, "ADDLOCAL=ALL");
4844 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4846 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_DIRECT
, &hdb
);
4847 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4849 /* these properties must not be in the saved msi file */
4850 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4851 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4853 r
= package_from_db( hdb
, &hpkg
);
4854 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
4858 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4859 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4860 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4861 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4865 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4866 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4867 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4868 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4872 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4873 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4874 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4875 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4879 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4880 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4881 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4882 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4886 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4887 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4888 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4889 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4893 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4894 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4895 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4896 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4900 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4901 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4902 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4903 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4907 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4908 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4909 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4910 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4914 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4915 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4916 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4917 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4921 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
4922 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4923 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4924 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4928 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
4929 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4930 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4931 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4935 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4936 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4937 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4938 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4942 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4943 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4944 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4945 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4949 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4950 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4951 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4952 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4956 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4957 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4958 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4959 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4963 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4964 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4965 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4966 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4970 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4971 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4972 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4973 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4977 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4978 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4979 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4980 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4984 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4985 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4986 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4987 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4991 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4992 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4993 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4994 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4998 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4999 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5000 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5001 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5005 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5006 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5007 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5008 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5012 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5013 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5014 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5015 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5019 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5020 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5021 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5022 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5026 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5027 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5028 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5029 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5033 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5034 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5035 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5036 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5040 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5041 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5042 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5043 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5047 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5048 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5049 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5050 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5054 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5055 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5056 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5057 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5061 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5062 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5063 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5064 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5068 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5069 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5070 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5071 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5075 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5076 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5077 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5078 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5082 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
5083 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5084 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5085 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5087 r
= MsiDoAction( hpkg
, "CostInitialize");
5088 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5092 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5093 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5094 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5095 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5099 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5100 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5101 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5102 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5106 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5107 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5108 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5109 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5113 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5114 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5115 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5116 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5120 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5121 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5122 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5123 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5127 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5128 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5129 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5130 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5134 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5135 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5136 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5137 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5141 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5142 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5143 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5144 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5148 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5149 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5150 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5151 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5155 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5156 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5157 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5158 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5162 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
5163 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5164 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5165 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5169 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5170 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5171 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5172 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5176 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5177 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5178 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5179 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5183 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5184 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5185 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5186 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5190 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5191 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5192 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5193 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5197 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5198 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5199 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5200 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5204 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5205 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5206 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5207 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5211 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5212 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5213 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5214 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5218 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5219 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5220 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5221 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5225 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5226 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5227 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5228 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5232 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5233 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5234 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5235 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5239 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5240 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5241 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5242 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5246 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5247 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5248 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5249 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5253 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5254 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5255 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5256 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5260 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5261 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5262 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5263 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5267 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5268 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5269 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5270 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5274 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5275 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5276 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5277 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5281 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5282 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5283 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5284 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5288 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5289 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5290 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5291 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5295 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5296 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5297 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5298 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5302 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5303 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5304 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5305 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5309 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5310 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5311 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5312 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5316 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
5317 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5318 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5319 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5321 r
= MsiDoAction( hpkg
, "FileCost");
5322 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5326 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5327 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5328 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5329 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5333 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5334 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5335 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5336 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5340 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5341 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5342 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5343 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5347 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5348 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5349 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5350 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5354 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5355 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5356 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5357 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5361 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5362 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5363 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5364 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5368 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5369 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5370 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5371 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5375 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5376 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5377 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5378 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5382 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5383 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5384 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5385 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5389 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5390 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5391 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5392 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5396 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
5397 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5398 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5399 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5403 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5404 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5405 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5406 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5410 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5411 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5412 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5413 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5417 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5418 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5419 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5420 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5424 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5425 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5426 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5427 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5431 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5432 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5433 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5434 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5438 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5439 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5440 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5441 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5445 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5446 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5447 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5448 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5452 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5453 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5454 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5455 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5459 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5460 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5461 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5462 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5466 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5467 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5468 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5469 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5473 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5474 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5475 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5476 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5480 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5481 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5482 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5483 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5487 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5488 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5489 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5490 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5494 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5495 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5496 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5497 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5501 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5502 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5503 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5504 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5508 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5509 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5510 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5511 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5515 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5516 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5517 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5518 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5522 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5523 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5524 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5525 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5529 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5530 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5531 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5532 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5536 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5537 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5538 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5539 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5543 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5544 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5545 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5546 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5550 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
5551 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5552 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5553 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5555 r
= MsiDoAction( hpkg
, "CostFinalize");
5556 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5560 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5561 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5562 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5563 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5567 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5568 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5569 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5570 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5574 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5575 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5576 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5577 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5581 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5582 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5583 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5584 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5588 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5589 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5590 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5591 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5595 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5596 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5597 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5598 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5602 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5603 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5604 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5605 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5609 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5610 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5611 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5612 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5616 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5617 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5618 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5619 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5623 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5624 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5625 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5626 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5630 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
5631 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5632 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5633 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5637 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5638 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5639 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5640 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5644 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5645 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5646 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5647 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5651 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5652 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5653 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5654 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5658 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5659 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5660 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5661 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5665 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5666 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5667 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5668 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5672 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5673 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5674 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5675 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5679 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5680 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5681 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5682 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5686 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5687 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5688 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5689 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5693 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5694 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5695 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5696 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5700 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5701 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5702 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5703 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5707 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5708 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5709 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5710 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5714 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5715 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5716 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5717 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5721 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5722 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5723 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5724 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5728 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5729 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5730 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5731 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5735 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5736 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5737 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5738 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5742 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5743 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5744 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5745 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5749 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5750 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5751 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5752 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5756 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5757 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5758 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5759 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5763 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5764 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5765 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5766 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5770 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5771 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5772 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5773 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5777 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
5778 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5779 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5780 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5784 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
5785 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5786 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5787 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5789 MsiCloseHandle(hpkg
);
5791 /* uninstall the product */
5792 r
= MsiInstallProduct(msifile2
, "REMOVE=ALL");
5793 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5795 /* all features installed from source */
5796 r
= MsiInstallProduct(msifile3
, "ADDSOURCE=ALL");
5797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5799 r
= MsiOpenDatabase(msifile3
, MSIDBOPEN_DIRECT
, &hdb
);
5800 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
5802 /* this property must not be in the saved msi file */
5803 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5804 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
5806 r
= package_from_db( hdb
, &hpkg
);
5807 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
5811 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5812 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5813 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5814 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5818 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5819 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5820 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5821 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5825 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5826 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5827 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5828 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5832 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5833 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5834 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5835 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5839 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5840 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5841 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5842 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5846 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5847 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5848 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5849 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5853 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5854 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5855 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5856 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5860 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5861 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5862 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5863 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5867 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5868 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5869 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5870 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5874 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
5875 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5876 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5877 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5881 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
5882 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5883 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5884 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5888 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5889 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5890 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5891 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5895 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5896 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5897 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5898 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5902 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5903 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5904 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5905 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5909 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5910 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5911 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5912 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5916 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5917 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5918 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5919 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5923 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5924 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5925 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5926 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5930 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5931 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5932 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5933 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5937 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5938 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5939 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5940 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5944 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5945 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5946 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5947 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5951 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5952 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5953 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5954 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5958 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5959 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5960 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5961 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5965 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5966 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5967 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5968 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5972 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5973 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5974 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5975 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5979 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5980 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5981 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5982 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5986 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5987 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5988 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5989 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5993 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5994 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5995 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5996 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6000 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6001 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6002 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6003 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6007 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6008 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6009 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6010 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6014 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6015 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6016 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6017 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6021 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6022 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6023 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6024 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6028 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6029 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6030 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6031 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6035 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
6036 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6037 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6038 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6040 r
= MsiDoAction( hpkg
, "CostInitialize");
6041 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
6045 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6046 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6047 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6048 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6052 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6053 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6054 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6055 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6059 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6060 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6061 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6062 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6066 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6067 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6068 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6069 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6073 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6074 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6075 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6076 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6080 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6081 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6082 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6083 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6087 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6088 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6089 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6090 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6094 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6095 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6096 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6097 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6101 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6102 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6103 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6104 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6108 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6109 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6110 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6111 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6115 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
6116 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6117 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6118 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6122 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6123 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6124 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6125 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6129 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6130 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6131 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6132 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6136 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6137 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6138 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6139 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6143 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6144 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6145 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6146 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6150 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6151 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6152 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6153 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6157 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6158 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6159 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6160 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6164 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6165 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6166 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6167 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6171 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6172 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6173 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6174 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6178 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6179 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6180 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6181 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6185 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6186 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6187 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6188 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6192 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6193 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6194 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6195 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6199 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6200 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6201 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6202 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6206 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6207 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6208 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6209 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6213 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6214 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6215 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6216 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6220 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6221 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6222 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6223 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6227 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6228 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6229 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6230 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6234 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6235 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6236 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6237 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6241 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6242 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6243 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6244 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6248 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6249 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6250 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6251 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6255 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6256 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6257 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6258 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6262 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6263 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6264 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6265 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6269 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
6270 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6271 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6272 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6274 r
= MsiDoAction( hpkg
, "FileCost");
6275 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
6279 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6280 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6281 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6282 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6286 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6287 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6288 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6289 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6293 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6294 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6295 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6296 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6300 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6301 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6302 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6303 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6307 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6308 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6309 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6310 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6314 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6315 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6316 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6317 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6321 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6322 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6323 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6324 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6328 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6329 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6330 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6331 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6335 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6336 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6337 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6338 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6342 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6343 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6344 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6345 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6349 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
6350 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6351 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6352 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6356 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6357 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6358 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6359 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6363 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6364 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6365 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6366 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6370 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6371 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6372 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6373 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6377 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6378 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6379 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6380 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6384 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6385 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6386 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6387 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6391 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6392 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6393 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6394 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6398 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6399 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6400 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6401 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6405 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6406 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6407 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6408 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6412 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6413 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6414 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6415 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6419 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6420 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6421 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6422 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6426 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6427 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6428 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6429 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6433 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6434 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6435 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6436 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6440 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6441 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6442 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6443 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6447 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6448 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6449 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6450 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6454 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6455 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6456 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6457 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6461 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6462 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6463 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6464 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6468 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6469 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6470 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6471 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6475 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6476 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6477 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6478 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6482 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6483 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6484 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6485 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6489 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6490 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6491 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6492 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6496 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6497 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6498 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6499 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6503 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
6504 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6505 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6506 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6508 r
= MsiDoAction( hpkg
, "CostFinalize");
6509 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
6513 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6514 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6515 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6516 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6520 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6521 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6522 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6523 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6527 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6528 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6529 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6530 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6534 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6535 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6536 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6537 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6541 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6542 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6543 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6544 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6548 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6549 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6550 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6551 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6555 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6556 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6557 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6558 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6562 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6563 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6564 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6565 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6569 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6570 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6571 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6572 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6576 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6577 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6578 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6579 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6583 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
6584 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6585 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6586 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6590 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6591 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6592 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6593 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6597 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6598 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6599 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6600 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6604 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6605 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6606 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6607 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6611 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6612 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6613 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6614 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6618 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6619 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6620 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6621 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6625 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6626 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6627 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6628 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6632 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6633 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6634 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6635 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6639 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6640 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6641 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6642 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6646 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6647 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6648 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6649 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6653 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6654 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6655 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6656 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6660 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6661 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6662 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6663 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6667 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6668 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6669 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6670 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6674 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6675 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6676 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6677 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6681 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6682 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6683 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6684 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6688 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6689 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6690 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6691 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6695 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6696 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6697 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6698 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6702 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6703 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6704 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6705 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6709 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6710 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6711 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6712 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6716 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6717 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6718 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6719 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6723 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6724 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6725 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6726 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6730 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6731 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6732 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6733 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6737 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
6738 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6739 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6740 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6742 MsiCloseHandle(hpkg
);
6744 /* reinstall the product */
6745 r
= MsiInstallProduct(msifile3
, "REINSTALL=ALL");
6746 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6748 r
= MsiOpenDatabase(msifile4
, MSIDBOPEN_DIRECT
, &hdb
);
6749 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
6751 /* this property must not be in the saved msi file */
6752 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6753 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
6755 r
= package_from_db( hdb
, &hpkg
);
6756 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
6760 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6761 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6762 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6763 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6767 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6768 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6769 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6770 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6774 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6775 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6776 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6777 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6781 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6782 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6783 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6784 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6788 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6789 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6790 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6791 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6795 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6796 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6797 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6798 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6802 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6803 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6804 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6805 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6809 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6810 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6811 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6812 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6816 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6817 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6818 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6819 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6823 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
6824 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6825 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6826 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6830 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
6831 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6832 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6833 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6837 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6838 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6839 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6840 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6844 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6845 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6846 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6847 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6851 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6852 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6853 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6854 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6858 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6859 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6860 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6861 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6865 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6866 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6867 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6868 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6872 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6873 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6874 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6875 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6879 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6880 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6881 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6882 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6886 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6887 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6888 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6889 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6893 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6894 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6895 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6896 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6900 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6901 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6902 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6903 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6907 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6908 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6909 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6910 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6914 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6915 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6916 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6917 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6921 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6922 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6923 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6924 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6928 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6929 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6930 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6931 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6935 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6936 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6937 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6938 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6942 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6943 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6944 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6945 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6949 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6950 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6951 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6952 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6956 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6957 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6958 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6959 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6963 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6964 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6965 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6966 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6970 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6971 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6972 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6973 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6977 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
6978 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6979 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6980 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6984 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
6985 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6986 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6987 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6989 r
= MsiDoAction( hpkg
, "CostInitialize");
6990 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
6994 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6995 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6996 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6997 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7001 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
7002 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7003 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7004 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7008 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
7009 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7010 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7011 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7015 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
7016 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7017 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7018 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7022 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
7023 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7024 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7025 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7029 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
7030 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7031 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7032 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7036 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
7037 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7038 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7039 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7043 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
7044 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7045 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7046 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7050 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
7051 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7052 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7053 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7057 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
7058 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7059 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7060 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7064 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
7065 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7066 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7067 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7071 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
7072 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7073 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7074 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7078 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
7079 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7080 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7081 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7085 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
7086 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7087 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7088 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7092 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
7093 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7094 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7095 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7099 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
7100 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7101 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7102 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7106 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
7107 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7108 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7109 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7113 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
7114 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7115 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7116 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7120 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
7121 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7122 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7123 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7127 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
7128 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7129 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7130 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7134 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
7135 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7136 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7137 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7141 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
7142 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7143 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7144 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7148 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
7149 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7150 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7151 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7155 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
7156 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7157 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7158 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7162 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
7163 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7164 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7165 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7169 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
7170 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7171 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7172 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7176 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
7177 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7178 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7179 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7183 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
7184 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7185 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7186 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7190 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
7191 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7192 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7193 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7197 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
7198 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7199 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7200 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7204 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
7205 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7206 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7207 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7211 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
7212 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7213 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7214 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7218 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
7219 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7220 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7221 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7223 r
= MsiDoAction( hpkg
, "FileCost");
7224 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
7228 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
7229 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7230 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7231 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7235 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
7236 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7237 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7238 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7242 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
7243 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7244 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7245 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7249 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
7250 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7251 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7252 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7256 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
7257 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7258 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7259 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7263 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
7264 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7265 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7266 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7270 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
7271 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7272 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7273 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7277 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
7278 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7279 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7280 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7284 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
7285 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7286 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7287 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7291 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
7292 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7293 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7294 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7298 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
7299 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7300 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7301 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7305 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
7306 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7307 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7308 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7312 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
7313 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7314 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7315 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7319 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
7320 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7321 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7322 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7326 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
7327 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7328 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7329 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7333 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
7334 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7335 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7336 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7340 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
7341 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7342 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7343 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7347 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
7348 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7349 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7350 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7354 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
7355 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7356 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7357 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7361 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
7362 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7363 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7364 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7368 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
7369 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7370 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7371 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7375 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
7376 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7377 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7378 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7382 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
7383 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7384 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7385 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7389 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
7390 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7391 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7392 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7396 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
7397 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7398 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7399 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7403 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
7404 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7405 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7406 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7410 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
7411 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7412 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7413 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7417 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
7418 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7419 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7420 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7424 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
7425 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7426 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7427 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7431 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
7432 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7433 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7434 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7438 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
7439 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7440 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7441 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7445 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
7446 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7447 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7448 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7452 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
7453 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7454 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
7455 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7457 r
= MsiDoAction( hpkg
, "CostFinalize");
7458 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
7462 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
7463 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7464 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7465 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7469 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
7470 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7471 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7472 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7476 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
7477 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7478 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7479 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7483 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
7484 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7485 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7486 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7490 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
7491 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7492 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7493 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7497 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
7498 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7499 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7500 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7504 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
7505 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7506 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7507 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7511 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
7512 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7513 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7514 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7518 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
7519 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7520 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7521 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7525 r
= MsiGetFeatureState(hpkg
, "ten", &state
, &action
);
7526 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7527 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7528 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
7532 r
= MsiGetFeatureState(hpkg
, "eleven", &state
, &action
);
7533 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7534 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7535 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7539 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
7540 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7541 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7542 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7546 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
7547 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7548 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7549 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7553 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
7554 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7555 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7556 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7560 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
7561 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7562 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7563 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7567 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
7568 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7569 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7570 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7574 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
7575 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7576 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7577 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7581 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
7582 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7583 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7584 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7588 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
7589 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7590 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7591 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7595 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
7596 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7597 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7598 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7602 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
7603 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7604 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
7605 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7609 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
7610 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7611 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7612 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7616 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
7617 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7618 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7619 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7623 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
7624 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7625 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7626 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7630 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
7631 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7632 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7633 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7637 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
7638 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7639 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7640 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7644 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
7645 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7646 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7647 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7651 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
7652 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7653 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7654 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7658 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
7659 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7660 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
7661 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
7665 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
7666 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7667 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7668 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7672 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
7673 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7674 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7675 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7679 r
= MsiGetComponentState(hpkg
, "chi", &state
, &action
);
7680 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7681 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7682 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7686 r
= MsiGetComponentState(hpkg
, "psi", &state
, &action
);
7687 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7688 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
7689 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7691 MsiCloseHandle(hpkg
);
7693 /* uninstall the product */
7694 r
= MsiInstallProduct(msifile4
, "REMOVE=ALL");
7695 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7697 DeleteFileA(msifile
);
7698 DeleteFileA(msifile2
);
7699 DeleteFileA(msifile3
);
7700 DeleteFileA(msifile4
);
7703 static void test_getproperty(void)
7705 MSIHANDLE hPackage
= 0;
7707 static CHAR empty
[] = "";
7711 r
= package_from_db(create_package_db(), &hPackage
);
7712 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
7714 skip("Not enough rights to perform tests\n");
7715 DeleteFile(msifile
);
7718 ok( r
== ERROR_SUCCESS
, "Failed to create package %u\n", r
);
7720 /* set the property */
7721 r
= MsiSetProperty(hPackage
, "Name", "Value");
7722 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7724 /* retrieve the size, NULL pointer */
7726 r
= MsiGetProperty(hPackage
, "Name", NULL
, &size
);
7727 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7728 ok( size
== 5, "Expected 5, got %d\n", size
);
7730 /* retrieve the size, empty string */
7732 r
= MsiGetProperty(hPackage
, "Name", empty
, &size
);
7733 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7734 ok( size
== 5, "Expected 5, got %d\n", size
);
7736 /* don't change size */
7737 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
7738 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
7739 ok( size
== 5, "Expected 5, got %d\n", size
);
7740 ok( !lstrcmp(prop
, "Valu"), "Expected Valu, got %s\n", prop
);
7742 /* increase the size by 1 */
7744 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
7745 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7746 ok( size
== 5, "Expected 5, got %d\n", size
);
7747 ok( !lstrcmp(prop
, "Value"), "Expected Value, got %s\n", prop
);
7749 r
= MsiCloseHandle( hPackage
);
7750 ok( r
== ERROR_SUCCESS
, "Failed to close package\n" );
7751 DeleteFile(msifile
);
7754 static void test_removefiles(void)
7759 INSTALLSTATE installed
, action
;
7761 hdb
= create_package_db();
7762 ok ( hdb
, "failed to create package database\n" );
7764 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
7765 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
7767 r
= create_feature_table( hdb
);
7768 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
7770 r
= create_component_table( hdb
);
7771 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
7773 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
7774 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
7776 r
= add_component_entry( hdb
, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7777 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7779 r
= add_component_entry( hdb
, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7780 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7782 r
= add_component_entry( hdb
, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7783 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7785 r
= add_component_entry( hdb
, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7786 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7788 r
= add_component_entry( hdb
, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7789 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7791 r
= add_component_entry( hdb
, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7792 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7794 r
= add_component_entry( hdb
, "'oxygen', '', 'TARGETDIR', 0, '0', 'oxygen_file'" );
7795 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
7797 r
= create_feature_components_table( hdb
);
7798 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
7800 r
= add_feature_components_entry( hdb
, "'one', 'hydrogen'" );
7801 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7803 r
= add_feature_components_entry( hdb
, "'one', 'helium'" );
7804 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7806 r
= add_feature_components_entry( hdb
, "'one', 'lithium'" );
7807 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7809 r
= add_feature_components_entry( hdb
, "'one', 'beryllium'" );
7810 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7812 r
= add_feature_components_entry( hdb
, "'one', 'boron'" );
7813 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7815 r
= add_feature_components_entry( hdb
, "'one', 'carbon'" );
7816 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7818 r
= add_feature_components_entry( hdb
, "'one', 'oxygen'" );
7819 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
7821 r
= create_file_table( hdb
);
7822 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
7824 r
= add_file_entry( hdb
, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7825 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7827 r
= add_file_entry( hdb
, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7828 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7830 r
= add_file_entry( hdb
, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7831 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7833 r
= add_file_entry( hdb
, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7834 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7836 r
= add_file_entry( hdb
, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7837 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7839 r
= add_file_entry( hdb
, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7840 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7842 r
= add_file_entry( hdb
, "'oxygen_file', 'oxygen', 'oxygen.txt', 0, '', '1033', 16384, 1" );
7843 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
7845 r
= create_remove_file_table( hdb
);
7846 ok( r
== ERROR_SUCCESS
, "cannot create Remove File table: %d\n", r
);
7848 r
= package_from_db( hdb
, &hpkg
);
7849 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
7851 skip("Not enough rights to perform tests\n");
7852 DeleteFile(msifile
);
7855 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
7857 MsiCloseHandle( hdb
);
7859 create_test_file( "hydrogen.txt" );
7860 create_test_file( "helium.txt" );
7861 create_test_file( "lithium.txt" );
7862 create_test_file( "beryllium.txt" );
7863 create_test_file( "boron.txt" );
7864 create_test_file( "carbon.txt" );
7865 create_test_file( "oxygen.txt" );
7867 r
= MsiSetProperty( hpkg
, "TARGETDIR", CURR_DIR
);
7868 ok( r
== ERROR_SUCCESS
, "set property failed\n");
7870 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
7872 r
= MsiGetComponentState( hpkg
, "oxygen", &installed
, &action
);
7873 ok( r
== ERROR_UNKNOWN_COMPONENT
, "expected ERROR_UNKNOWN_COMPONENT, got %u\n", r
);
7875 r
= MsiDoAction( hpkg
, "CostInitialize");
7876 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
7878 r
= MsiDoAction( hpkg
, "FileCost");
7879 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
7881 installed
= action
= 0xdeadbeef;
7882 r
= MsiGetComponentState( hpkg
, "oxygen", &installed
, &action
);
7883 ok( r
== ERROR_SUCCESS
, "failed to get component state %u\n", r
);
7884 ok( installed
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed
);
7885 ok( action
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7887 r
= MsiDoAction( hpkg
, "CostFinalize");
7888 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
7890 r
= MsiDoAction( hpkg
, "InstallValidate");
7891 ok( r
== ERROR_SUCCESS
, "install validate failed\n");
7893 r
= MsiSetComponentState( hpkg
, "hydrogen", INSTALLSTATE_ABSENT
);
7894 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7896 installed
= action
= 0xdeadbeef;
7897 r
= MsiGetComponentState( hpkg
, "hydrogen", &installed
, &action
);
7898 ok( r
== ERROR_SUCCESS
, "failed to get component state %u\n", r
);
7899 ok( installed
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed
);
7900 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7902 r
= MsiSetComponentState( hpkg
, "helium", INSTALLSTATE_LOCAL
);
7903 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7905 r
= MsiSetComponentState( hpkg
, "lithium", INSTALLSTATE_SOURCE
);
7906 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7908 r
= MsiSetComponentState( hpkg
, "beryllium", INSTALLSTATE_ABSENT
);
7909 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7911 r
= MsiSetComponentState( hpkg
, "boron", INSTALLSTATE_LOCAL
);
7912 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7914 r
= MsiSetComponentState( hpkg
, "carbon", INSTALLSTATE_SOURCE
);
7915 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7917 installed
= action
= 0xdeadbeef;
7918 r
= MsiGetComponentState( hpkg
, "oxygen", &installed
, &action
);
7919 ok( r
== ERROR_SUCCESS
, "failed to get component state %u\n", r
);
7920 ok( installed
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed
);
7921 ok( action
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7923 r
= MsiSetComponentState( hpkg
, "oxygen", INSTALLSTATE_ABSENT
);
7924 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
7926 installed
= action
= 0xdeadbeef;
7927 r
= MsiGetComponentState( hpkg
, "oxygen", &installed
, &action
);
7928 ok( r
== ERROR_SUCCESS
, "failed to get component state %u\n", r
);
7929 ok( installed
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed
);
7930 ok( action
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7932 r
= MsiDoAction( hpkg
, "RemoveFiles");
7933 ok( r
== ERROR_SUCCESS
, "remove files failed\n");
7935 installed
= action
= 0xdeadbeef;
7936 r
= MsiGetComponentState( hpkg
, "oxygen", &installed
, &action
);
7937 ok( r
== ERROR_SUCCESS
, "failed to get component state %u\n", r
);
7938 ok( installed
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", installed
);
7939 ok( action
== INSTALLSTATE_UNKNOWN
, "expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
7941 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7942 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7943 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7944 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7945 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7946 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7947 ok(DeleteFileA("oxygen.txt"), "Expected oxygen.txt to exist\n");
7949 MsiCloseHandle( hpkg
);
7950 DeleteFileA(msifile
);
7953 static void test_appsearch(void)
7958 CHAR prop
[MAX_PATH
];
7961 hdb
= create_package_db();
7962 ok ( hdb
, "failed to create package database\n" );
7964 r
= create_appsearch_table( hdb
);
7965 ok( r
== ERROR_SUCCESS
, "cannot create AppSearch table: %d\n", r
);
7967 r
= add_appsearch_entry( hdb
, "'WEBBROWSERPROG', 'NewSignature1'" );
7968 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
7970 r
= add_appsearch_entry( hdb
, "'NOTEPAD', 'NewSignature2'" );
7971 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
7973 r
= create_reglocator_table( hdb
);
7974 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7976 r
= add_reglocator_entry( hdb
, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7977 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7979 r
= create_drlocator_table( hdb
);
7980 ok( r
== ERROR_SUCCESS
, "cannot create DrLocator table: %d\n", r
);
7982 r
= add_drlocator_entry( hdb
, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7983 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7985 r
= create_signature_table( hdb
);
7986 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
7988 r
= add_signature_entry( hdb
, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7989 ok( r
== ERROR_SUCCESS
, "cannot add signature: %d\n", r
);
7991 r
= add_signature_entry( hdb
, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7992 ok( r
== ERROR_SUCCESS
, "cannot add signature: %d\n", r
);
7994 r
= package_from_db( hdb
, &hpkg
);
7995 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
7997 skip("Not enough rights to perform tests\n");
7998 DeleteFile(msifile
);
8001 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
8002 MsiCloseHandle( hdb
);
8003 if (r
!= ERROR_SUCCESS
)
8006 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
8008 r
= MsiDoAction( hpkg
, "AppSearch" );
8009 ok( r
== ERROR_SUCCESS
, "AppSearch failed: %d\n", r
);
8011 size
= sizeof(prop
);
8012 r
= MsiGetPropertyA( hpkg
, "WEBBROWSERPROG", prop
, &size
);
8013 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
8014 ok( lstrlenA(prop
) != 0, "Expected non-zero length\n");
8016 size
= sizeof(prop
);
8017 r
= MsiGetPropertyA( hpkg
, "NOTEPAD", prop
, &size
);
8018 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
8021 MsiCloseHandle( hpkg
);
8022 DeleteFileA(msifile
);
8025 static void test_appsearch_complocator(void)
8027 MSIHANDLE hpkg
, hdb
;
8028 CHAR path
[MAX_PATH
];
8029 CHAR prop
[MAX_PATH
];
8034 if (!(usersid
= get_user_sid()))
8037 if (is_process_limited())
8039 skip("process is limited\n");
8043 create_test_file("FileName1");
8044 create_test_file("FileName4");
8045 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE
,
8046 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL
, FALSE
);
8048 create_test_file("FileName2");
8049 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED
,
8050 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid
, FALSE
);
8052 create_test_file("FileName3");
8053 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED
,
8054 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid
, FALSE
);
8056 create_test_file("FileName5");
8057 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE
,
8058 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL
, TRUE
);
8060 create_test_file("FileName6");
8061 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE
,
8062 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL
, TRUE
);
8064 create_test_file("FileName7");
8065 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE
,
8066 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL
, FALSE
);
8068 /* dir is FALSE, but we're pretending it's a directory */
8069 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE
,
8070 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL
, FALSE
);
8072 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8073 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE
,
8074 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL
, FALSE
);
8076 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8077 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE
,
8078 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL
, FALSE
);
8080 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8081 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE
,
8082 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL
, FALSE
);
8084 hdb
= create_package_db();
8085 ok(hdb
, "Expected a valid database handle\n");
8087 r
= create_appsearch_table(hdb
);
8088 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8090 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8091 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8093 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8094 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8096 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8097 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8099 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8100 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8102 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8103 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8105 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8106 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8108 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8109 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8111 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8112 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8114 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8115 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8117 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8120 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8121 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8123 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
8124 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8126 r
= create_complocator_table(hdb
);
8127 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8129 /* published component, machine, file, signature, misdbLocatorTypeFile */
8130 r
= add_complocator_entry(hdb
, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
8131 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8133 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
8134 r
= add_complocator_entry(hdb
, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
8135 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8137 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
8138 r
= add_complocator_entry(hdb
, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
8139 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8141 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
8142 r
= add_complocator_entry(hdb
, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
8143 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8145 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
8146 r
= add_complocator_entry(hdb
, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
8147 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8149 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
8150 r
= add_complocator_entry(hdb
, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
8151 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8153 /* published component, machine, file, no signature, misdbLocatorTypeFile */
8154 r
= add_complocator_entry(hdb
, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
8155 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8157 /* unpublished component, no signature, misdbLocatorTypeDir */
8158 r
= add_complocator_entry(hdb
, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
8159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8161 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
8162 r
= add_complocator_entry(hdb
, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
8163 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8165 /* published component, signature w/ ver, misdbLocatorTypeFile */
8166 r
= add_complocator_entry(hdb
, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
8167 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8169 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
8170 r
= add_complocator_entry(hdb
, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
8171 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8173 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
8174 r
= add_complocator_entry(hdb
, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
8175 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8177 r
= create_signature_table(hdb
);
8178 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8180 r
= add_signature_entry(hdb
, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
8181 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8183 r
= add_signature_entry(hdb
, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
8184 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8186 r
= add_signature_entry(hdb
, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
8187 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8189 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
8190 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8192 r
= add_signature_entry(hdb
, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
8193 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8195 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8196 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8198 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8199 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8201 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8202 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8204 r
= package_from_db(hdb
, &hpkg
);
8205 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
8207 skip("Not enough rights to perform tests\n");
8210 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
8212 r
= MsiSetPropertyA(hpkg
, "SIGPROP8", "october");
8213 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8215 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
8217 r
= MsiDoAction(hpkg
, "AppSearch");
8218 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8221 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8222 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8223 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8224 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8227 sprintf(path
, "%s\\FileName2", CURR_DIR
);
8228 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8229 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8230 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8233 sprintf(path
, "%s\\FileName3", CURR_DIR
);
8234 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8235 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8236 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8239 sprintf(path
, "%s\\FileName4", CURR_DIR
);
8240 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
8241 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8242 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8245 sprintf(path
, "%s\\FileName5", CURR_DIR
);
8246 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8247 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8248 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8251 sprintf(path
, "%s\\", CURR_DIR
);
8252 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8253 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8254 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8257 sprintf(path
, "%s\\", CURR_DIR
);
8258 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8259 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8260 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8263 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8264 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8265 ok(!lstrcmpA(prop
, "october"), "Expected \"october\", got \"%s\"\n", prop
);
8268 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8269 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8270 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8273 sprintf(path
, "%s\\FileName8.dll", CURR_DIR
);
8274 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8275 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8276 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8279 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8280 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8281 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8284 sprintf(path
, "%s\\FileName10.dll", CURR_DIR
);
8285 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
8286 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8287 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8289 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
8290 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8291 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
8292 MSIINSTALLCONTEXT_USERUNMANAGED
, usersid
);
8293 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
8294 MSIINSTALLCONTEXT_USERMANAGED
, usersid
);
8295 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
8296 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8297 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
8298 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8299 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
8300 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8301 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
8302 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8303 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
8304 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8305 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
8306 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8307 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
8308 MSIINSTALLCONTEXT_MACHINE
, NULL
);
8310 MsiCloseHandle(hpkg
);
8313 DeleteFileA("FileName1");
8314 DeleteFileA("FileName2");
8315 DeleteFileA("FileName3");
8316 DeleteFileA("FileName4");
8317 DeleteFileA("FileName5");
8318 DeleteFileA("FileName6");
8319 DeleteFileA("FileName7");
8320 DeleteFileA("FileName8.dll");
8321 DeleteFileA("FileName9.dll");
8322 DeleteFileA("FileName10.dll");
8323 DeleteFileA(msifile
);
8327 static void test_appsearch_reglocator(void)
8329 MSIHANDLE hpkg
, hdb
;
8330 CHAR path
[MAX_PATH
], prop
[MAX_PATH
];
8331 DWORD binary
[2], size
, val
;
8332 BOOL space
, version
, is_64bit
= sizeof(void *) > sizeof(int);
8333 HKEY hklm
, classes
, hkcu
, users
;
8334 LPSTR pathdata
, pathvar
, ptr
;
8341 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8344 DeleteFileA("test.dll");
8346 res
= RegCreateKeyA(HKEY_CLASSES_ROOT
, "Software\\Wine", &classes
);
8347 if (res
== ERROR_ACCESS_DENIED
)
8349 skip("Not enough rights to perform tests\n");
8352 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8354 res
= RegSetValueExA(classes
, "Value1", 0, REG_SZ
,
8355 (const BYTE
*)"regszdata", 10);
8356 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8358 res
= RegCreateKeyA(HKEY_CURRENT_USER
, "Software\\Wine", &hkcu
);
8359 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8361 res
= RegSetValueExA(hkcu
, "Value1", 0, REG_SZ
,
8362 (const BYTE
*)"regszdata", 10);
8363 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8366 res
= RegCreateKeyA(HKEY_USERS
, "S-1-5-18\\Software\\Wine", &users
);
8367 ok(res
== ERROR_SUCCESS
||
8368 broken(res
== ERROR_INVALID_PARAMETER
),
8369 "Expected ERROR_SUCCESS, got %d\n", res
);
8371 if (res
== ERROR_SUCCESS
)
8373 res
= RegSetValueExA(users
, "Value1", 0, REG_SZ
,
8374 (const BYTE
*)"regszdata", 10);
8375 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8378 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine", &hklm
);
8379 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8381 res
= RegSetValueA(hklm
, NULL
, REG_SZ
, "defvalue", 8);
8382 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8384 res
= RegSetValueExA(hklm
, "Value1", 0, REG_SZ
,
8385 (const BYTE
*)"regszdata", 10);
8386 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8389 res
= RegSetValueExA(hklm
, "Value2", 0, REG_DWORD
,
8390 (const BYTE
*)&val
, sizeof(DWORD
));
8391 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8394 res
= RegSetValueExA(hklm
, "Value3", 0, REG_DWORD
,
8395 (const BYTE
*)&val
, sizeof(DWORD
));
8396 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8398 res
= RegSetValueExA(hklm
, "Value4", 0, REG_EXPAND_SZ
,
8399 (const BYTE
*)"%PATH%", 7);
8400 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8402 res
= RegSetValueExA(hklm
, "Value5", 0, REG_EXPAND_SZ
,
8403 (const BYTE
*)"my%NOVAR%", 10);
8404 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8406 res
= RegSetValueExA(hklm
, "Value6", 0, REG_MULTI_SZ
,
8407 (const BYTE
*)"one\0two\0", 9);
8408 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8410 binary
[0] = 0x1234abcd;
8411 binary
[1] = 0x567890ef;
8412 res
= RegSetValueExA(hklm
, "Value7", 0, REG_BINARY
,
8413 (const BYTE
*)binary
, sizeof(binary
));
8414 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8416 res
= RegSetValueExA(hklm
, "Value8", 0, REG_SZ
,
8417 (const BYTE
*)"#regszdata", 11);
8418 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8420 create_test_file("FileName1");
8421 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8422 res
= RegSetValueExA(hklm
, "Value9", 0, REG_SZ
,
8423 (const BYTE
*)path
, lstrlenA(path
) + 1);
8424 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8426 sprintf(path
, "%s\\FileName2", CURR_DIR
);
8427 res
= RegSetValueExA(hklm
, "Value10", 0, REG_SZ
,
8428 (const BYTE
*)path
, lstrlenA(path
) + 1);
8429 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8431 lstrcpyA(path
, CURR_DIR
);
8432 res
= RegSetValueExA(hklm
, "Value11", 0, REG_SZ
,
8433 (const BYTE
*)path
, lstrlenA(path
) + 1);
8434 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8436 res
= RegSetValueExA(hklm
, "Value12", 0, REG_SZ
,
8437 (const BYTE
*)"", 1);
8438 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8440 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8441 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8442 res
= RegSetValueExA(hklm
, "Value13", 0, REG_SZ
,
8443 (const BYTE
*)path
, lstrlenA(path
) + 1);
8444 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8446 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8447 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
8448 res
= RegSetValueExA(hklm
, "Value14", 0, REG_SZ
,
8449 (const BYTE
*)path
, lstrlenA(path
) + 1);
8450 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8452 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8453 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
8454 res
= RegSetValueExA(hklm
, "Value15", 0, REG_SZ
,
8455 (const BYTE
*)path
, lstrlenA(path
) + 1);
8456 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
8458 sprintf(path
, "\"%s\\FileName1\" -option", CURR_DIR
);
8459 res
= RegSetValueExA(hklm
, "value16", 0, REG_SZ
,
8460 (const BYTE
*)path
, lstrlenA(path
) + 1);
8461 ok( res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", res
);
8463 space
= (strchr(CURR_DIR
, ' ')) ? TRUE
: FALSE
;
8464 sprintf(path
, "%s\\FileName1 -option", CURR_DIR
);
8465 res
= RegSetValueExA(hklm
, "value17", 0, REG_SZ
,
8466 (const BYTE
*)path
, lstrlenA(path
) + 1);
8467 ok( res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", res
);
8469 hdb
= create_package_db();
8470 ok(hdb
, "Expected a valid database handle\n");
8472 r
= create_appsearch_table(hdb
);
8473 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8475 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8476 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8478 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8479 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8481 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8484 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8485 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8487 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8488 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8490 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8493 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8494 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8496 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8497 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8499 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8500 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8502 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8503 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8505 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8506 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8508 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
8509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8511 r
= add_appsearch_entry(hdb
, "'SIGPROP13', 'NewSignature13'");
8512 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8514 r
= add_appsearch_entry(hdb
, "'SIGPROP14', 'NewSignature14'");
8515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8517 r
= add_appsearch_entry(hdb
, "'SIGPROP15', 'NewSignature15'");
8518 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8520 r
= add_appsearch_entry(hdb
, "'SIGPROP16', 'NewSignature16'");
8521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8523 r
= add_appsearch_entry(hdb
, "'SIGPROP17', 'NewSignature17'");
8524 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8526 r
= add_appsearch_entry(hdb
, "'SIGPROP18', 'NewSignature18'");
8527 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8529 r
= add_appsearch_entry(hdb
, "'SIGPROP19', 'NewSignature19'");
8530 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8532 r
= add_appsearch_entry(hdb
, "'SIGPROP20', 'NewSignature20'");
8533 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8535 r
= add_appsearch_entry(hdb
, "'SIGPROP21', 'NewSignature21'");
8536 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8538 r
= add_appsearch_entry(hdb
, "'SIGPROP22', 'NewSignature22'");
8539 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8541 r
= add_appsearch_entry(hdb
, "'SIGPROP23', 'NewSignature23'");
8542 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8544 r
= add_appsearch_entry(hdb
, "'SIGPROP24', 'NewSignature24'");
8545 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8547 r
= add_appsearch_entry(hdb
, "'SIGPROP25', 'NewSignature25'");
8548 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8550 r
= add_appsearch_entry(hdb
, "'SIGPROP26', 'NewSignature26'");
8551 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8553 r
= add_appsearch_entry(hdb
, "'SIGPROP27', 'NewSignature27'");
8554 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8556 r
= add_appsearch_entry(hdb
, "'SIGPROP28', 'NewSignature28'");
8557 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8559 r
= add_appsearch_entry(hdb
, "'SIGPROP29', 'NewSignature29'");
8560 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8562 r
= add_appsearch_entry(hdb
, "'SIGPROP30', 'NewSignature30'");
8563 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8565 r
= create_reglocator_table(hdb
);
8566 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8568 type
= msidbLocatorTypeRawValue
;
8570 type
|= msidbLocatorType64bit
;
8572 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8573 r
= add_reglocator_entry(hdb
, "NewSignature1", 2, "Software\\Wine", "Value1", type
);
8574 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8576 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8577 r
= add_reglocator_entry(hdb
, "NewSignature2", 2, "Software\\Wine", "Value2", type
);
8578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8580 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8581 r
= add_reglocator_entry(hdb
, "NewSignature3", 2, "Software\\Wine", "Value3", type
);
8582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8584 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8585 r
= add_reglocator_entry(hdb
, "NewSignature4", 2, "Software\\Wine", "Value4", type
);
8586 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8588 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8589 r
= add_reglocator_entry(hdb
, "NewSignature5", 2, "Software\\Wine", "Value5", type
);
8590 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8592 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8593 r
= add_reglocator_entry(hdb
, "NewSignature6", 2, "Software\\Wine", "Value6", type
);
8594 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8596 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8597 r
= add_reglocator_entry(hdb
, "NewSignature7", 2, "Software\\Wine", "Value7", type
);
8598 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8600 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8601 r
= add_reglocator_entry(hdb
, "NewSignature8", 2, "Software\\Wine", "Value8", type
);
8602 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8604 type
= msidbLocatorTypeFileName
;
8606 type
|= msidbLocatorType64bit
;
8608 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8609 r
= add_reglocator_entry(hdb
, "NewSignature9", 2, "Software\\Wine", "Value9", type
);
8610 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8612 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8613 r
= add_reglocator_entry(hdb
, "NewSignature10", 2, "Software\\Wine", "Value10", type
);
8614 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8616 /* HKLM, msidbLocatorTypeFileName, no signature */
8617 r
= add_reglocator_entry(hdb
, "NewSignature11", 2, "Software\\Wine", "Value9", type
);
8618 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8620 type
= msidbLocatorTypeDirectory
;
8622 type
|= msidbLocatorType64bit
;
8624 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8625 r
= add_reglocator_entry(hdb
, "NewSignature12", 2, "Software\\Wine", "Value9", type
);
8626 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8628 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8629 r
= add_reglocator_entry(hdb
, "NewSignature13", 2, "Software\\Wine", "Value11", type
);
8630 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8632 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8633 r
= add_reglocator_entry(hdb
, "NewSignature14", 2, "Software\\Wine", "Value9", type
);
8634 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8636 type
= msidbLocatorTypeRawValue
;
8638 type
|= msidbLocatorType64bit
;
8640 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8641 r
= add_reglocator_entry(hdb
, "NewSignature15", 0, "Software\\Wine", "Value1", type
);
8642 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8644 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8645 r
= add_reglocator_entry(hdb
, "NewSignature16", 1, "Software\\Wine", "Value1", type
);
8646 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8648 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8649 r
= add_reglocator_entry(hdb
, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type
);
8650 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8652 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8653 r
= add_reglocator_entry(hdb
, "NewSignature18", 2, "Software\\Wine", "", type
);
8654 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8656 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8657 r
= add_reglocator_entry(hdb
, "NewSignature19", 2, "Software\\IDontExist", "", type
);
8658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8660 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8661 r
= add_reglocator_entry(hdb
, "NewSignature20", 2, "Software\\Wine", "Value12", type
);
8662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8664 type
= msidbLocatorTypeFileName
;
8666 type
|= msidbLocatorType64bit
;
8668 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8669 r
= add_reglocator_entry(hdb
, "NewSignature21", 2, "Software\\Wine", "Value13", type
);
8670 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8672 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8673 r
= add_reglocator_entry(hdb
, "NewSignature22", 2, "Software\\Wine", "Value14", type
);
8674 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8676 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8677 r
= add_reglocator_entry(hdb
, "NewSignature23", 2, "Software\\Wine", "Value15", type
);
8678 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8680 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8681 r
= add_reglocator_entry(hdb
, "NewSignature24", 2, "Software\\Wine", "Value11", type
);
8682 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8684 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8685 r
= add_reglocator_entry(hdb
, "NewSignature25", 2, "Software\\Wine", "Value10", type
);
8686 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8688 type
= msidbLocatorTypeDirectory
;
8690 type
|= msidbLocatorType64bit
;
8692 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8693 r
= add_reglocator_entry(hdb
, "NewSignature26", 2, "Software\\Wine", "Value11", type
);
8694 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8696 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8697 r
= add_reglocator_entry(hdb
, "NewSignature27", 2, "Software\\Wine", "Value10", type
);
8698 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8700 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8701 r
= add_reglocator_entry(hdb
, "NewSignature28", 2, "Software\\Wine", "Value10", type
);
8702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8704 type
= msidbLocatorTypeFileName
;
8706 type
|= msidbLocatorType64bit
;
8708 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8709 r
= add_reglocator_entry(hdb
, "NewSignature29", 2, "Software\\Wine", "Value16", type
);
8710 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8712 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8713 r
= add_reglocator_entry(hdb
, "NewSignature30", 2, "Software\\Wine", "Value17", type
);
8714 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8716 r
= create_signature_table(hdb
);
8717 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8719 str
= "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8720 r
= add_signature_entry(hdb
, str
);
8721 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8723 str
= "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8724 r
= add_signature_entry(hdb
, str
);
8725 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8727 str
= "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8728 r
= add_signature_entry(hdb
, str
);
8729 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8731 str
= "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8732 r
= add_signature_entry(hdb
, str
);
8733 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8735 str
= "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8736 r
= add_signature_entry(hdb
, str
);
8737 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8739 str
= "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8740 r
= add_signature_entry(hdb
, str
);
8741 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8743 ptr
= strrchr(CURR_DIR
, '\\') + 1;
8744 sprintf(path
, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr
);
8745 r
= add_signature_entry(hdb
, path
);
8746 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8748 str
= "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8749 r
= add_signature_entry(hdb
, str
);
8750 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8752 str
= "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8753 r
= add_signature_entry(hdb
, str
);
8754 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8756 str
= "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8757 r
= add_signature_entry(hdb
, str
);
8758 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8760 r
= package_from_db(hdb
, &hpkg
);
8761 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
8763 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
8765 r
= MsiDoAction(hpkg
, "AppSearch");
8766 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8769 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8770 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8771 ok(!lstrcmpA(prop
, "regszdata"),
8772 "Expected \"regszdata\", got \"%s\"\n", prop
);
8775 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8776 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8777 ok(!lstrcmpA(prop
, "#42"), "Expected \"#42\", got \"%s\"\n", prop
);
8780 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8781 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8782 ok(!lstrcmpA(prop
, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop
);
8784 memset(&si
, 0, sizeof(si
));
8785 if (pGetNativeSystemInfo
) pGetNativeSystemInfo(&si
);
8787 if (S(U(si
)).wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_INTEL
)
8789 size
= ExpandEnvironmentStringsA("%PATH%", NULL
, 0);
8790 pathvar
= HeapAlloc(GetProcessHeap(), 0, size
);
8791 ExpandEnvironmentStringsA("%PATH%", pathvar
, size
);
8794 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", NULL
, &size
);
8795 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8797 pathdata
= HeapAlloc(GetProcessHeap(), 0, ++size
);
8798 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", pathdata
, &size
);
8799 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8800 ok(!lstrcmpA(pathdata
, pathvar
),
8801 "Expected \"%s\", got \"%s\"\n", pathvar
, pathdata
);
8803 HeapFree(GetProcessHeap(), 0, pathvar
);
8804 HeapFree(GetProcessHeap(), 0, pathdata
);
8808 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8809 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8811 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop
);
8814 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8815 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8818 ok(!memcmp(prop
, "\0one\0two\0\0", 10),
8819 "Expected \"\\0one\\0two\\0\\0\"\n");
8823 lstrcpyA(path
, "#xCDAB3412EF907856");
8824 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8826 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8829 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8830 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8831 ok(!lstrcmpA(prop
, "##regszdata"),
8832 "Expected \"##regszdata\", got \"%s\"\n", prop
);
8835 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8836 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8837 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8838 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8841 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8842 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8843 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8846 sprintf(path
, "%s\\", CURR_DIR
);
8847 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8848 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8849 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8852 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
8853 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8854 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8857 sprintf(path
, "%s\\", CURR_DIR
);
8858 r
= MsiGetPropertyA(hpkg
, "SIGPROP13", prop
, &size
);
8859 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8860 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8863 r
= MsiGetPropertyA(hpkg
, "SIGPROP14", prop
, &size
);
8864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8865 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8868 r
= MsiGetPropertyA(hpkg
, "SIGPROP15", prop
, &size
);
8869 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8870 ok(!lstrcmpA(prop
, "regszdata"),
8871 "Expected \"regszdata\", got \"%s\"\n", prop
);
8874 r
= MsiGetPropertyA(hpkg
, "SIGPROP16", prop
, &size
);
8875 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8876 ok(!lstrcmpA(prop
, "regszdata"),
8877 "Expected \"regszdata\", got \"%s\"\n", prop
);
8882 r
= MsiGetPropertyA(hpkg
, "SIGPROP17", prop
, &size
);
8883 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8884 ok(!lstrcmpA(prop
, "regszdata"),
8885 "Expected \"regszdata\", got \"%s\"\n", prop
);
8889 r
= MsiGetPropertyA(hpkg
, "SIGPROP18", prop
, &size
);
8890 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8891 ok(!lstrcmpA(prop
, "defvalue"),
8892 "Expected \"defvalue\", got \"%s\"\n", prop
);
8895 r
= MsiGetPropertyA(hpkg
, "SIGPROP19", prop
, &size
);
8896 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8897 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8900 r
= MsiGetPropertyA(hpkg
, "SIGPROP20", prop
, &size
);
8901 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8902 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8907 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8908 r
= MsiGetPropertyA(hpkg
, "SIGPROP21", prop
, &size
);
8909 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8910 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8913 r
= MsiGetPropertyA(hpkg
, "SIGPROP22", prop
, &size
);
8914 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8915 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8918 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
8919 r
= MsiGetPropertyA(hpkg
, "SIGPROP23", prop
, &size
);
8920 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8921 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8925 lstrcpyA(path
, CURR_DIR
);
8926 ptr
= strrchr(path
, '\\') + 1;
8928 r
= MsiGetPropertyA(hpkg
, "SIGPROP24", prop
, &size
);
8929 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8930 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8933 sprintf(path
, "%s\\", CURR_DIR
);
8934 r
= MsiGetPropertyA(hpkg
, "SIGPROP25", prop
, &size
);
8935 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8936 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8939 r
= MsiGetPropertyA(hpkg
, "SIGPROP26", prop
, &size
);
8940 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8941 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8944 r
= MsiGetPropertyA(hpkg
, "SIGPROP27", prop
, &size
);
8945 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8946 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8949 r
= MsiGetPropertyA(hpkg
, "SIGPROP28", prop
, &size
);
8950 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8951 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8954 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8955 r
= MsiGetPropertyA(hpkg
, "SIGPROP29", prop
, &size
);
8956 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8957 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8960 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8961 r
= MsiGetPropertyA(hpkg
, "SIGPROP30", prop
, &size
);
8962 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8964 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8966 todo_wine
ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8968 RegSetValueA(hklm
, NULL
, REG_SZ
, "", 0);
8969 RegDeleteValueA(hklm
, "Value1");
8970 RegDeleteValueA(hklm
, "Value2");
8971 RegDeleteValueA(hklm
, "Value3");
8972 RegDeleteValueA(hklm
, "Value4");
8973 RegDeleteValueA(hklm
, "Value5");
8974 RegDeleteValueA(hklm
, "Value6");
8975 RegDeleteValueA(hklm
, "Value7");
8976 RegDeleteValueA(hklm
, "Value8");
8977 RegDeleteValueA(hklm
, "Value9");
8978 RegDeleteValueA(hklm
, "Value10");
8979 RegDeleteValueA(hklm
, "Value11");
8980 RegDeleteValueA(hklm
, "Value12");
8981 RegDeleteValueA(hklm
, "Value13");
8982 RegDeleteValueA(hklm
, "Value14");
8983 RegDeleteValueA(hklm
, "Value15");
8984 RegDeleteValueA(hklm
, "Value16");
8985 RegDeleteValueA(hklm
, "Value17");
8986 RegDeleteKey(hklm
, "");
8989 RegDeleteValueA(classes
, "Value1");
8990 RegDeleteKeyA(classes
, "");
8991 RegCloseKey(classes
);
8993 RegDeleteValueA(hkcu
, "Value1");
8994 RegDeleteKeyA(hkcu
, "");
8997 RegDeleteValueA(users
, "Value1");
8998 RegDeleteKeyA(users
, "");
9001 DeleteFileA("FileName1");
9002 DeleteFileA("FileName3.dll");
9003 DeleteFileA("FileName4.dll");
9004 DeleteFileA("FileName5.dll");
9005 MsiCloseHandle(hpkg
);
9006 DeleteFileA(msifile
);
9009 static void delete_win_ini(LPCSTR file
)
9011 CHAR path
[MAX_PATH
];
9013 GetWindowsDirectoryA(path
, MAX_PATH
);
9014 lstrcatA(path
, "\\");
9015 lstrcatA(path
, file
);
9020 static void test_appsearch_inilocator(void)
9022 MSIHANDLE hpkg
, hdb
;
9023 CHAR path
[MAX_PATH
];
9024 CHAR prop
[MAX_PATH
];
9032 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9035 DeleteFileA("test.dll");
9037 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
9039 create_test_file("FileName1");
9040 sprintf(path
, "%s\\FileName1", CURR_DIR
);
9041 WritePrivateProfileStringA("Section", "Key2", path
, "IniFile.ini");
9043 WritePrivateProfileStringA("Section", "Key3", CURR_DIR
, "IniFile.ini");
9045 sprintf(path
, "%s\\IDontExist", CURR_DIR
);
9046 WritePrivateProfileStringA("Section", "Key4", path
, "IniFile.ini");
9048 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9049 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
9050 WritePrivateProfileStringA("Section", "Key5", path
, "IniFile.ini");
9052 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9053 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
9054 WritePrivateProfileStringA("Section", "Key6", path
, "IniFile.ini");
9056 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9057 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
9058 WritePrivateProfileStringA("Section", "Key7", path
, "IniFile.ini");
9060 hdb
= create_package_db();
9061 ok(hdb
, "Expected a valid database handle\n");
9063 r
= create_appsearch_table(hdb
);
9064 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9066 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
9067 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9069 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
9070 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9072 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
9073 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9075 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
9076 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9078 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
9079 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9081 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
9082 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9084 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
9085 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9087 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
9088 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9090 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
9091 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9093 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
9094 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9096 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
9097 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9099 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
9100 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9102 r
= create_inilocator_table(hdb
);
9103 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9105 /* msidbLocatorTypeRawValue, field 1 */
9106 str
= "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
9107 r
= add_inilocator_entry(hdb
, str
);
9108 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9110 /* msidbLocatorTypeRawValue, field 2 */
9111 str
= "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
9112 r
= add_inilocator_entry(hdb
, str
);
9113 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9115 /* msidbLocatorTypeRawValue, entire field */
9116 str
= "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
9117 r
= add_inilocator_entry(hdb
, str
);
9118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9120 /* msidbLocatorTypeFile */
9121 str
= "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9122 r
= add_inilocator_entry(hdb
, str
);
9123 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9125 /* msidbLocatorTypeDirectory, file */
9126 str
= "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9127 r
= add_inilocator_entry(hdb
, str
);
9128 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9130 /* msidbLocatorTypeDirectory, directory */
9131 str
= "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9132 r
= add_inilocator_entry(hdb
, str
);
9133 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9135 /* msidbLocatorTypeFile, file, no signature */
9136 str
= "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9137 r
= add_inilocator_entry(hdb
, str
);
9138 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9140 /* msidbLocatorTypeFile, dir, no signature */
9141 str
= "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9142 r
= add_inilocator_entry(hdb
, str
);
9143 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9145 /* msidbLocatorTypeFile, file does not exist */
9146 str
= "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9147 r
= add_inilocator_entry(hdb
, str
);
9148 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9150 /* msidbLocatorTypeFile, signature with version */
9151 str
= "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9152 r
= add_inilocator_entry(hdb
, str
);
9153 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9155 /* msidbLocatorTypeFile, signature with version, ver > max */
9156 str
= "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
9157 r
= add_inilocator_entry(hdb
, str
);
9158 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9160 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
9161 str
= "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9162 r
= add_inilocator_entry(hdb
, str
);
9163 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9165 r
= create_signature_table(hdb
);
9166 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9168 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9169 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9171 r
= add_signature_entry(hdb
, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9172 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9174 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9175 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9177 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9178 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9180 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9181 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9183 r
= package_from_db(hdb
, &hpkg
);
9184 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9186 skip("Not enough rights to perform tests\n");
9189 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
9191 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9193 r
= MsiDoAction(hpkg
, "AppSearch");
9194 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9197 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
9198 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9199 ok(!lstrcmpA(prop
, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop
);
9202 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
9203 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9204 ok(!lstrcmpA(prop
, "field2"), "Expected \"field2\", got \"%s\"\n", prop
);
9207 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
9208 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9209 ok(!lstrcmpA(prop
, "keydata,field2"),
9210 "Expected \"keydata,field2\", got \"%s\"\n", prop
);
9213 sprintf(path
, "%s\\FileName1", CURR_DIR
);
9214 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
9215 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9216 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9219 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
9220 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9221 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9224 sprintf(path
, "%s\\", CURR_DIR
);
9225 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
9226 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9227 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9230 sprintf(path
, "%s\\", CURR_DIR
);
9231 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
9232 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9233 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9236 lstrcpyA(path
, CURR_DIR
);
9237 ptr
= strrchr(path
, '\\');
9239 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
9240 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9241 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9244 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
9245 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9246 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9251 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
9252 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
9253 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9254 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9257 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
9258 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9259 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9262 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
9263 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
9264 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9265 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9268 MsiCloseHandle(hpkg
);
9271 delete_win_ini("IniFile.ini");
9272 DeleteFileA("FileName1");
9273 DeleteFileA("FileName2.dll");
9274 DeleteFileA("FileName3.dll");
9275 DeleteFileA("FileName4.dll");
9276 DeleteFileA(msifile
);
9280 * MSI AppSearch action on DrLocator table always returns absolute paths.
9281 * If a relative path was set, it returns the first absolute path that
9282 * matches or an empty string if it didn't find anything.
9283 * This helper function replicates this behaviour.
9285 static void search_absolute_directory(LPSTR absolute
, LPCSTR relative
)
9290 size
= lstrlenA(relative
);
9291 drives
= GetLogicalDrives();
9292 lstrcpyA(absolute
, "A:\\");
9293 for (i
= 0; i
< 26; absolute
[0] = '\0', i
++)
9295 if (!(drives
& (1 << i
)))
9298 absolute
[0] = 'A' + i
;
9299 if (GetDriveType(absolute
) != DRIVE_FIXED
)
9302 lstrcpynA(absolute
+ 3, relative
, size
+ 1);
9303 attr
= GetFileAttributesA(absolute
);
9304 if (attr
!= INVALID_FILE_ATTRIBUTES
&&
9305 (attr
& FILE_ATTRIBUTE_DIRECTORY
))
9307 if (absolute
[3 + size
- 1] != '\\')
9308 lstrcatA(absolute
, "\\");
9315 static void test_appsearch_drlocator(void)
9317 MSIHANDLE hpkg
, hdb
;
9318 CHAR path
[MAX_PATH
];
9319 CHAR prop
[MAX_PATH
];
9326 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9329 DeleteFileA("test.dll");
9331 create_test_file("FileName1");
9332 CreateDirectoryA("one", NULL
);
9333 CreateDirectoryA("one\\two", NULL
);
9334 CreateDirectoryA("one\\two\\three", NULL
);
9335 create_test_file("one\\two\\three\\FileName2");
9336 CreateDirectoryA("another", NULL
);
9337 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9338 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9339 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9341 hdb
= create_package_db();
9342 ok(hdb
, "Expected a valid database handle\n");
9344 r
= create_appsearch_table(hdb
);
9345 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9347 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
9348 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9350 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
9351 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9353 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
9354 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9356 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
9357 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9359 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
9360 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9362 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
9363 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9365 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
9366 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9368 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
9369 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9371 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
9372 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9374 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
9375 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9377 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
9378 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9380 r
= add_appsearch_entry(hdb
, "'SIGPROP13', 'NewSignature13'");
9381 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9383 r
= create_drlocator_table(hdb
);
9384 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9386 /* no parent, full path, depth 0, signature */
9387 sprintf(path
, "'NewSignature1', '', '%s', 0", CURR_DIR
);
9388 r
= add_drlocator_entry(hdb
, path
);
9389 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9391 /* no parent, full path, depth 0, no signature */
9392 sprintf(path
, "'NewSignature2', '', '%s', 0", CURR_DIR
);
9393 r
= add_drlocator_entry(hdb
, path
);
9394 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9396 /* no parent, relative path, depth 0, no signature */
9397 sprintf(path
, "'NewSignature3', '', '%s', 0", CURR_DIR
+ 3);
9398 r
= add_drlocator_entry(hdb
, path
);
9399 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9401 /* no parent, full path, depth 2, signature */
9402 sprintf(path
, "'NewSignature4', '', '%s', 2", CURR_DIR
);
9403 r
= add_drlocator_entry(hdb
, path
);
9404 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9406 /* no parent, full path, depth 3, signature */
9407 sprintf(path
, "'NewSignature5', '', '%s', 3", CURR_DIR
);
9408 r
= add_drlocator_entry(hdb
, path
);
9409 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9411 /* no parent, full path, depth 1, signature is dir */
9412 sprintf(path
, "'NewSignature6', '', '%s', 1", CURR_DIR
);
9413 r
= add_drlocator_entry(hdb
, path
);
9414 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9416 /* parent is in DrLocator, relative path, depth 0, signature */
9417 sprintf(path
, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
9418 r
= add_drlocator_entry(hdb
, path
);
9419 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9421 /* no parent, full path, depth 0, signature w/ version */
9422 sprintf(path
, "'NewSignature8', '', '%s', 0", CURR_DIR
);
9423 r
= add_drlocator_entry(hdb
, path
);
9424 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9426 /* no parent, full path, depth 0, signature w/ version, ver > max */
9427 sprintf(path
, "'NewSignature9', '', '%s', 0", CURR_DIR
);
9428 r
= add_drlocator_entry(hdb
, path
);
9429 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9431 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9432 sprintf(path
, "'NewSignature10', '', '%s', 0", CURR_DIR
);
9433 r
= add_drlocator_entry(hdb
, path
);
9434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9436 /* no parent, relative empty path, depth 0, no signature */
9437 sprintf(path
, "'NewSignature11', '', '', 0");
9438 r
= add_drlocator_entry(hdb
, path
);
9439 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9441 r
= create_reglocator_table(hdb
);
9442 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9445 r
= add_reglocator_entry(hdb
, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9446 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9448 /* parent is in RegLocator, no path, depth 0, no signature */
9449 sprintf(path
, "'NewSignature13', 'NewSignature12', '', 0");
9450 r
= add_drlocator_entry(hdb
, path
);
9451 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9453 r
= create_signature_table(hdb
);
9454 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9456 str
= "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9457 r
= add_signature_entry(hdb
, str
);
9458 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9460 str
= "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9461 r
= add_signature_entry(hdb
, str
);
9462 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9464 str
= "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9465 r
= add_signature_entry(hdb
, str
);
9466 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9468 str
= "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9469 r
= add_signature_entry(hdb
, str
);
9470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9472 str
= "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9473 r
= add_signature_entry(hdb
, str
);
9474 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9476 str
= "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9477 r
= add_signature_entry(hdb
, str
);
9478 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9480 str
= "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9481 r
= add_signature_entry(hdb
, str
);
9482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9484 str
= "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9485 r
= add_signature_entry(hdb
, str
);
9486 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9488 r
= package_from_db(hdb
, &hpkg
);
9489 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9491 skip("Not enough rights to perform tests\n");
9494 ok(r
== ERROR_SUCCESS
, "Expected a valid package handle %u\n", r
);
9496 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9498 r
= MsiDoAction(hpkg
, "AppSearch");
9499 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9502 sprintf(path
, "%s\\FileName1", CURR_DIR
);
9503 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
9504 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9505 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9508 sprintf(path
, "%s\\", CURR_DIR
);
9509 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
9510 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9511 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9514 search_absolute_directory(path
, CURR_DIR
+ 3);
9515 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
9516 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9517 ok(!lstrcmpiA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9520 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
9521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9522 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9525 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
9526 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
9527 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9528 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9531 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
9532 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9533 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9536 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
9537 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
9538 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9539 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9544 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
9545 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
9546 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9547 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9550 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
9551 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9552 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9555 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
9556 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9557 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
9561 search_absolute_directory(path
, "");
9562 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
9563 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9564 ok(!lstrcmpiA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
9567 strcpy(path
, "c:\\");
9568 r
= MsiGetPropertyA(hpkg
, "SIGPROP13", prop
, &size
);
9569 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9570 ok(!prop
[0], "Expected \"\", got \"%s\"\n", prop
);
9572 MsiCloseHandle(hpkg
);
9575 DeleteFileA("FileName1");
9576 DeleteFileA("FileName3.dll");
9577 DeleteFileA("FileName4.dll");
9578 DeleteFileA("FileName5.dll");
9579 DeleteFileA("one\\two\\three\\FileName2");
9580 RemoveDirectoryA("one\\two\\three");
9581 RemoveDirectoryA("one\\two");
9582 RemoveDirectoryA("one");
9583 RemoveDirectoryA("another");
9584 DeleteFileA(msifile
);
9587 static void test_featureparents(void)
9592 INSTALLSTATE state
, action
;
9594 hdb
= create_package_db();
9595 ok ( hdb
, "failed to create package database\n" );
9597 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
9598 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
9600 r
= create_feature_table( hdb
);
9601 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
9603 r
= create_component_table( hdb
);
9604 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
9606 r
= create_feature_components_table( hdb
);
9607 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
9609 r
= create_file_table( hdb
);
9610 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
9612 /* msidbFeatureAttributesFavorLocal */
9613 r
= add_feature_entry( hdb
, "'zodiac', '', '', '', 2, 1, '', 0" );
9614 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9616 /* msidbFeatureAttributesFavorSource */
9617 r
= add_feature_entry( hdb
, "'perseus', '', '', '', 2, 1, '', 1" );
9618 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9620 /* msidbFeatureAttributesFavorLocal */
9621 r
= add_feature_entry( hdb
, "'orion', '', '', '', 2, 1, '', 0" );
9622 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9624 /* msidbFeatureAttributesUIDisallowAbsent */
9625 r
= add_feature_entry( hdb
, "'lyra', '', '', '', 2, 1, '', 16" );
9626 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9628 /* disabled because of install level */
9629 r
= add_feature_entry( hdb
, "'waters', '', '', '', 15, 101, '', 9" );
9630 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9632 /* child feature of disabled feature */
9633 r
= add_feature_entry( hdb
, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9634 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
9636 /* component of disabled feature (install level) */
9637 r
= add_component_entry( hdb
, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9638 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9640 /* component of disabled child feature (install level) */
9641 r
= add_component_entry( hdb
, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9642 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9644 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9645 r
= add_component_entry( hdb
, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9646 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9648 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9649 r
= add_component_entry( hdb
, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9650 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9652 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9653 r
= add_component_entry( hdb
, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9654 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9656 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9657 r
= add_component_entry( hdb
, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9658 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9660 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9661 r
= add_component_entry( hdb
, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9662 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9664 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9665 r
= add_component_entry( hdb
, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9666 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9668 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9669 r
= add_component_entry( hdb
, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9670 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9672 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9673 r
= add_component_entry( hdb
, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9674 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
9676 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9677 r
= add_component_entry( hdb
, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9678 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
9680 r
= add_feature_components_entry( hdb
, "'zodiac', 'leo'" );
9681 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9683 r
= add_feature_components_entry( hdb
, "'zodiac', 'virgo'" );
9684 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9686 r
= add_feature_components_entry( hdb
, "'zodiac', 'libra'" );
9687 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9689 r
= add_feature_components_entry( hdb
, "'perseus', 'cassiopeia'" );
9690 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9692 r
= add_feature_components_entry( hdb
, "'perseus', 'cepheus'" );
9693 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9695 r
= add_feature_components_entry( hdb
, "'perseus', 'andromeda'" );
9696 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9698 r
= add_feature_components_entry( hdb
, "'orion', 'leo'" );
9699 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9701 r
= add_feature_components_entry( hdb
, "'orion', 'virgo'" );
9702 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9704 r
= add_feature_components_entry( hdb
, "'orion', 'libra'" );
9705 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9707 r
= add_feature_components_entry( hdb
, "'orion', 'cassiopeia'" );
9708 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9710 r
= add_feature_components_entry( hdb
, "'orion', 'cepheus'" );
9711 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9713 r
= add_feature_components_entry( hdb
, "'orion', 'andromeda'" );
9714 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9716 r
= add_feature_components_entry( hdb
, "'orion', 'canis'" );
9717 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9719 r
= add_feature_components_entry( hdb
, "'orion', 'monoceros'" );
9720 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9722 r
= add_feature_components_entry( hdb
, "'orion', 'lepus'" );
9723 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9725 r
= add_feature_components_entry( hdb
, "'waters', 'delphinus'" );
9726 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9728 r
= add_feature_components_entry( hdb
, "'bayer', 'hydrus'" );
9729 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
9731 r
= add_file_entry( hdb
, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9732 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9734 r
= add_file_entry( hdb
, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9735 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9737 r
= add_file_entry( hdb
, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9738 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9740 r
= add_file_entry( hdb
, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9741 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9743 r
= add_file_entry( hdb
, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9744 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9746 r
= add_file_entry( hdb
, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9747 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9749 r
= add_file_entry( hdb
, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9750 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9752 r
= add_file_entry( hdb
, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9753 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9755 r
= add_file_entry( hdb
, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9756 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9758 r
= add_file_entry( hdb
, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9759 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9761 r
= add_file_entry( hdb
, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9762 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
9764 r
= package_from_db( hdb
, &hpkg
);
9765 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
9767 skip("Not enough rights to perform tests\n");
9768 DeleteFile(msifile
);
9771 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
9773 MsiCloseHandle( hdb
);
9775 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9777 r
= MsiDoAction( hpkg
, "CostInitialize");
9778 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
9780 r
= MsiDoAction( hpkg
, "FileCost");
9781 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
9783 r
= MsiDoAction( hpkg
, "CostFinalize");
9784 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
9788 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
9789 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9790 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9791 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9795 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
9796 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9797 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9798 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
9802 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
9803 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9804 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9805 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9809 r
= MsiGetFeatureState(hpkg
, "lyra", &state
, &action
);
9810 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9811 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9812 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9816 r
= MsiGetFeatureState(hpkg
, "waters", &state
, &action
);
9817 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9818 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9819 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
9823 r
= MsiGetFeatureState(hpkg
, "bayer", &state
, &action
);
9824 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9825 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
9826 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
9830 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
9831 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9832 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
9833 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
9837 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
9838 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9839 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9840 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
9844 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
9845 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9846 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
9847 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
9851 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
9852 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9853 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
9854 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
9858 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
9859 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9860 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9861 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
9865 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
9866 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9867 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
9868 ok( action
== INSTALLSTATE_LOCAL
, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action
);
9872 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
9873 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9874 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
9875 ok( action
== INSTALLSTATE_LOCAL
, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action
);
9879 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
9880 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9881 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
9882 ok( action
== INSTALLSTATE_SOURCE
, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action
);
9886 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
9887 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9888 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9889 ok( action
== INSTALLSTATE_LOCAL
, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action
);
9893 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
9894 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9895 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9896 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9900 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
9901 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9902 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9903 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
9905 r
= MsiSetFeatureState(hpkg
, "orion", INSTALLSTATE_ABSENT
);
9906 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
9908 r
= MsiSetFeatureState(hpkg
, "lyra", INSTALLSTATE_ABSENT
);
9909 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
9911 r
= MsiSetFeatureState(hpkg
, "nosuchfeature", INSTALLSTATE_ABSENT
);
9912 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r
);
9916 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
9917 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9918 ok( state
== INSTALLSTATE_ABSENT
, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state
);
9919 ok( action
== INSTALLSTATE_LOCAL
, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action
);
9923 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
9924 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9925 ok( state
== INSTALLSTATE_ABSENT
, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state
);
9926 ok( action
== INSTALLSTATE_SOURCE
, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action
);
9930 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
9931 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9932 ok( state
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state
);
9933 ok( action
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action
);
9937 r
= MsiGetFeatureState(hpkg
, "lyra", &state
, &action
);
9938 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9939 ok( state
== INSTALLSTATE_ABSENT
, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", state
);
9940 ok( action
== INSTALLSTATE_ABSENT
, "Expected lyra INSTALLSTATE_ABSENT, got %d\n", action
);
9944 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
9945 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9946 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9947 ok( action
== INSTALLSTATE_LOCAL
, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action
);
9951 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
9952 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9953 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
9954 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
9958 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
9959 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9960 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
9961 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
9965 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
9966 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9967 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
9968 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
9972 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
9973 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9974 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
9975 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
9979 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
9980 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9981 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
9982 ok( action
== INSTALLSTATE_SOURCE
, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action
);
9986 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
9987 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9988 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
9989 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action
);
9993 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
9994 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9995 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
9996 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action
);
10000 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
10001 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10002 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
10003 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action
);
10006 action
= 0xdeadbee;
10007 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
10008 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10009 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
10010 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
10013 action
= 0xdeadbee;
10014 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
10015 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10016 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
10017 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
10019 MsiCloseHandle(hpkg
);
10020 DeleteFileA(msifile
);
10023 static void test_installprops(void)
10025 MSIHANDLE hpkg
, hdb
;
10026 CHAR path
[MAX_PATH
], buf
[MAX_PATH
];
10032 REGSAM access
= KEY_ALL_ACCESS
;
10036 access
|= KEY_WOW64_64KEY
;
10038 GetCurrentDirectory(MAX_PATH
, path
);
10039 lstrcat(path
, "\\");
10040 lstrcat(path
, msifile
);
10042 hdb
= create_package_db();
10043 ok( hdb
, "failed to create database\n");
10045 r
= package_from_db(hdb
, &hpkg
);
10046 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10048 skip("Not enough rights to perform tests\n");
10049 DeleteFile(msifile
);
10052 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10054 MsiCloseHandle(hdb
);
10057 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
10058 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10059 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
10061 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
10062 RegOpenKeyEx(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey2
);
10067 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
10071 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
10075 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
10076 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10077 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
10082 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
10086 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
10092 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
10093 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10094 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
10098 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
10099 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10100 trace("VersionDatabase = %s\n", buf
);
10103 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
10104 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10105 trace("VersionMsi = %s\n", buf
);
10108 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
10109 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10110 trace("Date = %s\n", buf
);
10113 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
10114 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10115 trace("Time = %s\n", buf
);
10118 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
10119 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10120 trace("PackageCode = %s\n", buf
);
10123 r
= MsiGetProperty(hpkg
, "ComputerName", buf
, &size
);
10124 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10125 trace("ComputerName = %s\n", buf
);
10127 langid
= GetUserDefaultLangID();
10128 sprintf(path
, "%d", langid
);
10131 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
10132 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10133 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
10135 res
= GetSystemMetrics(SM_CXSCREEN
);
10137 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
10138 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10139 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
10141 res
= GetSystemMetrics(SM_CYSCREEN
);
10143 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
10144 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10145 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
10147 if (pGetSystemInfo
&& pSHGetFolderPathA
)
10149 pGetSystemInfo(&si
);
10150 if (S(U(si
)).wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_AMD64
)
10154 r
= MsiGetProperty(hpkg
, "MsiAMD64", buf
, &size
);
10155 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10156 ok(buf
[0], "property not set\n");
10160 r
= MsiGetProperty(hpkg
, "Msix64", buf
, &size
);
10161 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10162 ok(buf
[0], "property not set\n");
10166 r
= MsiGetProperty(hpkg
, "System64Folder", buf
, &size
);
10167 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10168 GetSystemDirectoryA(path
, MAX_PATH
);
10169 if (size
) buf
[size
- 1] = 0;
10170 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10174 r
= MsiGetProperty(hpkg
, "SystemFolder", buf
, &size
);
10175 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10176 pGetSystemWow64DirectoryA(path
, MAX_PATH
);
10177 if (size
) buf
[size
- 1] = 0;
10178 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10182 r
= MsiGetProperty(hpkg
, "ProgramFiles64Folder", buf
, &size
);
10183 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10184 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES
, NULL
, 0, path
);
10185 if (size
) buf
[size
- 1] = 0;
10186 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10190 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder", buf
, &size
);
10191 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10192 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILESX86
, NULL
, 0, path
);
10193 if (size
) buf
[size
- 1] = 0;
10194 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10198 r
= MsiGetProperty(hpkg
, "CommonFiles64Folder", buf
, &size
);
10199 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10200 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMON
, NULL
, 0, path
);
10201 if (size
) buf
[size
- 1] = 0;
10202 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10206 r
= MsiGetProperty(hpkg
, "CommonFilesFolder", buf
, &size
);
10207 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10208 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMONX86
, NULL
, 0, path
);
10209 if (size
) buf
[size
- 1] = 0;
10210 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10214 r
= MsiGetProperty(hpkg
, "VersionNT64", buf
, &size
);
10215 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10216 ok(buf
[0], "property not set\n");
10218 else if (S(U(si
)).wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_INTEL
)
10224 r
= MsiGetProperty(hpkg
, "MsiAMD64", buf
, &size
);
10225 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10226 ok(!buf
[0], "property set\n");
10230 r
= MsiGetProperty(hpkg
, "Msix64", buf
, &size
);
10231 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10232 ok(!buf
[0], "property set\n");
10236 r
= MsiGetProperty(hpkg
, "System64Folder", buf
, &size
);
10237 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10238 ok(!buf
[0], "property set\n");
10242 r
= MsiGetProperty(hpkg
, "SystemFolder", buf
, &size
);
10243 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10244 GetSystemDirectoryA(path
, MAX_PATH
);
10245 if (size
) buf
[size
- 1] = 0;
10246 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10250 r
= MsiGetProperty(hpkg
, "ProgramFiles64Folder", buf
, &size
);
10251 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10252 ok(!buf
[0], "property set\n");
10256 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder", buf
, &size
);
10257 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10258 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES
, NULL
, 0, path
);
10259 if (size
) buf
[size
- 1] = 0;
10260 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10264 r
= MsiGetProperty(hpkg
, "CommonFiles64Folder", buf
, &size
);
10265 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10266 ok(!buf
[0], "property set\n");
10270 r
= MsiGetProperty(hpkg
, "CommonFilesFolder", buf
, &size
);
10271 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10272 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMON
, NULL
, 0, path
);
10273 if (size
) buf
[size
- 1] = 0;
10274 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10278 r
= MsiGetProperty(hpkg
, "VersionNT64", buf
, &size
);
10279 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10280 ok(!buf
[0], "property set\n");
10286 r
= MsiGetProperty(hpkg
, "MsiAMD64", buf
, &size
);
10287 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10288 ok(buf
[0], "property not set\n");
10292 r
= MsiGetProperty(hpkg
, "Msix64", buf
, &size
);
10293 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10294 ok(buf
[0], "property not set\n");
10298 r
= MsiGetProperty(hpkg
, "System64Folder", buf
, &size
);
10299 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10300 GetSystemDirectoryA(path
, MAX_PATH
);
10301 if (size
) buf
[size
- 1] = 0;
10302 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10306 r
= MsiGetProperty(hpkg
, "SystemFolder", buf
, &size
);
10307 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10308 pGetSystemWow64DirectoryA(path
, MAX_PATH
);
10309 if (size
) buf
[size
- 1] = 0;
10310 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10314 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder64", buf
, &size
);
10315 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10316 ok(!buf
[0], "property set\n");
10320 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder", buf
, &size
);
10321 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10322 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILESX86
, NULL
, 0, path
);
10323 if (size
) buf
[size
- 1] = 0;
10324 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10328 r
= MsiGetProperty(hpkg
, "CommonFilesFolder64", buf
, &size
);
10329 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10330 ok(!buf
[0], "property set\n");
10334 r
= MsiGetProperty(hpkg
, "CommonFilesFolder", buf
, &size
);
10335 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10336 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMONX86
, NULL
, 0, path
);
10337 if (size
) buf
[size
- 1] = 0;
10338 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10342 r
= MsiGetProperty(hpkg
, "VersionNT64", buf
, &size
);
10343 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10344 ok(buf
[0], "property not set\n");
10349 CloseHandle(hkey1
);
10350 CloseHandle(hkey2
);
10351 MsiCloseHandle(hpkg
);
10352 DeleteFile(msifile
);
10355 static void test_launchconditions(void)
10361 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10363 hdb
= create_package_db();
10364 ok( hdb
, "failed to create package database\n" );
10366 r
= create_launchcondition_table( hdb
);
10367 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
10369 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
10370 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
10372 /* invalid condition */
10373 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
10374 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
10376 r
= package_from_db( hdb
, &hpkg
);
10377 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10379 skip("Not enough rights to perform tests\n");
10380 DeleteFile(msifile
);
10383 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10385 MsiCloseHandle( hdb
);
10387 r
= MsiSetProperty( hpkg
, "X", "1" );
10388 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
10390 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10392 /* invalid conditions are ignored */
10393 r
= MsiDoAction( hpkg
, "LaunchConditions" );
10394 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
10396 /* verify LaunchConditions still does some verification */
10397 r
= MsiSetProperty( hpkg
, "X", "2" );
10398 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
10400 r
= MsiDoAction( hpkg
, "LaunchConditions" );
10401 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
10403 MsiCloseHandle( hpkg
);
10404 DeleteFile( msifile
);
10407 static void test_ccpsearch(void)
10409 MSIHANDLE hdb
, hpkg
;
10410 CHAR prop
[MAX_PATH
];
10411 DWORD size
= MAX_PATH
;
10414 hdb
= create_package_db();
10415 ok(hdb
, "failed to create package database\n");
10417 r
= create_ccpsearch_table(hdb
);
10418 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10420 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
10421 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10423 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
10424 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10426 r
= create_reglocator_table(hdb
);
10427 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10429 r
= add_reglocator_entry(hdb
, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10430 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10432 r
= create_drlocator_table(hdb
);
10433 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10435 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
10436 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10438 r
= create_signature_table(hdb
);
10439 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10441 r
= package_from_db(hdb
, &hpkg
);
10442 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10444 skip("Not enough rights to perform tests\n");
10445 DeleteFile(msifile
);
10448 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10450 MsiCloseHandle(hdb
);
10452 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10454 r
= MsiDoAction(hpkg
, "CCPSearch");
10455 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10457 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
10458 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10459 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
10461 MsiCloseHandle(hpkg
);
10462 DeleteFileA(msifile
);
10465 static void test_complocator(void)
10467 MSIHANDLE hdb
, hpkg
;
10469 CHAR prop
[MAX_PATH
];
10470 CHAR expected
[MAX_PATH
];
10471 DWORD size
= MAX_PATH
;
10473 hdb
= create_package_db();
10474 ok(hdb
, "failed to create package database\n");
10476 r
= create_appsearch_table(hdb
);
10477 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10479 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
10480 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10482 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
10483 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10485 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
10486 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10488 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
10489 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10491 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
10492 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10494 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
10495 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10497 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
10498 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10500 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
10501 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10503 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
10504 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10506 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
10507 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10509 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
10510 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10512 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
10513 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10515 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
10516 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10518 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
10519 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10521 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
10522 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10524 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
10525 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10527 r
= create_complocator_table(hdb
);
10528 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10530 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10531 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10533 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10534 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10536 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10537 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10539 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10540 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10542 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10543 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10545 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10546 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10548 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10549 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10551 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10552 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10554 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10555 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10557 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10558 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10560 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10561 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10563 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10566 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10567 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10569 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10570 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10572 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10573 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10575 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10576 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10578 r
= create_signature_table(hdb
);
10579 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10581 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10584 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10585 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10587 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10588 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10590 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10591 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10593 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10594 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10596 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10597 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10599 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10600 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10602 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10603 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10605 r
= package_from_db(hdb
, &hpkg
);
10606 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10608 skip("Not enough rights to perform tests\n");
10609 DeleteFile(msifile
);
10612 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10614 MsiCloseHandle(hdb
);
10616 create_test_file("abelisaurus");
10617 create_test_file("bactrosaurus");
10618 create_test_file("camelotia");
10619 create_test_file("diclonius");
10620 create_test_file("echinodon");
10621 create_test_file("falcarius");
10622 create_test_file("gallimimus");
10623 create_test_file("hagryphus");
10624 CreateDirectoryA("iguanodon", NULL
);
10625 CreateDirectoryA("jobaria", NULL
);
10626 CreateDirectoryA("kakuru", NULL
);
10627 CreateDirectoryA("labocania", NULL
);
10628 CreateDirectoryA("megaraptor", NULL
);
10629 CreateDirectoryA("neosodon", NULL
);
10630 CreateDirectoryA("olorotitan", NULL
);
10631 CreateDirectoryA("pantydraco", NULL
);
10633 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE
,
10634 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL
, FALSE
);
10635 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE
,
10636 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL
, FALSE
);
10637 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE
,
10638 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL
, FALSE
);
10639 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE
,
10640 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL
, FALSE
);
10641 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE
,
10642 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL
, FALSE
);
10643 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE
,
10644 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL
, FALSE
);
10645 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE
,
10646 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL
, FALSE
);
10647 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE
,
10648 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL
, FALSE
);
10650 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10652 r
= MsiDoAction(hpkg
, "AppSearch");
10653 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10656 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
10657 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10659 lstrcpyA(expected
, CURR_DIR
);
10660 lstrcatA(expected
, "\\abelisaurus");
10661 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10662 "Expected %s or empty string, got %s\n", expected
, prop
);
10665 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", prop
, &size
);
10666 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10667 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10670 r
= MsiGetPropertyA(hpkg
, "CAMELOTIA", prop
, &size
);
10671 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10672 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10675 r
= MsiGetPropertyA(hpkg
, "DICLONIUS", prop
, &size
);
10676 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10677 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10680 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
10681 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10683 lstrcpyA(expected
, CURR_DIR
);
10684 lstrcatA(expected
, "\\");
10685 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10686 "Expected %s or empty string, got %s\n", expected
, prop
);
10689 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
10690 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10691 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10694 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
10695 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10696 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10699 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
10700 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10701 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10704 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
10705 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10706 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10709 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
10710 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10711 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10714 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
10715 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10716 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10719 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
10720 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10721 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10724 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
10725 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10727 lstrcpyA(expected
, CURR_DIR
);
10728 lstrcatA(expected
, "\\");
10729 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10730 "Expected %s or empty string, got %s\n", expected
, prop
);
10733 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
10734 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10736 lstrcpyA(expected
, CURR_DIR
);
10737 lstrcatA(expected
, "\\neosodon\\");
10738 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10739 "Expected %s or empty string, got %s\n", expected
, prop
);
10742 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
10743 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10744 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10747 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
10748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10749 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10751 MsiCloseHandle(hpkg
);
10752 DeleteFileA("abelisaurus");
10753 DeleteFileA("bactrosaurus");
10754 DeleteFileA("camelotia");
10755 DeleteFileA("diclonius");
10756 DeleteFileA("echinodon");
10757 DeleteFileA("falcarius");
10758 DeleteFileA("gallimimus");
10759 DeleteFileA("hagryphus");
10760 RemoveDirectoryA("iguanodon");
10761 RemoveDirectoryA("jobaria");
10762 RemoveDirectoryA("kakuru");
10763 RemoveDirectoryA("labocania");
10764 RemoveDirectoryA("megaraptor");
10765 RemoveDirectoryA("neosodon");
10766 RemoveDirectoryA("olorotitan");
10767 RemoveDirectoryA("pantydraco");
10768 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10769 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10770 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10771 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10772 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10773 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10774 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10775 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10776 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10777 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10778 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10779 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10780 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10781 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10782 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10783 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10784 DeleteFileA(msifile
);
10787 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
10792 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
10793 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10795 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
10796 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10798 r
= MsiSummaryInfoPersist(summary
);
10799 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
10801 MsiCloseHandle(summary
);
10804 static void test_MsiGetSourcePath(void)
10806 MSIHANDLE hdb
, hpkg
;
10807 CHAR path
[MAX_PATH
];
10808 CHAR cwd
[MAX_PATH
];
10809 CHAR subsrc
[MAX_PATH
];
10810 CHAR sub2
[MAX_PATH
];
10814 lstrcpyA(cwd
, CURR_DIR
);
10815 lstrcatA(cwd
, "\\");
10817 lstrcpyA(subsrc
, cwd
);
10818 lstrcatA(subsrc
, "subsource");
10819 lstrcatA(subsrc
, "\\");
10821 lstrcpyA(sub2
, subsrc
);
10822 lstrcatA(sub2
, "sub2");
10823 lstrcatA(sub2
, "\\");
10825 /* uncompressed source */
10827 hdb
= create_package_db();
10828 ok( hdb
, "failed to create database\n");
10830 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
10832 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
10833 ok(r
== S_OK
, "failed\n");
10835 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10836 ok(r
== S_OK
, "failed\n");
10838 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
10839 ok(r
== S_OK
, "failed\n");
10841 r
= MsiDatabaseCommit(hdb
);
10842 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
10844 r
= package_from_db(hdb
, &hpkg
);
10845 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10847 skip("Not enough rights to perform tests\n");
10848 DeleteFile(msifile
);
10851 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10853 MsiCloseHandle(hdb
);
10855 /* invalid database handle */
10857 lstrcpyA(path
, "kiwi");
10858 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
10859 ok(r
== ERROR_INVALID_HANDLE
,
10860 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
10861 ok(!lstrcmpA(path
, "kiwi"),
10862 "Expected path to be unchanged, got \"%s\"\n", path
);
10863 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10865 /* NULL szFolder */
10867 lstrcpyA(path
, "kiwi");
10868 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
10869 ok(r
== ERROR_INVALID_PARAMETER
,
10870 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
10871 ok(!lstrcmpA(path
, "kiwi"),
10872 "Expected path to be unchanged, got \"%s\"\n", path
);
10873 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10875 /* empty szFolder */
10877 lstrcpyA(path
, "kiwi");
10878 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
10879 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10880 ok(!lstrcmpA(path
, "kiwi"),
10881 "Expected path to be unchanged, got \"%s\"\n", path
);
10882 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10884 /* try TARGETDIR */
10886 lstrcpyA(path
, "kiwi");
10887 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10888 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10889 ok(!lstrcmpA(path
, "kiwi"),
10890 "Expected path to be unchanged, got \"%s\"\n", path
);
10891 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10894 lstrcpyA(path
, "kiwi");
10895 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10896 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10897 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10898 ok(size
== 0, "Expected 0, got %d\n", size
);
10901 lstrcpyA(path
, "kiwi");
10902 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10903 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10904 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10905 ok(size
== 0, "Expected 0, got %d\n", size
);
10907 /* try SourceDir */
10909 lstrcpyA(path
, "kiwi");
10910 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10911 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10912 ok(!lstrcmpA(path
, "kiwi"),
10913 "Expected path to be unchanged, got \"%s\"\n", path
);
10914 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10916 /* try SOURCEDIR */
10918 lstrcpyA(path
, "kiwi");
10919 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10920 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10921 ok(!lstrcmpA(path
, "kiwi"),
10922 "Expected path to be unchanged, got \"%s\"\n", path
);
10923 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10925 /* source path does not exist, but the property exists */
10927 lstrcpyA(path
, "kiwi");
10928 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10929 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10930 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10931 ok(size
== 0, "Expected 0, got %d\n", size
);
10934 lstrcpyA(path
, "kiwi");
10935 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10936 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10937 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10938 ok(size
== 0, "Expected 0, got %d\n", size
);
10942 lstrcpyA(path
, "kiwi");
10943 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10944 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10945 ok(!lstrcmpA(path
, "kiwi"),
10946 "Expected path to be unchanged, got \"%s\"\n", path
);
10947 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10951 lstrcpyA(path
, "kiwi");
10952 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10953 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10954 ok(!lstrcmpA(path
, "kiwi"),
10955 "Expected path to be unchanged, got \"%s\"\n", path
);
10956 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10958 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10960 r
= MsiDoAction(hpkg
, "CostInitialize");
10961 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
10963 /* try TARGETDIR after CostInitialize */
10965 lstrcpyA(path
, "kiwi");
10966 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10967 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10968 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10969 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10971 /* try SourceDir after CostInitialize */
10973 lstrcpyA(path
, "kiwi");
10974 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10975 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10976 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10977 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10979 /* try SOURCEDIR after CostInitialize */
10981 lstrcpyA(path
, "kiwi");
10982 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10983 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10984 ok(!lstrcmpA(path
, "kiwi"),
10985 "Expected path to be unchanged, got \"%s\"\n", path
);
10986 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10988 /* source path does not exist, but the property exists */
10990 lstrcpyA(path
, "kiwi");
10991 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10992 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10993 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10994 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10997 lstrcpyA(path
, "kiwi");
10998 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11000 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11001 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11003 /* try SubDir after CostInitialize */
11005 lstrcpyA(path
, "kiwi");
11006 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11007 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11008 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11009 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11011 /* try SubDir2 after CostInitialize */
11013 lstrcpyA(path
, "kiwi");
11014 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11015 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11016 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11017 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11019 r
= MsiDoAction(hpkg
, "ResolveSource");
11020 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11022 /* try TARGETDIR after ResolveSource */
11024 lstrcpyA(path
, "kiwi");
11025 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11026 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11027 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11028 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11030 /* try SourceDir after ResolveSource */
11032 lstrcpyA(path
, "kiwi");
11033 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11034 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11035 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11036 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11038 /* try SOURCEDIR after ResolveSource */
11040 lstrcpyA(path
, "kiwi");
11041 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11042 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11043 ok(!lstrcmpA(path
, "kiwi"),
11044 "Expected path to be unchanged, got \"%s\"\n", path
);
11045 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11047 /* source path does not exist, but the property exists */
11049 lstrcpyA(path
, "kiwi");
11050 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11051 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11052 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11053 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11056 lstrcpyA(path
, "kiwi");
11057 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11058 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11059 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11060 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11062 /* try SubDir after ResolveSource */
11064 lstrcpyA(path
, "kiwi");
11065 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11067 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11068 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11070 /* try SubDir2 after ResolveSource */
11072 lstrcpyA(path
, "kiwi");
11073 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11074 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11075 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11076 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11078 r
= MsiDoAction(hpkg
, "FileCost");
11079 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11081 /* try TARGETDIR after FileCost */
11083 lstrcpyA(path
, "kiwi");
11084 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11085 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11086 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11087 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11089 /* try SourceDir after FileCost */
11091 lstrcpyA(path
, "kiwi");
11092 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11093 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11094 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11095 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11097 /* try SOURCEDIR after FileCost */
11099 lstrcpyA(path
, "kiwi");
11100 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11101 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11102 ok(!lstrcmpA(path
, "kiwi"),
11103 "Expected path to be unchanged, got \"%s\"\n", path
);
11104 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11106 /* source path does not exist, but the property exists */
11108 lstrcpyA(path
, "kiwi");
11109 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11110 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11111 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11112 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11115 lstrcpyA(path
, "kiwi");
11116 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11117 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11118 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11119 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11121 /* try SubDir after FileCost */
11123 lstrcpyA(path
, "kiwi");
11124 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11125 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11126 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11127 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11129 /* try SubDir2 after FileCost */
11131 lstrcpyA(path
, "kiwi");
11132 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11133 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11134 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11135 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11137 r
= MsiDoAction(hpkg
, "CostFinalize");
11138 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11140 /* try TARGETDIR after CostFinalize */
11142 lstrcpyA(path
, "kiwi");
11143 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11144 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11145 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11146 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11148 /* try SourceDir after CostFinalize */
11150 lstrcpyA(path
, "kiwi");
11151 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11152 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11153 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11154 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11156 /* try SOURCEDIR after CostFinalize */
11158 lstrcpyA(path
, "kiwi");
11159 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11160 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11161 ok(!lstrcmpA(path
, "kiwi"),
11162 "Expected path to be unchanged, got \"%s\"\n", path
);
11163 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11165 /* source path does not exist, but the property exists */
11167 lstrcpyA(path
, "kiwi");
11168 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11169 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11170 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11171 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11174 lstrcpyA(path
, "kiwi");
11175 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11176 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11177 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11178 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11180 /* try SubDir after CostFinalize */
11182 lstrcpyA(path
, "kiwi");
11183 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11184 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11185 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11186 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11188 /* try SubDir2 after CostFinalize */
11190 lstrcpyA(path
, "kiwi");
11191 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11192 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11193 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11194 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11196 /* nonexistent directory */
11198 lstrcpyA(path
, "kiwi");
11199 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
11200 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11201 ok(!lstrcmpA(path
, "kiwi"),
11202 "Expected path to be unchanged, got \"%s\"\n", path
);
11203 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11205 /* NULL szPathBuf */
11207 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
11208 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11209 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11211 /* NULL pcchPathBuf */
11212 lstrcpyA(path
, "kiwi");
11213 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
11214 ok(r
== ERROR_INVALID_PARAMETER
,
11215 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11216 ok(!lstrcmpA(path
, "kiwi"),
11217 "Expected path to be unchanged, got \"%s\"\n", path
);
11219 /* pcchPathBuf is 0 */
11221 lstrcpyA(path
, "kiwi");
11222 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11223 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11224 ok(!lstrcmpA(path
, "kiwi"),
11225 "Expected path to be unchanged, got \"%s\"\n", path
);
11226 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11228 /* pcchPathBuf does not have room for NULL terminator */
11229 size
= lstrlenA(cwd
);
11230 lstrcpyA(path
, "kiwi");
11231 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11232 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11233 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
11234 "Expected path with no backslash, got \"%s\"\n", path
);
11235 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11237 /* pcchPathBuf has room for NULL terminator */
11238 size
= lstrlenA(cwd
) + 1;
11239 lstrcpyA(path
, "kiwi");
11240 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11241 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11242 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11243 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11245 /* remove property */
11246 r
= MsiSetProperty(hpkg
, "SourceDir", NULL
);
11247 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11249 /* try SourceDir again */
11251 lstrcpyA(path
, "kiwi");
11252 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11253 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11254 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11255 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11257 /* set property to a valid directory */
11258 r
= MsiSetProperty(hpkg
, "SOURCEDIR", cwd
);
11259 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11261 /* try SOURCEDIR again */
11263 lstrcpyA(path
, "kiwi");
11264 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11265 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11266 ok(!lstrcmpA(path
, "kiwi"),
11267 "Expected path to be unchanged, got \"%s\"\n", path
);
11268 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11270 MsiCloseHandle(hpkg
);
11272 /* compressed source */
11274 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
11275 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11277 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
11279 r
= package_from_db(hdb
, &hpkg
);
11280 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
11282 /* try TARGETDIR */
11284 lstrcpyA(path
, "kiwi");
11285 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11286 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11287 ok(!lstrcmpA(path
, "kiwi"),
11288 "Expected path to be unchanged, got \"%s\"\n", path
);
11289 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11291 /* try SourceDir */
11293 lstrcpyA(path
, "kiwi");
11294 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11295 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11296 ok(!lstrcmpA(path
, "kiwi"),
11297 "Expected path to be unchanged, got \"%s\"\n", path
);
11298 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11300 /* try SOURCEDIR */
11302 lstrcpyA(path
, "kiwi");
11303 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11304 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11305 ok(!lstrcmpA(path
, "kiwi"),
11306 "Expected path to be unchanged, got \"%s\"\n", path
);
11307 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11309 /* source path nor the property exist */
11311 lstrcpyA(path
, "kiwi");
11312 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11313 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11314 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11315 ok(size
== 0, "Expected 0, got %d\n", size
);
11318 lstrcpyA(path
, "kiwi");
11319 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11321 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11322 ok(size
== 0, "Expected 0, got %d\n", size
);
11326 lstrcpyA(path
, "kiwi");
11327 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11328 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11329 ok(!lstrcmpA(path
, "kiwi"),
11330 "Expected path to be unchanged, got \"%s\"\n", path
);
11331 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11335 lstrcpyA(path
, "kiwi");
11336 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11337 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11338 ok(!lstrcmpA(path
, "kiwi"),
11339 "Expected path to be unchanged, got \"%s\"\n", path
);
11340 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11342 r
= MsiDoAction(hpkg
, "CostInitialize");
11343 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11345 /* try TARGETDIR after CostInitialize */
11347 lstrcpyA(path
, "kiwi");
11348 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11349 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11350 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11351 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11353 /* try SourceDir after CostInitialize */
11355 lstrcpyA(path
, "kiwi");
11356 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11357 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11358 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11359 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11361 /* try SOURCEDIR after CostInitialize */
11363 lstrcpyA(path
, "kiwi");
11364 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11367 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11368 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11369 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11372 /* source path does not exist, but the property exists */
11374 lstrcpyA(path
, "kiwi");
11375 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11376 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11377 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11378 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11381 lstrcpyA(path
, "kiwi");
11382 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11383 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11384 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11385 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11387 /* try SubDir after CostInitialize */
11389 lstrcpyA(path
, "kiwi");
11390 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11392 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11393 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11395 /* try SubDir2 after CostInitialize */
11397 lstrcpyA(path
, "kiwi");
11398 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11399 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11400 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11401 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11403 r
= MsiDoAction(hpkg
, "ResolveSource");
11404 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11406 /* try TARGETDIR after ResolveSource */
11408 lstrcpyA(path
, "kiwi");
11409 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11410 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11411 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11412 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11414 /* try SourceDir after ResolveSource */
11416 lstrcpyA(path
, "kiwi");
11417 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11418 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11419 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11420 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11422 /* try SOURCEDIR after ResolveSource */
11424 lstrcpyA(path
, "kiwi");
11425 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11428 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11429 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11430 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11433 /* source path and the property exist */
11435 lstrcpyA(path
, "kiwi");
11436 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11437 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11438 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11439 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11442 lstrcpyA(path
, "kiwi");
11443 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11444 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11445 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11446 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11448 /* try SubDir after ResolveSource */
11450 lstrcpyA(path
, "kiwi");
11451 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11452 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11453 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11454 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11456 /* try SubDir2 after ResolveSource */
11458 lstrcpyA(path
, "kiwi");
11459 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11460 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11461 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11462 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11464 r
= MsiDoAction(hpkg
, "FileCost");
11465 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11467 /* try TARGETDIR after CostFinalize */
11469 lstrcpyA(path
, "kiwi");
11470 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11472 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11473 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11475 /* try SourceDir after CostFinalize */
11477 lstrcpyA(path
, "kiwi");
11478 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11479 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11480 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11481 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11483 /* try SOURCEDIR after CostFinalize */
11485 lstrcpyA(path
, "kiwi");
11486 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11489 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11490 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11491 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11494 /* source path and the property exist */
11496 lstrcpyA(path
, "kiwi");
11497 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11498 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11499 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11500 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11503 lstrcpyA(path
, "kiwi");
11504 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11505 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11506 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11507 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11509 /* try SubDir after CostFinalize */
11511 lstrcpyA(path
, "kiwi");
11512 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11513 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11514 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11515 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11517 /* try SubDir2 after CostFinalize */
11519 lstrcpyA(path
, "kiwi");
11520 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11522 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11523 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11525 r
= MsiDoAction(hpkg
, "CostFinalize");
11526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11528 /* try TARGETDIR after CostFinalize */
11530 lstrcpyA(path
, "kiwi");
11531 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11532 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11533 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11534 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11536 /* try SourceDir after CostFinalize */
11538 lstrcpyA(path
, "kiwi");
11539 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11540 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11541 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11542 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11544 /* try SOURCEDIR after CostFinalize */
11546 lstrcpyA(path
, "kiwi");
11547 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11550 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11551 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11552 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11555 /* source path and the property exist */
11557 lstrcpyA(path
, "kiwi");
11558 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11559 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11560 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11561 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11564 lstrcpyA(path
, "kiwi");
11565 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11566 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11567 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11568 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11570 /* try SubDir after CostFinalize */
11572 lstrcpyA(path
, "kiwi");
11573 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11574 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11575 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11576 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11578 /* try SubDir2 after CostFinalize */
11580 lstrcpyA(path
, "kiwi");
11581 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11583 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11584 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11586 MsiCloseHandle(hpkg
);
11587 DeleteFile(msifile
);
11590 static void test_shortlongsource(void)
11592 MSIHANDLE hdb
, hpkg
;
11593 CHAR path
[MAX_PATH
];
11594 CHAR cwd
[MAX_PATH
];
11595 CHAR subsrc
[MAX_PATH
];
11599 lstrcpyA(cwd
, CURR_DIR
);
11600 lstrcatA(cwd
, "\\");
11602 lstrcpyA(subsrc
, cwd
);
11603 lstrcatA(subsrc
, "long");
11604 lstrcatA(subsrc
, "\\");
11606 /* long file names */
11608 hdb
= create_package_db();
11609 ok( hdb
, "failed to create database\n");
11611 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
11613 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
11614 ok(r
== S_OK
, "failed\n");
11616 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
11617 ok(r
== S_OK
, "failed\n");
11619 /* CostInitialize:short */
11620 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
11621 ok(r
== S_OK
, "failed\n");
11623 /* CostInitialize:long */
11624 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
11625 ok(r
== S_OK
, "failed\n");
11627 /* FileCost:short */
11628 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
11629 ok(r
== S_OK
, "failed\n");
11631 /* FileCost:long */
11632 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11633 ok(r
== S_OK
, "failed\n");
11635 /* CostFinalize:short */
11636 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11637 ok(r
== S_OK
, "failed\n");
11639 /* CostFinalize:long */
11640 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11641 ok(r
== S_OK
, "failed\n");
11643 MsiDatabaseCommit(hdb
);
11645 r
= package_from_db(hdb
, &hpkg
);
11646 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
11648 skip("Not enough rights to perform tests\n");
11649 DeleteFile(msifile
);
11652 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
11654 MsiCloseHandle(hdb
);
11656 CreateDirectoryA("one", NULL
);
11657 CreateDirectoryA("four", NULL
);
11659 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
11661 r
= MsiDoAction(hpkg
, "CostInitialize");
11662 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11664 CreateDirectory("five", NULL
);
11665 CreateDirectory("eight", NULL
);
11667 r
= MsiDoAction(hpkg
, "FileCost");
11668 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11670 CreateDirectory("nine", NULL
);
11671 CreateDirectory("twelve", NULL
);
11673 r
= MsiDoAction(hpkg
, "CostFinalize");
11674 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11676 /* neither short nor long source directories exist */
11678 lstrcpyA(path
, "kiwi");
11679 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11680 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11681 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11682 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11684 CreateDirectoryA("short", NULL
);
11686 /* short source directory exists */
11688 lstrcpyA(path
, "kiwi");
11689 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11690 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11691 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11692 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11694 CreateDirectoryA("long", NULL
);
11696 /* both short and long source directories exist */
11698 lstrcpyA(path
, "kiwi");
11699 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11700 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11701 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11702 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11704 lstrcpyA(subsrc
, cwd
);
11705 lstrcatA(subsrc
, "two");
11706 lstrcatA(subsrc
, "\\");
11708 /* short dir exists before CostInitialize */
11710 lstrcpyA(path
, "kiwi");
11711 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11713 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11714 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11716 lstrcpyA(subsrc
, cwd
);
11717 lstrcatA(subsrc
, "four");
11718 lstrcatA(subsrc
, "\\");
11720 /* long dir exists before CostInitialize */
11722 lstrcpyA(path
, "kiwi");
11723 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
11724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11725 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11726 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11728 lstrcpyA(subsrc
, cwd
);
11729 lstrcatA(subsrc
, "six");
11730 lstrcatA(subsrc
, "\\");
11732 /* short dir exists before FileCost */
11734 lstrcpyA(path
, "kiwi");
11735 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
11736 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11737 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11738 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11740 lstrcpyA(subsrc
, cwd
);
11741 lstrcatA(subsrc
, "eight");
11742 lstrcatA(subsrc
, "\\");
11744 /* long dir exists before FileCost */
11746 lstrcpyA(path
, "kiwi");
11747 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
11748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11749 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11750 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11752 lstrcpyA(subsrc
, cwd
);
11753 lstrcatA(subsrc
, "ten");
11754 lstrcatA(subsrc
, "\\");
11756 /* short dir exists before CostFinalize */
11758 lstrcpyA(path
, "kiwi");
11759 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
11760 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11761 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11762 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11764 lstrcpyA(subsrc
, cwd
);
11765 lstrcatA(subsrc
, "twelve");
11766 lstrcatA(subsrc
, "\\");
11768 /* long dir exists before CostFinalize */
11770 lstrcpyA(path
, "kiwi");
11771 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
11772 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11773 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11774 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11776 MsiCloseHandle(hpkg
);
11777 RemoveDirectoryA("short");
11778 RemoveDirectoryA("long");
11779 RemoveDirectoryA("one");
11780 RemoveDirectoryA("four");
11781 RemoveDirectoryA("five");
11782 RemoveDirectoryA("eight");
11783 RemoveDirectoryA("nine");
11784 RemoveDirectoryA("twelve");
11786 /* short file names */
11788 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
11789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11791 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
11793 r
= package_from_db(hdb
, &hpkg
);
11794 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
11796 MsiCloseHandle(hdb
);
11798 CreateDirectoryA("one", NULL
);
11799 CreateDirectoryA("four", NULL
);
11801 r
= MsiDoAction(hpkg
, "CostInitialize");
11802 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11804 CreateDirectory("five", NULL
);
11805 CreateDirectory("eight", NULL
);
11807 r
= MsiDoAction(hpkg
, "FileCost");
11808 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11810 CreateDirectory("nine", NULL
);
11811 CreateDirectory("twelve", NULL
);
11813 r
= MsiDoAction(hpkg
, "CostFinalize");
11814 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11816 lstrcpyA(subsrc
, cwd
);
11817 lstrcatA(subsrc
, "short");
11818 lstrcatA(subsrc
, "\\");
11820 /* neither short nor long source directories exist */
11822 lstrcpyA(path
, "kiwi");
11823 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11824 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11825 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11826 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11828 CreateDirectoryA("short", NULL
);
11830 /* short source directory exists */
11832 lstrcpyA(path
, "kiwi");
11833 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11834 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11835 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11836 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11838 CreateDirectoryA("long", NULL
);
11840 /* both short and long source directories exist */
11842 lstrcpyA(path
, "kiwi");
11843 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11844 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11845 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11846 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11848 lstrcpyA(subsrc
, cwd
);
11849 lstrcatA(subsrc
, "one");
11850 lstrcatA(subsrc
, "\\");
11852 /* short dir exists before CostInitialize */
11854 lstrcpyA(path
, "kiwi");
11855 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11856 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11857 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11858 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11860 lstrcpyA(subsrc
, cwd
);
11861 lstrcatA(subsrc
, "three");
11862 lstrcatA(subsrc
, "\\");
11864 /* long dir exists before CostInitialize */
11866 lstrcpyA(path
, "kiwi");
11867 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
11868 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11869 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11870 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11872 lstrcpyA(subsrc
, cwd
);
11873 lstrcatA(subsrc
, "five");
11874 lstrcatA(subsrc
, "\\");
11876 /* short dir exists before FileCost */
11878 lstrcpyA(path
, "kiwi");
11879 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
11880 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11881 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11882 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11884 lstrcpyA(subsrc
, cwd
);
11885 lstrcatA(subsrc
, "seven");
11886 lstrcatA(subsrc
, "\\");
11888 /* long dir exists before FileCost */
11890 lstrcpyA(path
, "kiwi");
11891 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
11892 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11893 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11894 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11896 lstrcpyA(subsrc
, cwd
);
11897 lstrcatA(subsrc
, "nine");
11898 lstrcatA(subsrc
, "\\");
11900 /* short dir exists before CostFinalize */
11902 lstrcpyA(path
, "kiwi");
11903 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
11904 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11905 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11906 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11908 lstrcpyA(subsrc
, cwd
);
11909 lstrcatA(subsrc
, "eleven");
11910 lstrcatA(subsrc
, "\\");
11912 /* long dir exists before CostFinalize */
11914 lstrcpyA(path
, "kiwi");
11915 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
11916 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11917 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11918 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11920 MsiCloseHandle(hpkg
);
11921 RemoveDirectoryA("short");
11922 RemoveDirectoryA("long");
11923 RemoveDirectoryA("one");
11924 RemoveDirectoryA("four");
11925 RemoveDirectoryA("five");
11926 RemoveDirectoryA("eight");
11927 RemoveDirectoryA("nine");
11928 RemoveDirectoryA("twelve");
11929 DeleteFileA(msifile
);
11932 static void test_sourcedir(void)
11934 MSIHANDLE hdb
, hpkg
;
11936 CHAR path
[MAX_PATH
];
11937 CHAR cwd
[MAX_PATH
];
11938 CHAR subsrc
[MAX_PATH
];
11942 lstrcpyA(cwd
, CURR_DIR
);
11943 lstrcatA(cwd
, "\\");
11945 lstrcpyA(subsrc
, cwd
);
11946 lstrcatA(subsrc
, "long");
11947 lstrcatA(subsrc
, "\\");
11949 hdb
= create_package_db();
11950 ok( hdb
, "failed to create database\n");
11952 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
11953 ok(r
== S_OK
, "failed\n");
11955 sprintf(package
, "#%u", hdb
);
11956 r
= MsiOpenPackage(package
, &hpkg
);
11957 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
11959 skip("Not enough rights to perform tests\n");
11962 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11964 /* properties only */
11966 /* SourceDir prop */
11968 lstrcpyA(path
, "kiwi");
11969 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11970 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11971 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11972 ok(size
== 0, "Expected 0, got %d\n", size
);
11974 /* SOURCEDIR prop */
11976 lstrcpyA(path
, "kiwi");
11977 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11978 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11979 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11980 ok(size
== 0, "Expected 0, got %d\n", size
);
11982 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
11984 r
= MsiDoAction(hpkg
, "CostInitialize");
11985 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11987 /* SourceDir after CostInitialize */
11989 lstrcpyA(path
, "kiwi");
11990 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11991 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11992 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11993 ok(size
== 0, "Expected 0, got %d\n", size
);
11995 /* SOURCEDIR after CostInitialize */
11997 lstrcpyA(path
, "kiwi");
11998 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12000 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12001 ok(size
== 0, "Expected 0, got %d\n", size
);
12003 r
= MsiDoAction(hpkg
, "FileCost");
12004 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12006 /* SourceDir after FileCost */
12008 lstrcpyA(path
, "kiwi");
12009 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12010 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12011 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12012 ok(size
== 0, "Expected 0, got %d\n", size
);
12014 /* SOURCEDIR after FileCost */
12016 lstrcpyA(path
, "kiwi");
12017 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12018 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12019 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12020 ok(size
== 0, "Expected 0, got %d\n", size
);
12022 r
= MsiDoAction(hpkg
, "CostFinalize");
12023 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12025 /* SourceDir after CostFinalize */
12027 lstrcpyA(path
, "kiwi");
12028 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12029 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12030 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12031 ok(size
== 0, "Expected 0, got %d\n", size
);
12033 /* SOURCEDIR after CostFinalize */
12035 lstrcpyA(path
, "kiwi");
12036 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12037 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12038 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12039 ok(size
== 0, "Expected 0, got %d\n", size
);
12042 lstrcpyA(path
, "kiwi");
12043 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12044 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12045 ok(!lstrcmpA(path
, "kiwi"), "Expected \"kiwi\", got \"%s\"\n", path
);
12046 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
12048 /* SOURCEDIR after calling MsiGetSourcePath */
12050 lstrcpyA(path
, "kiwi");
12051 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12052 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12054 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12055 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12058 r
= MsiDoAction(hpkg
, "ResolveSource");
12059 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12061 /* SourceDir after ResolveSource */
12063 lstrcpyA(path
, "kiwi");
12064 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12065 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12066 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12067 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12069 /* SOURCEDIR after ResolveSource */
12071 lstrcpyA(path
, "kiwi");
12072 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12073 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12074 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12075 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12077 /* random casing */
12079 lstrcpyA(path
, "kiwi");
12080 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
12081 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12082 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12083 ok(size
== 0, "Expected 0, got %d\n", size
);
12085 MsiCloseHandle(hpkg
);
12087 /* reset the package state */
12088 sprintf(package
, "#%i", hdb
);
12089 r
= MsiOpenPackage(package
, &hpkg
);
12090 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12092 /* test how MsiGetSourcePath affects the properties */
12094 /* SourceDir prop */
12096 lstrcpyA(path
, "kiwi");
12097 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12098 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12101 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12102 ok(size
== 0, "Expected 0, got %d\n", size
);
12106 lstrcpyA(path
, "kiwi");
12107 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
12108 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12109 ok(!lstrcmpA(path
, "kiwi"),
12110 "Expected path to be unchanged, got \"%s\"\n", path
);
12111 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12113 /* SourceDir after MsiGetSourcePath */
12115 lstrcpyA(path
, "kiwi");
12116 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12117 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12120 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12121 ok(size
== 0, "Expected 0, got %d\n", size
);
12124 /* SOURCEDIR prop */
12126 lstrcpyA(path
, "kiwi");
12127 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12128 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12131 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12132 ok(size
== 0, "Expected 0, got %d\n", size
);
12136 lstrcpyA(path
, "kiwi");
12137 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12138 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12139 ok(!lstrcmpA(path
, "kiwi"),
12140 "Expected path to be unchanged, got \"%s\"\n", path
);
12141 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12143 /* SOURCEDIR prop after MsiGetSourcePath */
12145 lstrcpyA(path
, "kiwi");
12146 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12147 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12150 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12151 ok(size
== 0, "Expected 0, got %d\n", size
);
12154 r
= MsiDoAction(hpkg
, "CostInitialize");
12155 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12157 /* SourceDir after CostInitialize */
12159 lstrcpyA(path
, "kiwi");
12160 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12161 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12164 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12165 ok(size
== 0, "Expected 0, got %d\n", size
);
12169 lstrcpyA(path
, "kiwi");
12170 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
12171 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12172 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12173 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12175 /* SourceDir after MsiGetSourcePath */
12177 lstrcpyA(path
, "kiwi");
12178 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12179 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12180 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12181 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12183 /* SOURCEDIR after CostInitialize */
12185 lstrcpyA(path
, "kiwi");
12186 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12187 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12188 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12189 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12191 /* SOURCEDIR source path still does not exist */
12193 lstrcpyA(path
, "kiwi");
12194 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12195 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12196 ok(!lstrcmpA(path
, "kiwi"),
12197 "Expected path to be unchanged, got \"%s\"\n", path
);
12198 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12200 r
= MsiDoAction(hpkg
, "FileCost");
12201 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12203 /* SourceDir after FileCost */
12205 lstrcpyA(path
, "kiwi");
12206 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12207 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12208 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12209 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12211 /* SOURCEDIR after FileCost */
12213 lstrcpyA(path
, "kiwi");
12214 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12215 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12216 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12217 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12219 /* SOURCEDIR source path still does not exist */
12221 lstrcpyA(path
, "kiwi");
12222 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12223 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12224 ok(!lstrcmpA(path
, "kiwi"),
12225 "Expected path to be unchanged, got \"%s\"\n", path
);
12226 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12228 r
= MsiDoAction(hpkg
, "CostFinalize");
12229 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12231 /* SourceDir after CostFinalize */
12233 lstrcpyA(path
, "kiwi");
12234 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12235 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12236 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12237 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12239 /* SOURCEDIR after CostFinalize */
12241 lstrcpyA(path
, "kiwi");
12242 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12243 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12244 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12245 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12247 /* SOURCEDIR source path still does not exist */
12249 lstrcpyA(path
, "kiwi");
12250 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12251 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12252 ok(!lstrcmpA(path
, "kiwi"),
12253 "Expected path to be unchanged, got \"%s\"\n", path
);
12254 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12256 r
= MsiDoAction(hpkg
, "ResolveSource");
12257 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12259 /* SourceDir after ResolveSource */
12261 lstrcpyA(path
, "kiwi");
12262 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12263 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12264 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12265 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12267 /* SOURCEDIR after ResolveSource */
12269 lstrcpyA(path
, "kiwi");
12270 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12271 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12272 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12273 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12275 /* SOURCEDIR source path still does not exist */
12277 lstrcpyA(path
, "kiwi");
12278 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12279 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12280 ok(!lstrcmpA(path
, "kiwi"),
12281 "Expected path to be unchanged, got \"%s\"\n", path
);
12282 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12284 MsiCloseHandle(hpkg
);
12287 MsiCloseHandle(hdb
);
12288 DeleteFileA(msifile
);
12298 static const struct access_res create
[16] =
12300 { TRUE
, ERROR_SUCCESS
, TRUE
},
12301 { TRUE
, ERROR_SUCCESS
, TRUE
},
12302 { TRUE
, ERROR_SUCCESS
, FALSE
},
12303 { TRUE
, ERROR_SUCCESS
, FALSE
},
12304 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12305 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12306 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12307 { TRUE
, ERROR_SUCCESS
, FALSE
},
12308 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12309 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12310 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12311 { TRUE
, ERROR_SUCCESS
, TRUE
},
12312 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12313 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12314 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12315 { TRUE
, ERROR_SUCCESS
, TRUE
}
12318 static const struct access_res create_commit
[16] =
12320 { TRUE
, ERROR_SUCCESS
, TRUE
},
12321 { TRUE
, ERROR_SUCCESS
, TRUE
},
12322 { TRUE
, ERROR_SUCCESS
, FALSE
},
12323 { TRUE
, ERROR_SUCCESS
, FALSE
},
12324 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12325 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12326 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12327 { TRUE
, ERROR_SUCCESS
, FALSE
},
12328 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12329 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12330 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12331 { TRUE
, ERROR_SUCCESS
, TRUE
},
12332 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12333 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12334 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12335 { TRUE
, ERROR_SUCCESS
, TRUE
}
12338 static const struct access_res create_close
[16] =
12340 { TRUE
, ERROR_SUCCESS
, FALSE
},
12341 { TRUE
, ERROR_SUCCESS
, FALSE
},
12342 { TRUE
, ERROR_SUCCESS
, FALSE
},
12343 { TRUE
, ERROR_SUCCESS
, FALSE
},
12344 { TRUE
, ERROR_SUCCESS
, FALSE
},
12345 { TRUE
, ERROR_SUCCESS
, FALSE
},
12346 { TRUE
, ERROR_SUCCESS
, FALSE
},
12347 { TRUE
, ERROR_SUCCESS
, FALSE
},
12348 { TRUE
, ERROR_SUCCESS
, FALSE
},
12349 { TRUE
, ERROR_SUCCESS
, FALSE
},
12350 { TRUE
, ERROR_SUCCESS
, FALSE
},
12351 { TRUE
, ERROR_SUCCESS
, FALSE
},
12352 { TRUE
, ERROR_SUCCESS
, FALSE
},
12353 { TRUE
, ERROR_SUCCESS
, FALSE
},
12354 { TRUE
, ERROR_SUCCESS
, FALSE
},
12355 { TRUE
, ERROR_SUCCESS
}
12358 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
12360 DWORD access
= 0, share
= 0;
12365 for (i
= 0; i
< 4; i
++)
12367 if (i
== 0) access
= 0;
12368 if (i
== 1) access
= GENERIC_READ
;
12369 if (i
== 2) access
= GENERIC_WRITE
;
12370 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
12372 for (j
= 0; j
< 4; j
++)
12374 if (ares
[idx
].ignore
)
12377 if (j
== 0) share
= 0;
12378 if (j
== 1) share
= FILE_SHARE_READ
;
12379 if (j
== 2) share
= FILE_SHARE_WRITE
;
12380 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
12382 SetLastError(0xdeadbeef);
12383 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
12384 FILE_ATTRIBUTE_NORMAL
, 0);
12385 lasterr
= GetLastError();
12387 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
12388 "(%d, handle, %d): Expected %d, got %d\n",
12389 line
, idx
, ares
[idx
].gothandle
,
12390 (hfile
!= INVALID_HANDLE_VALUE
));
12392 ok(lasterr
== ares
[idx
].lasterr
, "(%d, lasterr, %d): Expected %d, got %d\n",
12393 line
, idx
, ares
[idx
].lasterr
, lasterr
);
12395 CloseHandle(hfile
);
12401 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12403 static void test_access(void)
12408 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
12409 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12411 test_file_access(msifile
, create
);
12413 r
= MsiDatabaseCommit(hdb
);
12414 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12416 test_file_access(msifile
, create_commit
);
12417 MsiCloseHandle(hdb
);
12419 test_file_access(msifile
, create_close
);
12420 DeleteFileA(msifile
);
12422 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
12423 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12425 test_file_access(msifile
, create
);
12427 r
= MsiDatabaseCommit(hdb
);
12428 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12430 test_file_access(msifile
, create_commit
);
12431 MsiCloseHandle(hdb
);
12433 test_file_access(msifile
, create_close
);
12434 DeleteFileA(msifile
);
12437 static void test_emptypackage(void)
12439 MSIHANDLE hpkg
= 0, hdb
= 0, hsuminfo
= 0;
12440 MSIHANDLE hview
= 0, hrec
= 0;
12441 MSICONDITION condition
;
12442 CHAR buffer
[MAX_PATH
];
12446 r
= MsiOpenPackageA("", &hpkg
);
12447 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
12449 skip("Not enough rights to perform tests\n");
12454 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12457 hdb
= MsiGetActiveDatabase(hpkg
);
12460 ok(hdb
!= 0, "Expected a valid database handle\n");
12463 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Tables`", &hview
);
12466 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12468 r
= MsiViewExecute(hview
, 0);
12471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12474 r
= MsiViewFetch(hview
, &hrec
);
12477 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12482 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
12485 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12486 ok(!lstrcmpA(buffer
, "_Property"),
12487 "Expected \"_Property\", got \"%s\"\n", buffer
);
12490 MsiCloseHandle(hrec
);
12492 r
= MsiViewFetch(hview
, &hrec
);
12495 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12499 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
12502 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12503 ok(!lstrcmpA(buffer
, "#_FolderCache"),
12504 "Expected \"_Property\", got \"%s\"\n", buffer
);
12507 MsiCloseHandle(hrec
);
12508 MsiViewClose(hview
);
12509 MsiCloseHandle(hview
);
12511 condition
= MsiDatabaseIsTablePersistentA(hdb
, "_Property");
12514 ok(condition
== MSICONDITION_FALSE
,
12515 "Expected MSICONDITION_FALSE, got %d\n", condition
);
12518 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
12521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12523 r
= MsiViewExecute(hview
, 0);
12526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12529 /* _Property table is not empty */
12530 r
= MsiViewFetch(hview
, &hrec
);
12533 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12536 MsiCloseHandle(hrec
);
12537 MsiViewClose(hview
);
12538 MsiCloseHandle(hview
);
12540 condition
= MsiDatabaseIsTablePersistentA(hdb
, "#_FolderCache");
12543 ok(condition
== MSICONDITION_FALSE
,
12544 "Expected MSICONDITION_FALSE, got %d\n", condition
);
12547 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `#_FolderCache`", &hview
);
12550 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12552 r
= MsiViewExecute(hview
, 0);
12555 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12558 /* #_FolderCache is not empty */
12559 r
= MsiViewFetch(hview
, &hrec
);
12562 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12565 MsiCloseHandle(hrec
);
12566 MsiViewClose(hview
);
12567 MsiCloseHandle(hview
);
12569 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Streams`", &hview
);
12572 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12573 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12576 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Storages`", &hview
);
12579 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12580 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12583 r
= MsiGetSummaryInformationA(hdb
, NULL
, 0, &hsuminfo
);
12586 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
12587 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
12590 MsiCloseHandle(hsuminfo
);
12592 r
= MsiDatabaseCommit(hdb
);
12595 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12598 MsiCloseHandle(hdb
);
12599 MsiCloseHandle(hpkg
);
12602 static void test_MsiGetProductProperty(void)
12604 MSIHANDLE hprod
, hdb
;
12605 CHAR val
[MAX_PATH
];
12606 CHAR path
[MAX_PATH
];
12607 CHAR query
[MAX_PATH
];
12608 CHAR keypath
[MAX_PATH
*2];
12609 CHAR prodcode
[MAX_PATH
];
12610 CHAR prod_squashed
[MAX_PATH
];
12611 HKEY prodkey
, userkey
, props
;
12615 REGSAM access
= KEY_ALL_ACCESS
;
12617 GetCurrentDirectoryA(MAX_PATH
, path
);
12618 lstrcatA(path
, "\\");
12620 create_test_guid(prodcode
, prod_squashed
);
12623 access
|= KEY_WOW64_64KEY
;
12625 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
12626 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12628 r
= MsiDatabaseCommit(hdb
);
12629 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12631 r
= set_summary_info(hdb
);
12632 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12635 "CREATE TABLE `Directory` ( "
12636 "`Directory` CHAR(255) NOT NULL, "
12637 "`Directory_Parent` CHAR(255), "
12638 "`DefaultDir` CHAR(255) NOT NULL "
12639 "PRIMARY KEY `Directory`)");
12640 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12643 "CREATE TABLE `Property` ( "
12644 "`Property` CHAR(72) NOT NULL, "
12645 "`Value` CHAR(255) "
12646 "PRIMARY KEY `Property`)");
12647 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12649 sprintf(query
, "INSERT INTO `Property` "
12650 "(`Property`, `Value`) "
12651 "VALUES( 'ProductCode', '%s' )", prodcode
);
12652 r
= run_query(hdb
, query
);
12653 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12655 r
= MsiDatabaseCommit(hdb
);
12656 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12658 MsiCloseHandle(hdb
);
12660 lstrcpyA(keypath
, "Software\\Classes\\Installer\\Products\\");
12661 lstrcatA(keypath
, prod_squashed
);
12663 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, NULL
, 0, access
, NULL
, &prodkey
, NULL
);
12664 if (res
== ERROR_ACCESS_DENIED
)
12666 skip("Not enough rights to perform tests\n");
12667 DeleteFile(msifile
);
12670 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12672 lstrcpyA(keypath
, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12673 lstrcatA(keypath
, "Installer\\UserData\\S-1-5-18\\Products\\");
12674 lstrcatA(keypath
, prod_squashed
);
12676 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, NULL
, 0, access
, NULL
, &userkey
, NULL
);
12677 if (res
== ERROR_ACCESS_DENIED
)
12679 skip("Not enough rights to perform tests\n");
12680 RegDeleteKeyA(prodkey
, "");
12681 RegCloseKey(prodkey
);
12684 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12686 res
= RegCreateKeyExA(userkey
, "InstallProperties", 0, NULL
, 0, access
, NULL
, &props
, NULL
);
12687 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12689 lstrcpyA(val
, path
);
12690 lstrcatA(val
, "\\");
12691 lstrcatA(val
, msifile
);
12692 res
= RegSetValueExA(props
, "LocalPackage", 0, REG_SZ
,
12693 (const BYTE
*)val
, lstrlenA(val
) + 1);
12694 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12696 hprod
= 0xdeadbeef;
12697 r
= MsiOpenProductA(prodcode
, &hprod
);
12698 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12699 ok(hprod
!= 0 && hprod
!= 0xdeadbeef, "Expected a valid product handle\n");
12701 /* hProduct is invalid */
12703 lstrcpyA(val
, "apple");
12704 r
= MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val
, &size
);
12705 ok(r
== ERROR_INVALID_HANDLE
,
12706 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12707 ok(!lstrcmpA(val
, "apple"),
12708 "Expected val to be unchanged, got \"%s\"\n", val
);
12709 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12711 /* szProperty is NULL */
12713 lstrcpyA(val
, "apple");
12714 r
= MsiGetProductPropertyA(hprod
, NULL
, val
, &size
);
12715 ok(r
== ERROR_INVALID_PARAMETER
,
12716 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12717 ok(!lstrcmpA(val
, "apple"),
12718 "Expected val to be unchanged, got \"%s\"\n", val
);
12719 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12721 /* szProperty is empty */
12723 lstrcpyA(val
, "apple");
12724 r
= MsiGetProductPropertyA(hprod
, "", val
, &size
);
12725 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12726 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12727 ok(size
== 0, "Expected 0, got %d\n", size
);
12729 /* get the property */
12731 lstrcpyA(val
, "apple");
12732 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12733 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12734 ok(!lstrcmpA(val
, prodcode
),
12735 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12736 ok(size
== lstrlenA(prodcode
),
12737 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12739 /* lpValueBuf is NULL */
12741 r
= MsiGetProductPropertyA(hprod
, "ProductCode", NULL
, &size
);
12742 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12743 ok(size
== lstrlenA(prodcode
),
12744 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12746 /* pcchValueBuf is NULL */
12747 lstrcpyA(val
, "apple");
12748 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, NULL
);
12749 ok(r
== ERROR_INVALID_PARAMETER
,
12750 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12751 ok(!lstrcmpA(val
, "apple"),
12752 "Expected val to be unchanged, got \"%s\"\n", val
);
12753 ok(size
== lstrlenA(prodcode
),
12754 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12756 /* pcchValueBuf is too small */
12758 lstrcpyA(val
, "apple");
12759 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12760 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
12761 ok(!strncmp(val
, prodcode
, 3),
12762 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
12763 ok(size
== lstrlenA(prodcode
),
12764 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12766 /* pcchValueBuf does not leave room for NULL terminator */
12767 size
= lstrlenA(prodcode
);
12768 lstrcpyA(val
, "apple");
12769 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12770 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
12771 ok(!strncmp(val
, prodcode
, lstrlenA(prodcode
) - 1),
12772 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
12773 ok(size
== lstrlenA(prodcode
),
12774 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12776 /* pcchValueBuf has enough room for NULL terminator */
12777 size
= lstrlenA(prodcode
) + 1;
12778 lstrcpyA(val
, "apple");
12779 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12780 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12781 ok(!lstrcmpA(val
, prodcode
),
12782 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12783 ok(size
== lstrlenA(prodcode
),
12784 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12786 /* nonexistent property */
12788 lstrcpyA(val
, "apple");
12789 r
= MsiGetProductPropertyA(hprod
, "IDontExist", val
, &size
);
12790 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12791 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12792 ok(size
== 0, "Expected 0, got %d\n", size
);
12794 r
= MsiSetPropertyA(hprod
, "NewProperty", "value");
12795 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12797 /* non-product property set */
12799 lstrcpyA(val
, "apple");
12800 r
= MsiGetProductPropertyA(hprod
, "NewProperty", val
, &size
);
12801 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12802 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12803 ok(size
== 0, "Expected 0, got %d\n", size
);
12805 r
= MsiSetPropertyA(hprod
, "ProductCode", "value");
12806 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12808 /* non-product property that is also a product property set */
12810 lstrcpyA(val
, "apple");
12811 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12812 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12813 ok(!lstrcmpA(val
, prodcode
),
12814 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12815 ok(size
== lstrlenA(prodcode
),
12816 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12818 MsiCloseHandle(hprod
);
12820 RegDeleteValueA(props
, "LocalPackage");
12821 delete_key(props
, "", access
);
12822 RegCloseKey(props
);
12823 delete_key(userkey
, "", access
);
12824 RegCloseKey(userkey
);
12825 delete_key(prodkey
, "", access
);
12826 RegCloseKey(prodkey
);
12827 DeleteFileA(msifile
);
12830 static void test_MsiSetProperty(void)
12832 MSIHANDLE hpkg
, hdb
, hrec
;
12833 CHAR buf
[MAX_PATH
];
12838 r
= package_from_db(create_package_db(), &hpkg
);
12839 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
12841 skip("Not enough rights to perform tests\n");
12842 DeleteFile(msifile
);
12845 ok(r
== ERROR_SUCCESS
, "Expected a valid package %u\n", r
);
12847 /* invalid hInstall */
12848 r
= MsiSetPropertyA(0, "Prop", "Val");
12849 ok(r
== ERROR_INVALID_HANDLE
,
12850 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12852 /* invalid hInstall */
12853 r
= MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12854 ok(r
== ERROR_INVALID_HANDLE
,
12855 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12857 /* szName is NULL */
12858 r
= MsiSetPropertyA(hpkg
, NULL
, "Val");
12859 ok(r
== ERROR_INVALID_PARAMETER
,
12860 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12862 /* both szName and szValue are NULL */
12863 r
= MsiSetPropertyA(hpkg
, NULL
, NULL
);
12864 ok(r
== ERROR_INVALID_PARAMETER
,
12865 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12867 /* szName is empty */
12868 r
= MsiSetPropertyA(hpkg
, "", "Val");
12869 ok(r
== ERROR_FUNCTION_FAILED
,
12870 "Expected ERROR_FUNCTION_FAILED, got %d\n", r
);
12872 /* szName is empty and szValue is NULL */
12873 r
= MsiSetPropertyA(hpkg
, "", NULL
);
12874 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12876 /* set a property */
12877 r
= MsiSetPropertyA(hpkg
, "Prop", "Val");
12878 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12880 /* get the property */
12882 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12883 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12884 ok(!lstrcmpA(buf
, "Val"), "Expected \"Val\", got \"%s\"\n", buf
);
12885 ok(size
== 3, "Expected 3, got %d\n", size
);
12887 /* update the property */
12888 r
= MsiSetPropertyA(hpkg
, "Prop", "Nuvo");
12889 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12891 /* get the property */
12893 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12894 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12895 ok(!lstrcmpA(buf
, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf
);
12896 ok(size
== 4, "Expected 4, got %d\n", size
);
12898 hdb
= MsiGetActiveDatabase(hpkg
);
12899 ok(hdb
!= 0, "Expected a valid database handle\n");
12901 /* set prop is not in the _Property table */
12902 query
= "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12903 r
= do_query(hdb
, query
, &hrec
);
12904 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12905 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12907 /* set prop is not in the Property table */
12908 query
= "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12909 r
= do_query(hdb
, query
, &hrec
);
12910 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12911 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12913 MsiCloseHandle(hdb
);
12915 /* szValue is an empty string */
12916 r
= MsiSetPropertyA(hpkg
, "Prop", "");
12917 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12919 /* try to get the property */
12921 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12922 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12923 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
12924 ok(size
== 0, "Expected 0, got %d\n", size
);
12926 /* reset the property */
12927 r
= MsiSetPropertyA(hpkg
, "Prop", "BlueTap");
12928 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12930 /* delete the property */
12931 r
= MsiSetPropertyA(hpkg
, "Prop", NULL
);
12932 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12934 /* try to get the property */
12936 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12937 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12938 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
12939 ok(size
== 0, "Expected 0, got %d\n", size
);
12941 MsiCloseHandle(hpkg
);
12942 DeleteFileA(msifile
);
12945 static void test_MsiApplyMultiplePatches(void)
12947 UINT r
, type
= GetDriveType(NULL
);
12949 if (!pMsiApplyMultiplePatchesA
) {
12950 win_skip("MsiApplyMultiplePatchesA not found\n");
12954 r
= pMsiApplyMultiplePatchesA(NULL
, NULL
, NULL
);
12955 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
12957 r
= pMsiApplyMultiplePatchesA("", NULL
, NULL
);
12958 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
12960 r
= pMsiApplyMultiplePatchesA(";", NULL
, NULL
);
12961 if (type
== DRIVE_FIXED
)
12962 todo_wine
ok(r
== ERROR_PATH_NOT_FOUND
, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
12964 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
12966 r
= pMsiApplyMultiplePatchesA(" ;", NULL
, NULL
);
12967 if (type
== DRIVE_FIXED
)
12968 todo_wine
ok(r
== ERROR_PATCH_PACKAGE_OPEN_FAILED
, "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r
);
12970 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
12972 r
= pMsiApplyMultiplePatchesA(";;", NULL
, NULL
);
12973 if (type
== DRIVE_FIXED
)
12974 todo_wine
ok(r
== ERROR_PATH_NOT_FOUND
, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
12976 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
12978 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL
, NULL
);
12979 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
12981 r
= pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL
, NULL
);
12982 if (type
== DRIVE_FIXED
)
12983 todo_wine
ok(r
== ERROR_PATH_NOT_FOUND
, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
12985 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
12987 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL
, NULL
);
12988 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
12990 r
= pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL
, NULL
);
12991 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
12994 static void test_MsiApplyPatch(void)
12998 r
= MsiApplyPatch(NULL
, NULL
, INSTALLTYPE_DEFAULT
, NULL
);
12999 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13001 r
= MsiApplyPatch("", NULL
, INSTALLTYPE_DEFAULT
, NULL
);
13002 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13005 static void test_MsiEnumComponentCosts(void)
13007 MSIHANDLE hdb
, hpkg
;
13008 char package
[12], drive
[3];
13013 hdb
= create_package_db();
13014 ok( hdb
, "failed to create database\n" );
13016 r
= create_property_table( hdb
);
13017 ok( r
== ERROR_SUCCESS
, "cannot create Property table %u\n", r
);
13019 r
= add_property_entry( hdb
, "'ProductCode', '{379B1C47-40C1-42FA-A9BB-BEBB6F1B0172}'" );
13020 ok( r
== ERROR_SUCCESS
, "cannot add property entry %u\n", r
);
13022 r
= add_property_entry( hdb
, "'MSIFASTINSTALL', '1'" );
13023 ok( r
== ERROR_SUCCESS
, "cannot add property entry %u\n", r
);
13025 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
13026 ok( r
== ERROR_SUCCESS
, "failed to add directory entry %u\n" , r
);
13028 r
= create_media_table( hdb
);
13029 ok( r
== ERROR_SUCCESS
, "cannot create Media table %u\n", r
);
13031 r
= add_media_entry( hdb
, "'1', '2', 'cabinet', '', '', ''");
13032 ok( r
== ERROR_SUCCESS
, "cannot add media entry %u\n", r
);
13034 r
= create_file_table( hdb
);
13035 ok( r
== ERROR_SUCCESS
, "cannot create File table %u\n", r
);
13037 r
= add_file_entry( hdb
, "'one.txt', 'one', 'one.txt', 4096, '', '', 8192, 1" );
13038 ok( r
== ERROR_SUCCESS
, "cannot add file %u\n", r
);
13040 r
= create_component_table( hdb
);
13041 ok( r
== ERROR_SUCCESS
, "cannot create Component table %u\n", r
);
13043 r
= add_component_entry( hdb
, "'one', '{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '', 'one.txt'" );
13044 ok( r
== ERROR_SUCCESS
, "cannot add component %u\n", r
);
13046 r
= add_component_entry( hdb
, "'two', '{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '', ''" );
13047 ok( r
== ERROR_SUCCESS
, "cannot add component %u\n", r
);
13049 r
= create_feature_table( hdb
);
13050 ok( r
== ERROR_SUCCESS
, "cannot create Feature table %u\n", r
);
13052 r
= add_feature_entry( hdb
, "'one', '', '', '', 0, 1, '', 0" );
13053 ok( r
== ERROR_SUCCESS
, "cannot add feature %u\n", r
);
13055 r
= add_feature_entry( hdb
, "'two', '', '', '', 0, 1, '', 0" );
13056 ok( r
== ERROR_SUCCESS
, "cannot add feature %u\n", r
);
13058 r
= create_feature_components_table( hdb
);
13059 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table %u\n", r
);
13061 r
= add_feature_components_entry( hdb
, "'one', 'one'" );
13062 ok( r
== ERROR_SUCCESS
, "cannot add feature/component pair %u\n", r
);
13064 r
= add_feature_components_entry( hdb
, "'two', 'two'" );
13065 ok( r
== ERROR_SUCCESS
, "cannot add feature/component pair %u\n", r
);
13067 r
= create_install_execute_sequence_table( hdb
);
13068 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table %u\n", r
);
13070 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
13071 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13073 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
13074 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13076 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
13077 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13079 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1100'" );
13080 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13082 MsiDatabaseCommit( hdb
);
13084 sprintf( package
, "#%u", hdb
);
13085 r
= MsiOpenPackageA( package
, &hpkg
);
13086 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
13088 skip("Not enough rights to perform tests\n");
13091 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13093 r
= MsiEnumComponentCostsA( 0, NULL
, 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13094 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13096 r
= MsiEnumComponentCostsA( hpkg
, NULL
, 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13097 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13099 r
= MsiEnumComponentCostsA( hpkg
, NULL
, 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13100 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13102 r
= MsiEnumComponentCostsA( hpkg
, "", 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13103 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13105 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13106 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13108 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, NULL
, NULL
, NULL
, NULL
);
13109 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13111 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, NULL
, NULL
, NULL
);
13112 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13114 len
= sizeof(drive
);
13115 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, NULL
, NULL
);
13116 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13118 len
= sizeof(drive
);
13119 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, NULL
);
13120 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13122 len
= sizeof(drive
);
13123 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13124 todo_wine
ok( r
== ERROR_INVALID_HANDLE_STATE
, "Expected ERROR_INVALID_HANDLE_STATE, got %u\n", r
);
13126 len
= sizeof(drive
);
13127 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, NULL
, &len
, &cost
, &temp
);
13128 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13130 MsiSetInternalUI( INSTALLUILEVEL_NONE
, NULL
);
13132 r
= MsiDoAction( hpkg
, "CostInitialize" );
13133 ok( r
== ERROR_SUCCESS
, "CostInitialize failed %u\n", r
);
13135 r
= MsiDoAction( hpkg
, "FileCost" );
13136 ok( r
== ERROR_SUCCESS
, "FileCost failed %u\n", r
);
13138 len
= sizeof(drive
);
13139 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13140 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r
);
13142 r
= MsiDoAction( hpkg
, "CostFinalize" );
13143 ok( r
== ERROR_SUCCESS
, "CostFinalize failed %u\n", r
);
13145 /* contrary to what msdn says InstallValidate must be called too */
13146 len
= sizeof(drive
);
13147 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13148 todo_wine
ok( r
== ERROR_FUNCTION_NOT_CALLED
, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r
);
13150 r
= MsiDoAction( hpkg
, "InstallValidate" );
13151 ok( r
== ERROR_SUCCESS
, "InstallValidate failed %u\n", r
);
13154 r
= MsiEnumComponentCostsA( hpkg
, "three", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13155 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %u\n", r
);
13158 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13159 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %u\n", r
);
13160 ok( len
== 2, "expected len == 2, got %u\n", len
);
13163 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13164 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %u\n", r
);
13165 ok( len
== 2, "expected len == 2, got %u\n", len
);
13168 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13169 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %u\n", r
);
13170 ok( len
== 2, "expected len == 2, got %u\n", len
);
13172 /* install state doesn't seem to matter */
13173 len
= sizeof(drive
);
13174 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13175 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13177 len
= sizeof(drive
);
13178 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_ABSENT
, drive
, &len
, &cost
, &temp
);
13179 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13181 len
= sizeof(drive
);
13182 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_SOURCE
, drive
, &len
, &cost
, &temp
);
13183 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13185 len
= sizeof(drive
);
13187 cost
= temp
= 0xdead;
13188 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13189 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13190 ok( len
== 2, "expected len == 2, got %u\n", len
);
13191 ok( drive
[0], "expected a drive\n" );
13192 ok( cost
&& cost
!= 0xdead, "expected cost > 0, got %d\n", cost
);
13193 ok( !temp
, "expected temp == 0, got %d\n", temp
);
13195 len
= sizeof(drive
);
13197 cost
= temp
= 0xdead;
13198 r
= MsiEnumComponentCostsA( hpkg
, "two", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13199 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13200 ok( len
== 2, "expected len == 2, got %u\n", len
);
13201 ok( drive
[0], "expected a drive\n" );
13202 ok( !cost
, "expected cost == 0, got %d\n", cost
);
13203 ok( !temp
, "expected temp == 0, got %d\n", temp
);
13205 len
= sizeof(drive
);
13207 cost
= temp
= 0xdead;
13208 r
= MsiEnumComponentCostsA( hpkg
, "", 0, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13209 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13210 ok( len
== 2, "expected len == 2, got %u\n", len
);
13211 ok( drive
[0], "expected a drive\n" );
13212 ok( !cost
, "expected cost == 0, got %d\n", cost
);
13213 ok( temp
&& temp
!= 0xdead, "expected temp > 0, got %d\n", temp
);
13215 /* increased index */
13216 len
= sizeof(drive
);
13217 r
= MsiEnumComponentCostsA( hpkg
, "one", 1, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13218 ok( r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r
);
13220 len
= sizeof(drive
);
13221 r
= MsiEnumComponentCostsA( hpkg
, "", 1, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13222 ok( r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r
);
13224 MsiCloseHandle( hpkg
);
13226 MsiCloseHandle( hdb
);
13227 DeleteFileA( msifile
);
13230 START_TEST(package
)
13232 STATEMGRSTATUS status
;
13235 init_functionpointers();
13237 if (pIsWow64Process
)
13238 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
13240 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
13242 /* Create a restore point ourselves so we circumvent the multitude of restore points
13243 * that would have been created by all the installation and removal tests.
13245 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
13246 * creation of restore points.
13248 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
13250 memset(&status
, 0, sizeof(status
));
13251 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
13254 test_createpackage();
13256 test_gettargetpath_bad();
13257 test_settargetpath();
13259 test_property_table();
13262 test_formatrecord2();
13264 test_getproperty();
13265 test_removefiles();
13267 test_appsearch_complocator();
13268 test_appsearch_reglocator();
13269 test_appsearch_inilocator();
13270 test_appsearch_drlocator();
13271 test_featureparents();
13272 test_installprops();
13273 test_launchconditions();
13275 test_complocator();
13276 test_MsiGetSourcePath();
13277 test_shortlongsource();
13280 test_emptypackage();
13281 test_MsiGetProductProperty();
13282 test_MsiSetProperty();
13283 test_MsiApplyMultiplePatches();
13284 test_MsiApplyPatch();
13285 test_MsiEnumComponentCosts();
13287 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
13289 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
13291 remove_restore_point(status
.llSequenceNumber
);