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
;
10034 INSTALLUILEVEL uilevel
;
10037 access
|= KEY_WOW64_64KEY
;
10039 GetCurrentDirectory(MAX_PATH
, path
);
10040 lstrcat(path
, "\\");
10041 lstrcat(path
, msifile
);
10043 uilevel
= MsiSetInternalUI(INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_SOURCERESONLY
, NULL
);
10045 hdb
= create_package_db();
10046 ok( hdb
, "failed to create database\n");
10048 r
= package_from_db(hdb
, &hpkg
);
10049 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10051 skip("Not enough rights to perform tests\n");
10052 MsiSetInternalUI(uilevel
, NULL
);
10053 DeleteFile(msifile
);
10056 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10058 MsiCloseHandle(hdb
);
10062 r
= MsiGetProperty(hpkg
, "UILevel", buf
, &size
);
10063 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10064 ok( !lstrcmp(buf
, "3"), "Expected \"3\", got \"%s\"\n", buf
);
10066 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10070 r
= MsiGetProperty(hpkg
, "UILevel", buf
, &size
);
10071 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10072 ok( !lstrcmp(buf
, "3"), "Expected \"3\", got \"%s\"\n", buf
);
10076 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
10077 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10078 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
10080 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
10081 RegOpenKeyEx(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey2
);
10086 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
10090 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
10095 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
10096 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10097 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
10102 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
10106 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
10113 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
10114 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10115 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
10120 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
10121 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10122 trace("VersionDatabase = %s\n", buf
);
10126 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
10127 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10128 trace("VersionMsi = %s\n", buf
);
10132 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
10133 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10134 trace("Date = %s\n", buf
);
10138 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
10139 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10140 trace("Time = %s\n", buf
);
10144 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
10145 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10146 trace("PackageCode = %s\n", buf
);
10150 r
= MsiGetProperty(hpkg
, "ComputerName", buf
, &size
);
10151 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10152 trace("ComputerName = %s\n", buf
);
10154 langid
= GetUserDefaultLangID();
10155 sprintf(path
, "%d", langid
);
10159 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
10160 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10161 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
10163 res
= GetSystemMetrics(SM_CXSCREEN
);
10166 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
10167 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10168 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
10170 res
= GetSystemMetrics(SM_CYSCREEN
);
10173 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
10174 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS got %d\n", r
);
10175 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
10177 if (pGetSystemInfo
&& pSHGetFolderPathA
)
10179 pGetSystemInfo(&si
);
10180 if (S(U(si
)).wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_AMD64
)
10184 r
= MsiGetProperty(hpkg
, "Intel", buf
, &size
);
10185 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10186 ok(buf
[0], "property not set\n");
10190 r
= MsiGetProperty(hpkg
, "MsiAMD64", buf
, &size
);
10191 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10192 ok(buf
[0], "property not set\n");
10196 r
= MsiGetProperty(hpkg
, "Msix64", buf
, &size
);
10197 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10198 ok(buf
[0], "property not set\n");
10202 r
= MsiGetProperty(hpkg
, "System64Folder", buf
, &size
);
10203 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10204 GetSystemDirectoryA(path
, MAX_PATH
);
10205 if (size
) buf
[size
- 1] = 0;
10206 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10210 r
= MsiGetProperty(hpkg
, "SystemFolder", buf
, &size
);
10211 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10212 pGetSystemWow64DirectoryA(path
, MAX_PATH
);
10213 if (size
) buf
[size
- 1] = 0;
10214 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10218 r
= MsiGetProperty(hpkg
, "ProgramFiles64Folder", buf
, &size
);
10219 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10220 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES
, NULL
, 0, path
);
10221 if (size
) buf
[size
- 1] = 0;
10222 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10226 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder", buf
, &size
);
10227 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10228 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILESX86
, NULL
, 0, path
);
10229 if (size
) buf
[size
- 1] = 0;
10230 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10234 r
= MsiGetProperty(hpkg
, "CommonFiles64Folder", buf
, &size
);
10235 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10236 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMON
, NULL
, 0, path
);
10237 if (size
) buf
[size
- 1] = 0;
10238 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10242 r
= MsiGetProperty(hpkg
, "CommonFilesFolder", buf
, &size
);
10243 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10244 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMONX86
, NULL
, 0, path
);
10245 if (size
) buf
[size
- 1] = 0;
10246 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10250 r
= MsiGetProperty(hpkg
, "VersionNT64", buf
, &size
);
10251 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10252 ok(buf
[0], "property not set\n");
10254 else if (S(U(si
)).wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_INTEL
)
10260 r
= MsiGetProperty(hpkg
, "Intel", buf
, &size
);
10261 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10262 ok(buf
[0], "property not set\n");
10266 r
= MsiGetProperty(hpkg
, "MsiAMD64", buf
, &size
);
10267 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10268 ok(!buf
[0], "property set\n");
10272 r
= MsiGetProperty(hpkg
, "Msix64", buf
, &size
);
10273 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10274 ok(!buf
[0], "property set\n");
10278 r
= MsiGetProperty(hpkg
, "System64Folder", buf
, &size
);
10279 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10280 ok(!buf
[0], "property set\n");
10284 r
= MsiGetProperty(hpkg
, "SystemFolder", buf
, &size
);
10285 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10286 GetSystemDirectoryA(path
, MAX_PATH
);
10287 if (size
) buf
[size
- 1] = 0;
10288 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10292 r
= MsiGetProperty(hpkg
, "ProgramFiles64Folder", buf
, &size
);
10293 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10294 ok(!buf
[0], "property set\n");
10298 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder", buf
, &size
);
10299 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10300 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES
, NULL
, 0, path
);
10301 if (size
) buf
[size
- 1] = 0;
10302 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10306 r
= MsiGetProperty(hpkg
, "CommonFiles64Folder", buf
, &size
);
10307 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10308 ok(!buf
[0], "property set\n");
10312 r
= MsiGetProperty(hpkg
, "CommonFilesFolder", buf
, &size
);
10313 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10314 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMON
, NULL
, 0, path
);
10315 if (size
) buf
[size
- 1] = 0;
10316 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10320 r
= MsiGetProperty(hpkg
, "VersionNT64", buf
, &size
);
10321 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10322 ok(!buf
[0], "property set\n");
10328 r
= MsiGetProperty(hpkg
, "Intel", buf
, &size
);
10329 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10330 ok(buf
[0], "property not set\n");
10334 r
= MsiGetProperty(hpkg
, "MsiAMD64", buf
, &size
);
10335 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10336 ok(buf
[0], "property not set\n");
10340 r
= MsiGetProperty(hpkg
, "Msix64", buf
, &size
);
10341 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10342 ok(buf
[0], "property not set\n");
10346 r
= MsiGetProperty(hpkg
, "System64Folder", buf
, &size
);
10347 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10348 GetSystemDirectoryA(path
, MAX_PATH
);
10349 if (size
) buf
[size
- 1] = 0;
10350 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10354 r
= MsiGetProperty(hpkg
, "SystemFolder", buf
, &size
);
10355 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10356 pGetSystemWow64DirectoryA(path
, MAX_PATH
);
10357 if (size
) buf
[size
- 1] = 0;
10358 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10362 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder64", buf
, &size
);
10363 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10364 ok(!buf
[0], "property set\n");
10368 r
= MsiGetProperty(hpkg
, "ProgramFilesFolder", buf
, &size
);
10369 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10370 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILESX86
, NULL
, 0, path
);
10371 if (size
) buf
[size
- 1] = 0;
10372 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10376 r
= MsiGetProperty(hpkg
, "CommonFilesFolder64", buf
, &size
);
10377 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10378 ok(!buf
[0], "property set\n");
10382 r
= MsiGetProperty(hpkg
, "CommonFilesFolder", buf
, &size
);
10383 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10384 pSHGetFolderPathA(NULL
, CSIDL_PROGRAM_FILES_COMMONX86
, NULL
, 0, path
);
10385 if (size
) buf
[size
- 1] = 0;
10386 ok(!lstrcmpiA(path
, buf
), "expected \"%s\", got \"%s\"\n", path
, buf
);
10390 r
= MsiGetProperty(hpkg
, "VersionNT64", buf
, &size
);
10391 ok(r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
10392 ok(buf
[0], "property not set\n");
10397 CloseHandle(hkey1
);
10398 CloseHandle(hkey2
);
10399 MsiCloseHandle(hpkg
);
10400 DeleteFile(msifile
);
10401 MsiSetInternalUI(uilevel
, NULL
);
10404 static void test_launchconditions(void)
10410 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10412 hdb
= create_package_db();
10413 ok( hdb
, "failed to create package database\n" );
10415 r
= create_launchcondition_table( hdb
);
10416 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
10418 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
10419 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
10421 /* invalid condition */
10422 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
10423 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
10425 r
= package_from_db( hdb
, &hpkg
);
10426 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10428 skip("Not enough rights to perform tests\n");
10429 DeleteFile(msifile
);
10432 ok( r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10434 MsiCloseHandle( hdb
);
10436 r
= MsiSetProperty( hpkg
, "X", "1" );
10437 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
10439 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10441 /* invalid conditions are ignored */
10442 r
= MsiDoAction( hpkg
, "LaunchConditions" );
10443 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
10445 /* verify LaunchConditions still does some verification */
10446 r
= MsiSetProperty( hpkg
, "X", "2" );
10447 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
10449 r
= MsiDoAction( hpkg
, "LaunchConditions" );
10450 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
10452 MsiCloseHandle( hpkg
);
10453 DeleteFile( msifile
);
10456 static void test_ccpsearch(void)
10458 MSIHANDLE hdb
, hpkg
;
10459 CHAR prop
[MAX_PATH
];
10460 DWORD size
= MAX_PATH
;
10463 hdb
= create_package_db();
10464 ok(hdb
, "failed to create package database\n");
10466 r
= create_ccpsearch_table(hdb
);
10467 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10469 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
10470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10472 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
10473 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10475 r
= create_reglocator_table(hdb
);
10476 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10478 r
= add_reglocator_entry(hdb
, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10479 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10481 r
= create_drlocator_table(hdb
);
10482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10484 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
10485 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10487 r
= create_signature_table(hdb
);
10488 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10490 r
= package_from_db(hdb
, &hpkg
);
10491 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10493 skip("Not enough rights to perform tests\n");
10494 DeleteFile(msifile
);
10497 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10499 MsiCloseHandle(hdb
);
10501 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10503 r
= MsiDoAction(hpkg
, "CCPSearch");
10504 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10506 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
10507 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10508 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
10510 MsiCloseHandle(hpkg
);
10511 DeleteFileA(msifile
);
10514 static void test_complocator(void)
10516 MSIHANDLE hdb
, hpkg
;
10518 CHAR prop
[MAX_PATH
];
10519 CHAR expected
[MAX_PATH
];
10520 DWORD size
= MAX_PATH
;
10522 hdb
= create_package_db();
10523 ok(hdb
, "failed to create package database\n");
10525 r
= create_appsearch_table(hdb
);
10526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10528 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
10529 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10531 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
10532 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10534 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
10535 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10537 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
10538 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10540 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
10541 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10543 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
10544 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10546 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
10547 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10549 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
10550 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10552 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
10553 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10555 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
10556 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10558 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
10559 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10561 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
10562 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10564 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
10565 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10567 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
10568 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10570 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
10571 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10573 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
10574 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10576 r
= create_complocator_table(hdb
);
10577 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10579 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10580 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10582 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10583 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10585 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10586 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10588 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10591 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10592 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10594 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10595 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10597 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10598 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10600 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10601 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10603 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10604 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10606 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10607 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10609 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10610 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10612 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10613 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10615 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10616 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10618 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10619 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10621 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10622 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10624 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10625 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10627 r
= create_signature_table(hdb
);
10628 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10630 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10631 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10633 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10634 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10636 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10637 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10639 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10640 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10642 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10643 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10645 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10646 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10648 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10649 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10651 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10652 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10654 r
= package_from_db(hdb
, &hpkg
);
10655 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10657 skip("Not enough rights to perform tests\n");
10658 DeleteFile(msifile
);
10661 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10663 MsiCloseHandle(hdb
);
10665 create_test_file("abelisaurus");
10666 create_test_file("bactrosaurus");
10667 create_test_file("camelotia");
10668 create_test_file("diclonius");
10669 create_test_file("echinodon");
10670 create_test_file("falcarius");
10671 create_test_file("gallimimus");
10672 create_test_file("hagryphus");
10673 CreateDirectoryA("iguanodon", NULL
);
10674 CreateDirectoryA("jobaria", NULL
);
10675 CreateDirectoryA("kakuru", NULL
);
10676 CreateDirectoryA("labocania", NULL
);
10677 CreateDirectoryA("megaraptor", NULL
);
10678 CreateDirectoryA("neosodon", NULL
);
10679 CreateDirectoryA("olorotitan", NULL
);
10680 CreateDirectoryA("pantydraco", NULL
);
10682 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE
,
10683 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL
, FALSE
);
10684 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE
,
10685 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL
, FALSE
);
10686 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE
,
10687 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL
, FALSE
);
10688 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE
,
10689 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL
, FALSE
);
10690 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE
,
10691 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL
, FALSE
);
10692 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE
,
10693 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL
, FALSE
);
10694 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE
,
10695 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL
, FALSE
);
10696 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE
,
10697 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL
, FALSE
);
10699 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
10701 r
= MsiDoAction(hpkg
, "AppSearch");
10702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10705 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
10706 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10708 lstrcpyA(expected
, CURR_DIR
);
10709 lstrcatA(expected
, "\\abelisaurus");
10710 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10711 "Expected %s or empty string, got %s\n", expected
, prop
);
10714 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", 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
, "CAMELOTIA", 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
, "DICLONIUS", prop
, &size
);
10725 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10726 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10729 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
10730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10732 lstrcpyA(expected
, CURR_DIR
);
10733 lstrcatA(expected
, "\\");
10734 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10735 "Expected %s or empty string, got %s\n", expected
, prop
);
10738 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
10739 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10740 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10743 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
10744 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10745 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10748 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
10749 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10750 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10753 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
10754 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10755 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10758 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
10759 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10760 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10763 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
10764 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10765 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10768 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
10769 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10770 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10773 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
10774 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10776 lstrcpyA(expected
, CURR_DIR
);
10777 lstrcatA(expected
, "\\");
10778 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10779 "Expected %s or empty string, got %s\n", expected
, prop
);
10782 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
10783 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10785 lstrcpyA(expected
, CURR_DIR
);
10786 lstrcatA(expected
, "\\neosodon\\");
10787 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
10788 "Expected %s or empty string, got %s\n", expected
, prop
);
10791 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
10792 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10793 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10796 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
10797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10798 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
10800 MsiCloseHandle(hpkg
);
10801 DeleteFileA("abelisaurus");
10802 DeleteFileA("bactrosaurus");
10803 DeleteFileA("camelotia");
10804 DeleteFileA("diclonius");
10805 DeleteFileA("echinodon");
10806 DeleteFileA("falcarius");
10807 DeleteFileA("gallimimus");
10808 DeleteFileA("hagryphus");
10809 RemoveDirectoryA("iguanodon");
10810 RemoveDirectoryA("jobaria");
10811 RemoveDirectoryA("kakuru");
10812 RemoveDirectoryA("labocania");
10813 RemoveDirectoryA("megaraptor");
10814 RemoveDirectoryA("neosodon");
10815 RemoveDirectoryA("olorotitan");
10816 RemoveDirectoryA("pantydraco");
10817 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10818 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10819 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10820 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10821 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10822 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10823 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10824 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10825 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10826 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10827 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10828 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10829 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10830 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10831 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10832 MSIINSTALLCONTEXT_MACHINE
, NULL
);
10833 DeleteFileA(msifile
);
10836 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
10841 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
10842 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10844 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
10845 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10847 r
= MsiSummaryInfoPersist(summary
);
10848 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
10850 MsiCloseHandle(summary
);
10853 static void test_MsiGetSourcePath(void)
10855 MSIHANDLE hdb
, hpkg
;
10856 CHAR path
[MAX_PATH
];
10857 CHAR cwd
[MAX_PATH
];
10858 CHAR subsrc
[MAX_PATH
];
10859 CHAR sub2
[MAX_PATH
];
10863 lstrcpyA(cwd
, CURR_DIR
);
10864 lstrcatA(cwd
, "\\");
10866 lstrcpyA(subsrc
, cwd
);
10867 lstrcatA(subsrc
, "subsource");
10868 lstrcatA(subsrc
, "\\");
10870 lstrcpyA(sub2
, subsrc
);
10871 lstrcatA(sub2
, "sub2");
10872 lstrcatA(sub2
, "\\");
10874 /* uncompressed source */
10876 hdb
= create_package_db();
10877 ok( hdb
, "failed to create database\n");
10879 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
10881 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
10882 ok(r
== S_OK
, "failed\n");
10884 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10885 ok(r
== S_OK
, "failed\n");
10887 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
10888 ok(r
== S_OK
, "failed\n");
10890 r
= MsiDatabaseCommit(hdb
);
10891 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
10893 r
= package_from_db(hdb
, &hpkg
);
10894 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
10896 skip("Not enough rights to perform tests\n");
10897 DeleteFile(msifile
);
10900 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
10902 MsiCloseHandle(hdb
);
10904 /* invalid database handle */
10906 lstrcpyA(path
, "kiwi");
10907 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
10908 ok(r
== ERROR_INVALID_HANDLE
,
10909 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
10910 ok(!lstrcmpA(path
, "kiwi"),
10911 "Expected path to be unchanged, got \"%s\"\n", path
);
10912 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10914 /* NULL szFolder */
10916 lstrcpyA(path
, "kiwi");
10917 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
10918 ok(r
== ERROR_INVALID_PARAMETER
,
10919 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
10920 ok(!lstrcmpA(path
, "kiwi"),
10921 "Expected path to be unchanged, got \"%s\"\n", path
);
10922 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10924 /* empty szFolder */
10926 lstrcpyA(path
, "kiwi");
10927 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
10928 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10929 ok(!lstrcmpA(path
, "kiwi"),
10930 "Expected path to be unchanged, got \"%s\"\n", path
);
10931 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10933 /* try TARGETDIR */
10935 lstrcpyA(path
, "kiwi");
10936 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
10937 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10938 ok(!lstrcmpA(path
, "kiwi"),
10939 "Expected path to be unchanged, got \"%s\"\n", path
);
10940 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10943 lstrcpyA(path
, "kiwi");
10944 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10945 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10946 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10947 ok(size
== 0, "Expected 0, got %d\n", size
);
10950 lstrcpyA(path
, "kiwi");
10951 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10952 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10953 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10954 ok(size
== 0, "Expected 0, got %d\n", size
);
10956 /* try SourceDir */
10958 lstrcpyA(path
, "kiwi");
10959 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10960 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10961 ok(!lstrcmpA(path
, "kiwi"),
10962 "Expected path to be unchanged, got \"%s\"\n", path
);
10963 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10965 /* try SOURCEDIR */
10967 lstrcpyA(path
, "kiwi");
10968 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10969 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10970 ok(!lstrcmpA(path
, "kiwi"),
10971 "Expected path to be unchanged, got \"%s\"\n", path
);
10972 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10974 /* source path does not exist, but the property exists */
10976 lstrcpyA(path
, "kiwi");
10977 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10978 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10979 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10980 ok(size
== 0, "Expected 0, got %d\n", size
);
10983 lstrcpyA(path
, "kiwi");
10984 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10985 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10986 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10987 ok(size
== 0, "Expected 0, got %d\n", size
);
10991 lstrcpyA(path
, "kiwi");
10992 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10993 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10994 ok(!lstrcmpA(path
, "kiwi"),
10995 "Expected path to be unchanged, got \"%s\"\n", path
);
10996 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11000 lstrcpyA(path
, "kiwi");
11001 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11002 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11003 ok(!lstrcmpA(path
, "kiwi"),
11004 "Expected path to be unchanged, got \"%s\"\n", path
);
11005 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11007 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
11009 r
= MsiDoAction(hpkg
, "CostInitialize");
11010 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
11012 /* try TARGETDIR after CostInitialize */
11014 lstrcpyA(path
, "kiwi");
11015 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11016 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11017 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11018 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11020 /* try SourceDir after CostInitialize */
11022 lstrcpyA(path
, "kiwi");
11023 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11024 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11025 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11026 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11028 /* try SOURCEDIR after CostInitialize */
11030 lstrcpyA(path
, "kiwi");
11031 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11032 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11033 ok(!lstrcmpA(path
, "kiwi"),
11034 "Expected path to be unchanged, got \"%s\"\n", path
);
11035 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11037 /* source path does not exist, but the property exists */
11039 lstrcpyA(path
, "kiwi");
11040 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11041 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11042 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11043 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11046 lstrcpyA(path
, "kiwi");
11047 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11048 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11049 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11050 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11052 /* try SubDir after CostInitialize */
11054 lstrcpyA(path
, "kiwi");
11055 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11056 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11057 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11058 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11060 /* try SubDir2 after CostInitialize */
11062 lstrcpyA(path
, "kiwi");
11063 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11064 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11065 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11066 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11068 r
= MsiDoAction(hpkg
, "ResolveSource");
11069 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11071 /* try TARGETDIR after ResolveSource */
11073 lstrcpyA(path
, "kiwi");
11074 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11075 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11076 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11077 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11079 /* try SourceDir after ResolveSource */
11081 lstrcpyA(path
, "kiwi");
11082 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11083 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11084 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11085 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11087 /* try SOURCEDIR after ResolveSource */
11089 lstrcpyA(path
, "kiwi");
11090 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11091 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11092 ok(!lstrcmpA(path
, "kiwi"),
11093 "Expected path to be unchanged, got \"%s\"\n", path
);
11094 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11096 /* source path does not exist, but the property exists */
11098 lstrcpyA(path
, "kiwi");
11099 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11100 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11101 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11102 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11105 lstrcpyA(path
, "kiwi");
11106 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11107 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11108 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11109 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11111 /* try SubDir after ResolveSource */
11113 lstrcpyA(path
, "kiwi");
11114 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11115 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11116 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11117 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11119 /* try SubDir2 after ResolveSource */
11121 lstrcpyA(path
, "kiwi");
11122 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11123 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11124 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11125 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11127 r
= MsiDoAction(hpkg
, "FileCost");
11128 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11130 /* try TARGETDIR after FileCost */
11132 lstrcpyA(path
, "kiwi");
11133 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11134 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11135 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11136 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11138 /* try SourceDir after FileCost */
11140 lstrcpyA(path
, "kiwi");
11141 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11142 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11143 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11144 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11146 /* try SOURCEDIR after FileCost */
11148 lstrcpyA(path
, "kiwi");
11149 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11150 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11151 ok(!lstrcmpA(path
, "kiwi"),
11152 "Expected path to be unchanged, got \"%s\"\n", path
);
11153 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11155 /* source path does not exist, but the property exists */
11157 lstrcpyA(path
, "kiwi");
11158 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11160 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11161 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11164 lstrcpyA(path
, "kiwi");
11165 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11166 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11167 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11168 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11170 /* try SubDir after FileCost */
11172 lstrcpyA(path
, "kiwi");
11173 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11174 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11175 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11176 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11178 /* try SubDir2 after FileCost */
11180 lstrcpyA(path
, "kiwi");
11181 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11182 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11183 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11184 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11186 r
= MsiDoAction(hpkg
, "CostFinalize");
11187 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11189 /* try TARGETDIR after CostFinalize */
11191 lstrcpyA(path
, "kiwi");
11192 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11193 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11194 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11195 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11197 /* try SourceDir after CostFinalize */
11199 lstrcpyA(path
, "kiwi");
11200 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11201 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11202 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11203 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11205 /* try SOURCEDIR after CostFinalize */
11207 lstrcpyA(path
, "kiwi");
11208 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11209 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11210 ok(!lstrcmpA(path
, "kiwi"),
11211 "Expected path to be unchanged, got \"%s\"\n", path
);
11212 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11214 /* source path does not exist, but the property exists */
11216 lstrcpyA(path
, "kiwi");
11217 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11218 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11219 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11220 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11223 lstrcpyA(path
, "kiwi");
11224 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11225 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11226 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11227 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11229 /* try SubDir after CostFinalize */
11231 lstrcpyA(path
, "kiwi");
11232 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11233 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11234 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11235 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11237 /* try SubDir2 after CostFinalize */
11239 lstrcpyA(path
, "kiwi");
11240 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11241 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11242 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
11243 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
11245 /* nonexistent directory */
11247 lstrcpyA(path
, "kiwi");
11248 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
11249 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11250 ok(!lstrcmpA(path
, "kiwi"),
11251 "Expected path to be unchanged, got \"%s\"\n", path
);
11252 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11254 /* NULL szPathBuf */
11256 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
11257 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11258 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11260 /* NULL pcchPathBuf */
11261 lstrcpyA(path
, "kiwi");
11262 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
11263 ok(r
== ERROR_INVALID_PARAMETER
,
11264 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11265 ok(!lstrcmpA(path
, "kiwi"),
11266 "Expected path to be unchanged, got \"%s\"\n", path
);
11268 /* pcchPathBuf is 0 */
11270 lstrcpyA(path
, "kiwi");
11271 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11272 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11273 ok(!lstrcmpA(path
, "kiwi"),
11274 "Expected path to be unchanged, got \"%s\"\n", path
);
11275 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11277 /* pcchPathBuf does not have room for NULL terminator */
11278 size
= lstrlenA(cwd
);
11279 lstrcpyA(path
, "kiwi");
11280 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11281 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11282 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
11283 "Expected path with no backslash, got \"%s\"\n", path
);
11284 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11286 /* pcchPathBuf has room for NULL terminator */
11287 size
= lstrlenA(cwd
) + 1;
11288 lstrcpyA(path
, "kiwi");
11289 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11290 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11291 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11292 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11294 /* remove property */
11295 r
= MsiSetProperty(hpkg
, "SourceDir", NULL
);
11296 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11298 /* try SourceDir again */
11300 lstrcpyA(path
, "kiwi");
11301 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11302 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11303 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11304 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11306 /* set property to a valid directory */
11307 r
= MsiSetProperty(hpkg
, "SOURCEDIR", cwd
);
11308 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11310 /* try SOURCEDIR again */
11312 lstrcpyA(path
, "kiwi");
11313 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11314 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11315 ok(!lstrcmpA(path
, "kiwi"),
11316 "Expected path to be unchanged, got \"%s\"\n", path
);
11317 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11319 MsiCloseHandle(hpkg
);
11321 /* compressed source */
11323 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
11324 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11326 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
11328 r
= package_from_db(hdb
, &hpkg
);
11329 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
11331 /* try TARGETDIR */
11333 lstrcpyA(path
, "kiwi");
11334 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11335 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11336 ok(!lstrcmpA(path
, "kiwi"),
11337 "Expected path to be unchanged, got \"%s\"\n", path
);
11338 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11340 /* try SourceDir */
11342 lstrcpyA(path
, "kiwi");
11343 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11344 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11345 ok(!lstrcmpA(path
, "kiwi"),
11346 "Expected path to be unchanged, got \"%s\"\n", path
);
11347 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11349 /* try SOURCEDIR */
11351 lstrcpyA(path
, "kiwi");
11352 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11353 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11354 ok(!lstrcmpA(path
, "kiwi"),
11355 "Expected path to be unchanged, got \"%s\"\n", path
);
11356 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11358 /* source path nor the property exist */
11360 lstrcpyA(path
, "kiwi");
11361 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11362 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11363 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11364 ok(size
== 0, "Expected 0, got %d\n", size
);
11367 lstrcpyA(path
, "kiwi");
11368 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11369 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11370 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
11371 ok(size
== 0, "Expected 0, got %d\n", size
);
11375 lstrcpyA(path
, "kiwi");
11376 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11377 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11378 ok(!lstrcmpA(path
, "kiwi"),
11379 "Expected path to be unchanged, got \"%s\"\n", path
);
11380 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11384 lstrcpyA(path
, "kiwi");
11385 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11386 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
11387 ok(!lstrcmpA(path
, "kiwi"),
11388 "Expected path to be unchanged, got \"%s\"\n", path
);
11389 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
11391 r
= MsiDoAction(hpkg
, "CostInitialize");
11392 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11394 /* try TARGETDIR after CostInitialize */
11396 lstrcpyA(path
, "kiwi");
11397 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11398 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11399 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11400 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11402 /* try SourceDir after CostInitialize */
11404 lstrcpyA(path
, "kiwi");
11405 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11406 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11407 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11408 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11410 /* try SOURCEDIR after CostInitialize */
11412 lstrcpyA(path
, "kiwi");
11413 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11416 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11417 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11418 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11421 /* source path does not exist, but the property exists */
11423 lstrcpyA(path
, "kiwi");
11424 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11425 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11426 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11427 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11430 lstrcpyA(path
, "kiwi");
11431 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11432 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11433 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11434 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11436 /* try SubDir after CostInitialize */
11438 lstrcpyA(path
, "kiwi");
11439 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11440 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11441 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11442 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11444 /* try SubDir2 after CostInitialize */
11446 lstrcpyA(path
, "kiwi");
11447 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11448 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11449 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11450 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11452 r
= MsiDoAction(hpkg
, "ResolveSource");
11453 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11455 /* try TARGETDIR after ResolveSource */
11457 lstrcpyA(path
, "kiwi");
11458 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11459 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11460 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11461 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11463 /* try SourceDir after ResolveSource */
11465 lstrcpyA(path
, "kiwi");
11466 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11467 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11468 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11469 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11471 /* try SOURCEDIR after ResolveSource */
11473 lstrcpyA(path
, "kiwi");
11474 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11477 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11478 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11479 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11482 /* source path and the property exist */
11484 lstrcpyA(path
, "kiwi");
11485 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11486 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11487 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11488 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11491 lstrcpyA(path
, "kiwi");
11492 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11493 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11494 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11495 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11497 /* try SubDir after ResolveSource */
11499 lstrcpyA(path
, "kiwi");
11500 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11501 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11502 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11503 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11505 /* try SubDir2 after ResolveSource */
11507 lstrcpyA(path
, "kiwi");
11508 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11509 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11510 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11511 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11513 r
= MsiDoAction(hpkg
, "FileCost");
11514 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11516 /* try TARGETDIR after CostFinalize */
11518 lstrcpyA(path
, "kiwi");
11519 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11520 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11521 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11522 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11524 /* try SourceDir after CostFinalize */
11526 lstrcpyA(path
, "kiwi");
11527 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11528 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11529 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11530 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11532 /* try SOURCEDIR after CostFinalize */
11534 lstrcpyA(path
, "kiwi");
11535 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11538 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11539 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11540 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11543 /* source path and the property exist */
11545 lstrcpyA(path
, "kiwi");
11546 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11547 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11548 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11549 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11552 lstrcpyA(path
, "kiwi");
11553 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11554 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11555 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11556 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11558 /* try SubDir after CostFinalize */
11560 lstrcpyA(path
, "kiwi");
11561 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11562 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11563 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11564 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11566 /* try SubDir2 after CostFinalize */
11568 lstrcpyA(path
, "kiwi");
11569 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11570 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11571 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11572 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11574 r
= MsiDoAction(hpkg
, "CostFinalize");
11575 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11577 /* try TARGETDIR after CostFinalize */
11579 lstrcpyA(path
, "kiwi");
11580 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
11581 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11582 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11583 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11585 /* try SourceDir after CostFinalize */
11587 lstrcpyA(path
, "kiwi");
11588 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
11589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11590 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11591 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11593 /* try SOURCEDIR after CostFinalize */
11595 lstrcpyA(path
, "kiwi");
11596 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
11599 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11600 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11601 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11604 /* source path and the property exist */
11606 lstrcpyA(path
, "kiwi");
11607 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
11608 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11609 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11610 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11613 lstrcpyA(path
, "kiwi");
11614 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
11615 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11616 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11617 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11619 /* try SubDir after CostFinalize */
11621 lstrcpyA(path
, "kiwi");
11622 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11623 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11624 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11625 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11627 /* try SubDir2 after CostFinalize */
11629 lstrcpyA(path
, "kiwi");
11630 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11631 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11632 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
11633 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
11635 MsiCloseHandle(hpkg
);
11636 DeleteFile(msifile
);
11639 static void test_shortlongsource(void)
11641 MSIHANDLE hdb
, hpkg
;
11642 CHAR path
[MAX_PATH
];
11643 CHAR cwd
[MAX_PATH
];
11644 CHAR subsrc
[MAX_PATH
];
11648 lstrcpyA(cwd
, CURR_DIR
);
11649 lstrcatA(cwd
, "\\");
11651 lstrcpyA(subsrc
, cwd
);
11652 lstrcatA(subsrc
, "long");
11653 lstrcatA(subsrc
, "\\");
11655 /* long file names */
11657 hdb
= create_package_db();
11658 ok( hdb
, "failed to create database\n");
11660 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
11662 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
11663 ok(r
== S_OK
, "failed\n");
11665 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
11666 ok(r
== S_OK
, "failed\n");
11668 /* CostInitialize:short */
11669 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
11670 ok(r
== S_OK
, "failed\n");
11672 /* CostInitialize:long */
11673 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
11674 ok(r
== S_OK
, "failed\n");
11676 /* FileCost:short */
11677 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
11678 ok(r
== S_OK
, "failed\n");
11680 /* FileCost:long */
11681 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11682 ok(r
== S_OK
, "failed\n");
11684 /* CostFinalize:short */
11685 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11686 ok(r
== S_OK
, "failed\n");
11688 /* CostFinalize:long */
11689 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11690 ok(r
== S_OK
, "failed\n");
11692 MsiDatabaseCommit(hdb
);
11694 r
= package_from_db(hdb
, &hpkg
);
11695 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
11697 skip("Not enough rights to perform tests\n");
11698 DeleteFile(msifile
);
11701 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
11703 MsiCloseHandle(hdb
);
11705 CreateDirectoryA("one", NULL
);
11706 CreateDirectoryA("four", NULL
);
11708 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
11710 r
= MsiDoAction(hpkg
, "CostInitialize");
11711 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11713 CreateDirectory("five", NULL
);
11714 CreateDirectory("eight", NULL
);
11716 r
= MsiDoAction(hpkg
, "FileCost");
11717 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11719 CreateDirectory("nine", NULL
);
11720 CreateDirectory("twelve", NULL
);
11722 r
= MsiDoAction(hpkg
, "CostFinalize");
11723 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11725 /* neither short nor long source directories exist */
11727 lstrcpyA(path
, "kiwi");
11728 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11729 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11730 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11731 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11733 CreateDirectoryA("short", NULL
);
11735 /* short source directory exists */
11737 lstrcpyA(path
, "kiwi");
11738 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11739 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11740 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11741 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11743 CreateDirectoryA("long", NULL
);
11745 /* both short and long source directories exist */
11747 lstrcpyA(path
, "kiwi");
11748 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11749 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11750 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11751 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11753 lstrcpyA(subsrc
, cwd
);
11754 lstrcatA(subsrc
, "two");
11755 lstrcatA(subsrc
, "\\");
11757 /* short dir exists before CostInitialize */
11759 lstrcpyA(path
, "kiwi");
11760 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11761 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11762 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11763 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11765 lstrcpyA(subsrc
, cwd
);
11766 lstrcatA(subsrc
, "four");
11767 lstrcatA(subsrc
, "\\");
11769 /* long dir exists before CostInitialize */
11771 lstrcpyA(path
, "kiwi");
11772 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
11773 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11774 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11775 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11777 lstrcpyA(subsrc
, cwd
);
11778 lstrcatA(subsrc
, "six");
11779 lstrcatA(subsrc
, "\\");
11781 /* short dir exists before FileCost */
11783 lstrcpyA(path
, "kiwi");
11784 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
11785 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11786 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11787 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11789 lstrcpyA(subsrc
, cwd
);
11790 lstrcatA(subsrc
, "eight");
11791 lstrcatA(subsrc
, "\\");
11793 /* long dir exists before FileCost */
11795 lstrcpyA(path
, "kiwi");
11796 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
11797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11798 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11799 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11801 lstrcpyA(subsrc
, cwd
);
11802 lstrcatA(subsrc
, "ten");
11803 lstrcatA(subsrc
, "\\");
11805 /* short dir exists before CostFinalize */
11807 lstrcpyA(path
, "kiwi");
11808 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
11809 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11810 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11811 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11813 lstrcpyA(subsrc
, cwd
);
11814 lstrcatA(subsrc
, "twelve");
11815 lstrcatA(subsrc
, "\\");
11817 /* long dir exists before CostFinalize */
11819 lstrcpyA(path
, "kiwi");
11820 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
11821 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11822 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11823 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11825 MsiCloseHandle(hpkg
);
11826 RemoveDirectoryA("short");
11827 RemoveDirectoryA("long");
11828 RemoveDirectoryA("one");
11829 RemoveDirectoryA("four");
11830 RemoveDirectoryA("five");
11831 RemoveDirectoryA("eight");
11832 RemoveDirectoryA("nine");
11833 RemoveDirectoryA("twelve");
11835 /* short file names */
11837 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
11838 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11840 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
11842 r
= package_from_db(hdb
, &hpkg
);
11843 ok(r
== ERROR_SUCCESS
, "failed to create package %u\n", r
);
11845 MsiCloseHandle(hdb
);
11847 CreateDirectoryA("one", NULL
);
11848 CreateDirectoryA("four", NULL
);
11850 r
= MsiDoAction(hpkg
, "CostInitialize");
11851 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11853 CreateDirectory("five", NULL
);
11854 CreateDirectory("eight", NULL
);
11856 r
= MsiDoAction(hpkg
, "FileCost");
11857 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11859 CreateDirectory("nine", NULL
);
11860 CreateDirectory("twelve", NULL
);
11862 r
= MsiDoAction(hpkg
, "CostFinalize");
11863 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
11865 lstrcpyA(subsrc
, cwd
);
11866 lstrcatA(subsrc
, "short");
11867 lstrcatA(subsrc
, "\\");
11869 /* neither short nor long source directories exist */
11871 lstrcpyA(path
, "kiwi");
11872 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11873 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11874 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11875 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11877 CreateDirectoryA("short", NULL
);
11879 /* short source directory exists */
11881 lstrcpyA(path
, "kiwi");
11882 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11883 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11884 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11885 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11887 CreateDirectoryA("long", NULL
);
11889 /* both short and long source directories exist */
11891 lstrcpyA(path
, "kiwi");
11892 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
11893 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11894 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11895 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11897 lstrcpyA(subsrc
, cwd
);
11898 lstrcatA(subsrc
, "one");
11899 lstrcatA(subsrc
, "\\");
11901 /* short dir exists before CostInitialize */
11903 lstrcpyA(path
, "kiwi");
11904 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
11905 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11906 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11907 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11909 lstrcpyA(subsrc
, cwd
);
11910 lstrcatA(subsrc
, "three");
11911 lstrcatA(subsrc
, "\\");
11913 /* long dir exists before CostInitialize */
11915 lstrcpyA(path
, "kiwi");
11916 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
11917 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11918 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11919 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11921 lstrcpyA(subsrc
, cwd
);
11922 lstrcatA(subsrc
, "five");
11923 lstrcatA(subsrc
, "\\");
11925 /* short dir exists before FileCost */
11927 lstrcpyA(path
, "kiwi");
11928 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
11929 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11930 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11931 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11933 lstrcpyA(subsrc
, cwd
);
11934 lstrcatA(subsrc
, "seven");
11935 lstrcatA(subsrc
, "\\");
11937 /* long dir exists before FileCost */
11939 lstrcpyA(path
, "kiwi");
11940 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
11941 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11942 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11943 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11945 lstrcpyA(subsrc
, cwd
);
11946 lstrcatA(subsrc
, "nine");
11947 lstrcatA(subsrc
, "\\");
11949 /* short dir exists before CostFinalize */
11951 lstrcpyA(path
, "kiwi");
11952 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
11953 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11954 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11955 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11957 lstrcpyA(subsrc
, cwd
);
11958 lstrcatA(subsrc
, "eleven");
11959 lstrcatA(subsrc
, "\\");
11961 /* long dir exists before CostFinalize */
11963 lstrcpyA(path
, "kiwi");
11964 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
11965 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11966 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
11967 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
11969 MsiCloseHandle(hpkg
);
11970 RemoveDirectoryA("short");
11971 RemoveDirectoryA("long");
11972 RemoveDirectoryA("one");
11973 RemoveDirectoryA("four");
11974 RemoveDirectoryA("five");
11975 RemoveDirectoryA("eight");
11976 RemoveDirectoryA("nine");
11977 RemoveDirectoryA("twelve");
11978 DeleteFileA(msifile
);
11981 static void test_sourcedir(void)
11983 MSIHANDLE hdb
, hpkg
;
11985 CHAR path
[MAX_PATH
];
11986 CHAR cwd
[MAX_PATH
];
11987 CHAR subsrc
[MAX_PATH
];
11991 lstrcpyA(cwd
, CURR_DIR
);
11992 lstrcatA(cwd
, "\\");
11994 lstrcpyA(subsrc
, cwd
);
11995 lstrcatA(subsrc
, "long");
11996 lstrcatA(subsrc
, "\\");
11998 hdb
= create_package_db();
11999 ok( hdb
, "failed to create database\n");
12001 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
12002 ok(r
== S_OK
, "failed\n");
12004 sprintf(package
, "#%u", hdb
);
12005 r
= MsiOpenPackage(package
, &hpkg
);
12006 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
12008 skip("Not enough rights to perform tests\n");
12011 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12013 /* properties only */
12015 /* SourceDir prop */
12017 lstrcpyA(path
, "kiwi");
12018 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12019 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12020 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12021 ok(size
== 0, "Expected 0, got %d\n", size
);
12023 /* SOURCEDIR prop */
12025 lstrcpyA(path
, "kiwi");
12026 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12027 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12028 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12029 ok(size
== 0, "Expected 0, got %d\n", size
);
12031 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
12033 r
= MsiDoAction(hpkg
, "CostInitialize");
12034 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12036 /* SourceDir after CostInitialize */
12038 lstrcpyA(path
, "kiwi");
12039 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12040 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12041 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12042 ok(size
== 0, "Expected 0, got %d\n", size
);
12044 /* SOURCEDIR after CostInitialize */
12046 lstrcpyA(path
, "kiwi");
12047 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12048 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12049 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12050 ok(size
== 0, "Expected 0, got %d\n", size
);
12052 r
= MsiDoAction(hpkg
, "FileCost");
12053 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12055 /* SourceDir after FileCost */
12057 lstrcpyA(path
, "kiwi");
12058 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12059 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12060 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12061 ok(size
== 0, "Expected 0, got %d\n", size
);
12063 /* SOURCEDIR after FileCost */
12065 lstrcpyA(path
, "kiwi");
12066 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12067 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12068 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12069 ok(size
== 0, "Expected 0, got %d\n", size
);
12071 r
= MsiDoAction(hpkg
, "CostFinalize");
12072 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12074 /* SourceDir after CostFinalize */
12076 lstrcpyA(path
, "kiwi");
12077 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12078 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12079 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12080 ok(size
== 0, "Expected 0, got %d\n", size
);
12082 /* SOURCEDIR after CostFinalize */
12084 lstrcpyA(path
, "kiwi");
12085 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12086 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12087 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12088 ok(size
== 0, "Expected 0, got %d\n", size
);
12091 lstrcpyA(path
, "kiwi");
12092 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12093 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12094 ok(!lstrcmpA(path
, "kiwi"), "Expected \"kiwi\", got \"%s\"\n", path
);
12095 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
12097 /* SOURCEDIR after calling MsiGetSourcePath */
12099 lstrcpyA(path
, "kiwi");
12100 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12101 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12103 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12104 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12107 r
= MsiDoAction(hpkg
, "ResolveSource");
12108 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12110 /* SourceDir after ResolveSource */
12112 lstrcpyA(path
, "kiwi");
12113 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12114 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12115 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12116 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12118 /* SOURCEDIR after ResolveSource */
12120 lstrcpyA(path
, "kiwi");
12121 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12122 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12123 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12124 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12126 /* random casing */
12128 lstrcpyA(path
, "kiwi");
12129 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
12130 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
);
12134 MsiCloseHandle(hpkg
);
12136 /* reset the package state */
12137 sprintf(package
, "#%i", hdb
);
12138 r
= MsiOpenPackage(package
, &hpkg
);
12139 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12141 /* test how MsiGetSourcePath affects the properties */
12143 /* SourceDir prop */
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
);
12155 lstrcpyA(path
, "kiwi");
12156 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
12157 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12158 ok(!lstrcmpA(path
, "kiwi"),
12159 "Expected path to be unchanged, got \"%s\"\n", path
);
12160 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12162 /* SourceDir after MsiGetSourcePath */
12164 lstrcpyA(path
, "kiwi");
12165 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12166 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12169 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12170 ok(size
== 0, "Expected 0, got %d\n", size
);
12173 /* SOURCEDIR prop */
12175 lstrcpyA(path
, "kiwi");
12176 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12177 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12180 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12181 ok(size
== 0, "Expected 0, got %d\n", size
);
12185 lstrcpyA(path
, "kiwi");
12186 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12187 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12188 ok(!lstrcmpA(path
, "kiwi"),
12189 "Expected path to be unchanged, got \"%s\"\n", path
);
12190 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12192 /* SOURCEDIR prop after MsiGetSourcePath */
12194 lstrcpyA(path
, "kiwi");
12195 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12196 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12199 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12200 ok(size
== 0, "Expected 0, got %d\n", size
);
12203 r
= MsiDoAction(hpkg
, "CostInitialize");
12204 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12206 /* SourceDir after CostInitialize */
12208 lstrcpyA(path
, "kiwi");
12209 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12210 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12213 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
12214 ok(size
== 0, "Expected 0, got %d\n", size
);
12218 lstrcpyA(path
, "kiwi");
12219 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
12220 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12221 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12222 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12224 /* SourceDir after MsiGetSourcePath */
12226 lstrcpyA(path
, "kiwi");
12227 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12228 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12229 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12230 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12232 /* SOURCEDIR after CostInitialize */
12234 lstrcpyA(path
, "kiwi");
12235 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12236 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12237 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12238 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12240 /* SOURCEDIR source path still does not exist */
12242 lstrcpyA(path
, "kiwi");
12243 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12244 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12245 ok(!lstrcmpA(path
, "kiwi"),
12246 "Expected path to be unchanged, got \"%s\"\n", path
);
12247 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12249 r
= MsiDoAction(hpkg
, "FileCost");
12250 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12252 /* SourceDir after FileCost */
12254 lstrcpyA(path
, "kiwi");
12255 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12256 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12257 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12258 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12260 /* SOURCEDIR after FileCost */
12262 lstrcpyA(path
, "kiwi");
12263 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12264 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12265 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12266 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12268 /* SOURCEDIR source path still does not exist */
12270 lstrcpyA(path
, "kiwi");
12271 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12272 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12273 ok(!lstrcmpA(path
, "kiwi"),
12274 "Expected path to be unchanged, got \"%s\"\n", path
);
12275 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12277 r
= MsiDoAction(hpkg
, "CostFinalize");
12278 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12280 /* SourceDir after CostFinalize */
12282 lstrcpyA(path
, "kiwi");
12283 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12284 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12285 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12286 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12288 /* SOURCEDIR after CostFinalize */
12290 lstrcpyA(path
, "kiwi");
12291 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12292 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12293 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12294 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12296 /* SOURCEDIR source path still does not exist */
12298 lstrcpyA(path
, "kiwi");
12299 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12300 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12301 ok(!lstrcmpA(path
, "kiwi"),
12302 "Expected path to be unchanged, got \"%s\"\n", path
);
12303 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12305 r
= MsiDoAction(hpkg
, "ResolveSource");
12306 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
12308 /* SourceDir after ResolveSource */
12310 lstrcpyA(path
, "kiwi");
12311 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
12312 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12313 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12314 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12316 /* SOURCEDIR after ResolveSource */
12318 lstrcpyA(path
, "kiwi");
12319 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
12320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12321 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
12322 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
12324 /* SOURCEDIR source path still does not exist */
12326 lstrcpyA(path
, "kiwi");
12327 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
12328 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
12329 ok(!lstrcmpA(path
, "kiwi"),
12330 "Expected path to be unchanged, got \"%s\"\n", path
);
12331 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12333 MsiCloseHandle(hpkg
);
12336 MsiCloseHandle(hdb
);
12337 DeleteFileA(msifile
);
12347 static const struct access_res create
[16] =
12349 { TRUE
, ERROR_SUCCESS
, TRUE
},
12350 { TRUE
, ERROR_SUCCESS
, TRUE
},
12351 { TRUE
, ERROR_SUCCESS
, FALSE
},
12352 { TRUE
, ERROR_SUCCESS
, FALSE
},
12353 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12354 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12355 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12356 { TRUE
, ERROR_SUCCESS
, FALSE
},
12357 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12358 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12359 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12360 { TRUE
, ERROR_SUCCESS
, TRUE
},
12361 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12362 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12363 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12364 { TRUE
, ERROR_SUCCESS
, TRUE
}
12367 static const struct access_res create_commit
[16] =
12369 { TRUE
, ERROR_SUCCESS
, TRUE
},
12370 { TRUE
, ERROR_SUCCESS
, TRUE
},
12371 { TRUE
, ERROR_SUCCESS
, FALSE
},
12372 { TRUE
, ERROR_SUCCESS
, FALSE
},
12373 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12374 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12375 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12376 { TRUE
, ERROR_SUCCESS
, FALSE
},
12377 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12378 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12379 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12380 { TRUE
, ERROR_SUCCESS
, TRUE
},
12381 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12382 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12383 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
12384 { TRUE
, ERROR_SUCCESS
, TRUE
}
12387 static const struct access_res create_close
[16] =
12389 { TRUE
, ERROR_SUCCESS
, FALSE
},
12390 { TRUE
, ERROR_SUCCESS
, FALSE
},
12391 { TRUE
, ERROR_SUCCESS
, FALSE
},
12392 { TRUE
, ERROR_SUCCESS
, FALSE
},
12393 { TRUE
, ERROR_SUCCESS
, FALSE
},
12394 { TRUE
, ERROR_SUCCESS
, FALSE
},
12395 { TRUE
, ERROR_SUCCESS
, FALSE
},
12396 { TRUE
, ERROR_SUCCESS
, FALSE
},
12397 { TRUE
, ERROR_SUCCESS
, FALSE
},
12398 { TRUE
, ERROR_SUCCESS
, FALSE
},
12399 { TRUE
, ERROR_SUCCESS
, FALSE
},
12400 { TRUE
, ERROR_SUCCESS
, FALSE
},
12401 { TRUE
, ERROR_SUCCESS
, FALSE
},
12402 { TRUE
, ERROR_SUCCESS
, FALSE
},
12403 { TRUE
, ERROR_SUCCESS
, FALSE
},
12404 { TRUE
, ERROR_SUCCESS
}
12407 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
12409 DWORD access
= 0, share
= 0;
12414 for (i
= 0; i
< 4; i
++)
12416 if (i
== 0) access
= 0;
12417 if (i
== 1) access
= GENERIC_READ
;
12418 if (i
== 2) access
= GENERIC_WRITE
;
12419 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
12421 for (j
= 0; j
< 4; j
++)
12423 if (ares
[idx
].ignore
)
12426 if (j
== 0) share
= 0;
12427 if (j
== 1) share
= FILE_SHARE_READ
;
12428 if (j
== 2) share
= FILE_SHARE_WRITE
;
12429 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
12431 SetLastError(0xdeadbeef);
12432 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
12433 FILE_ATTRIBUTE_NORMAL
, 0);
12434 lasterr
= GetLastError();
12436 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
12437 "(%d, handle, %d): Expected %d, got %d\n",
12438 line
, idx
, ares
[idx
].gothandle
,
12439 (hfile
!= INVALID_HANDLE_VALUE
));
12441 ok(lasterr
== ares
[idx
].lasterr
, "(%d, lasterr, %d): Expected %d, got %d\n",
12442 line
, idx
, ares
[idx
].lasterr
, lasterr
);
12444 CloseHandle(hfile
);
12450 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12452 static void test_access(void)
12457 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
12458 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12460 test_file_access(msifile
, create
);
12462 r
= MsiDatabaseCommit(hdb
);
12463 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12465 test_file_access(msifile
, create_commit
);
12466 MsiCloseHandle(hdb
);
12468 test_file_access(msifile
, create_close
);
12469 DeleteFileA(msifile
);
12471 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
12472 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12474 test_file_access(msifile
, create
);
12476 r
= MsiDatabaseCommit(hdb
);
12477 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12479 test_file_access(msifile
, create_commit
);
12480 MsiCloseHandle(hdb
);
12482 test_file_access(msifile
, create_close
);
12483 DeleteFileA(msifile
);
12486 static void test_emptypackage(void)
12488 MSIHANDLE hpkg
= 0, hdb
= 0, hsuminfo
= 0;
12489 MSIHANDLE hview
= 0, hrec
= 0;
12490 MSICONDITION condition
;
12491 CHAR buffer
[MAX_PATH
];
12495 r
= MsiOpenPackageA("", &hpkg
);
12496 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
12498 skip("Not enough rights to perform tests\n");
12503 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12506 hdb
= MsiGetActiveDatabase(hpkg
);
12509 ok(hdb
!= 0, "Expected a valid database handle\n");
12512 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Tables`", &hview
);
12515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12517 r
= MsiViewExecute(hview
, 0);
12520 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12523 r
= MsiViewFetch(hview
, &hrec
);
12526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12531 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
12534 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12535 ok(!lstrcmpA(buffer
, "_Property"),
12536 "Expected \"_Property\", got \"%s\"\n", buffer
);
12539 MsiCloseHandle(hrec
);
12541 r
= MsiViewFetch(hview
, &hrec
);
12544 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12548 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
12551 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12552 ok(!lstrcmpA(buffer
, "#_FolderCache"),
12553 "Expected \"_Property\", got \"%s\"\n", buffer
);
12556 MsiCloseHandle(hrec
);
12557 MsiViewClose(hview
);
12558 MsiCloseHandle(hview
);
12560 condition
= MsiDatabaseIsTablePersistentA(hdb
, "_Property");
12563 ok(condition
== MSICONDITION_FALSE
,
12564 "Expected MSICONDITION_FALSE, got %d\n", condition
);
12567 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
12570 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12572 r
= MsiViewExecute(hview
, 0);
12575 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12578 /* _Property table is not empty */
12579 r
= MsiViewFetch(hview
, &hrec
);
12582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12585 MsiCloseHandle(hrec
);
12586 MsiViewClose(hview
);
12587 MsiCloseHandle(hview
);
12589 condition
= MsiDatabaseIsTablePersistentA(hdb
, "#_FolderCache");
12592 ok(condition
== MSICONDITION_FALSE
,
12593 "Expected MSICONDITION_FALSE, got %d\n", condition
);
12596 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `#_FolderCache`", &hview
);
12599 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12601 r
= MsiViewExecute(hview
, 0);
12604 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12607 /* #_FolderCache is not empty */
12608 r
= MsiViewFetch(hview
, &hrec
);
12611 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12614 MsiCloseHandle(hrec
);
12615 MsiViewClose(hview
);
12616 MsiCloseHandle(hview
);
12618 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Streams`", &hview
);
12621 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12622 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12625 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Storages`", &hview
);
12628 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12629 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12632 r
= MsiGetSummaryInformationA(hdb
, NULL
, 0, &hsuminfo
);
12635 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
12636 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
12639 MsiCloseHandle(hsuminfo
);
12641 r
= MsiDatabaseCommit(hdb
);
12644 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12647 MsiCloseHandle(hdb
);
12648 MsiCloseHandle(hpkg
);
12651 static void test_MsiGetProductProperty(void)
12653 MSIHANDLE hprod
, hdb
;
12654 CHAR val
[MAX_PATH
];
12655 CHAR path
[MAX_PATH
];
12656 CHAR query
[MAX_PATH
];
12657 CHAR keypath
[MAX_PATH
*2];
12658 CHAR prodcode
[MAX_PATH
];
12659 CHAR prod_squashed
[MAX_PATH
];
12660 HKEY prodkey
, userkey
, props
;
12664 REGSAM access
= KEY_ALL_ACCESS
;
12666 GetCurrentDirectoryA(MAX_PATH
, path
);
12667 lstrcatA(path
, "\\");
12669 create_test_guid(prodcode
, prod_squashed
);
12672 access
|= KEY_WOW64_64KEY
;
12674 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
12675 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12677 r
= MsiDatabaseCommit(hdb
);
12678 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12680 r
= set_summary_info(hdb
);
12681 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12684 "CREATE TABLE `Directory` ( "
12685 "`Directory` CHAR(255) NOT NULL, "
12686 "`Directory_Parent` CHAR(255), "
12687 "`DefaultDir` CHAR(255) NOT NULL "
12688 "PRIMARY KEY `Directory`)");
12689 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12692 "CREATE TABLE `Property` ( "
12693 "`Property` CHAR(72) NOT NULL, "
12694 "`Value` CHAR(255) "
12695 "PRIMARY KEY `Property`)");
12696 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12698 sprintf(query
, "INSERT INTO `Property` "
12699 "(`Property`, `Value`) "
12700 "VALUES( 'ProductCode', '%s' )", prodcode
);
12701 r
= run_query(hdb
, query
);
12702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12704 r
= MsiDatabaseCommit(hdb
);
12705 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12707 MsiCloseHandle(hdb
);
12709 lstrcpyA(keypath
, "Software\\Classes\\Installer\\Products\\");
12710 lstrcatA(keypath
, prod_squashed
);
12712 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, NULL
, 0, access
, NULL
, &prodkey
, NULL
);
12713 if (res
== ERROR_ACCESS_DENIED
)
12715 skip("Not enough rights to perform tests\n");
12716 DeleteFile(msifile
);
12719 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12721 lstrcpyA(keypath
, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12722 lstrcatA(keypath
, "Installer\\UserData\\S-1-5-18\\Products\\");
12723 lstrcatA(keypath
, prod_squashed
);
12725 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, NULL
, 0, access
, NULL
, &userkey
, NULL
);
12726 if (res
== ERROR_ACCESS_DENIED
)
12728 skip("Not enough rights to perform tests\n");
12729 RegDeleteKeyA(prodkey
, "");
12730 RegCloseKey(prodkey
);
12733 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12735 res
= RegCreateKeyExA(userkey
, "InstallProperties", 0, NULL
, 0, access
, NULL
, &props
, NULL
);
12736 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12738 lstrcpyA(val
, path
);
12739 lstrcatA(val
, "\\");
12740 lstrcatA(val
, msifile
);
12741 res
= RegSetValueExA(props
, "LocalPackage", 0, REG_SZ
,
12742 (const BYTE
*)val
, lstrlenA(val
) + 1);
12743 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
12745 hprod
= 0xdeadbeef;
12746 r
= MsiOpenProductA(prodcode
, &hprod
);
12747 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12748 ok(hprod
!= 0 && hprod
!= 0xdeadbeef, "Expected a valid product handle\n");
12750 /* hProduct is invalid */
12752 lstrcpyA(val
, "apple");
12753 r
= MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val
, &size
);
12754 ok(r
== ERROR_INVALID_HANDLE
,
12755 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12756 ok(!lstrcmpA(val
, "apple"),
12757 "Expected val to be unchanged, got \"%s\"\n", val
);
12758 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12760 /* szProperty is NULL */
12762 lstrcpyA(val
, "apple");
12763 r
= MsiGetProductPropertyA(hprod
, NULL
, val
, &size
);
12764 ok(r
== ERROR_INVALID_PARAMETER
,
12765 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12766 ok(!lstrcmpA(val
, "apple"),
12767 "Expected val to be unchanged, got \"%s\"\n", val
);
12768 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
12770 /* szProperty is empty */
12772 lstrcpyA(val
, "apple");
12773 r
= MsiGetProductPropertyA(hprod
, "", val
, &size
);
12774 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12775 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12776 ok(size
== 0, "Expected 0, got %d\n", size
);
12778 /* get the property */
12780 lstrcpyA(val
, "apple");
12781 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12782 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12783 ok(!lstrcmpA(val
, prodcode
),
12784 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12785 ok(size
== lstrlenA(prodcode
),
12786 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12788 /* lpValueBuf is NULL */
12790 r
= MsiGetProductPropertyA(hprod
, "ProductCode", NULL
, &size
);
12791 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12792 ok(size
== lstrlenA(prodcode
),
12793 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12795 /* pcchValueBuf is NULL */
12796 lstrcpyA(val
, "apple");
12797 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, NULL
);
12798 ok(r
== ERROR_INVALID_PARAMETER
,
12799 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12800 ok(!lstrcmpA(val
, "apple"),
12801 "Expected val to be unchanged, got \"%s\"\n", val
);
12802 ok(size
== lstrlenA(prodcode
),
12803 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12805 /* pcchValueBuf is too small */
12807 lstrcpyA(val
, "apple");
12808 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12809 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
12810 ok(!strncmp(val
, prodcode
, 3),
12811 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
12812 ok(size
== lstrlenA(prodcode
),
12813 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12815 /* pcchValueBuf does not leave room for NULL terminator */
12816 size
= lstrlenA(prodcode
);
12817 lstrcpyA(val
, "apple");
12818 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12819 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
12820 ok(!strncmp(val
, prodcode
, lstrlenA(prodcode
) - 1),
12821 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
12822 ok(size
== lstrlenA(prodcode
),
12823 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12825 /* pcchValueBuf has enough room for NULL terminator */
12826 size
= lstrlenA(prodcode
) + 1;
12827 lstrcpyA(val
, "apple");
12828 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12829 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12830 ok(!lstrcmpA(val
, prodcode
),
12831 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12832 ok(size
== lstrlenA(prodcode
),
12833 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12835 /* nonexistent property */
12837 lstrcpyA(val
, "apple");
12838 r
= MsiGetProductPropertyA(hprod
, "IDontExist", val
, &size
);
12839 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12840 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12841 ok(size
== 0, "Expected 0, got %d\n", size
);
12843 r
= MsiSetPropertyA(hprod
, "NewProperty", "value");
12844 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12846 /* non-product property set */
12848 lstrcpyA(val
, "apple");
12849 r
= MsiGetProductPropertyA(hprod
, "NewProperty", val
, &size
);
12850 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12851 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
12852 ok(size
== 0, "Expected 0, got %d\n", size
);
12854 r
= MsiSetPropertyA(hprod
, "ProductCode", "value");
12855 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12857 /* non-product property that is also a product property set */
12859 lstrcpyA(val
, "apple");
12860 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
12861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12862 ok(!lstrcmpA(val
, prodcode
),
12863 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
12864 ok(size
== lstrlenA(prodcode
),
12865 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
12867 MsiCloseHandle(hprod
);
12869 RegDeleteValueA(props
, "LocalPackage");
12870 delete_key(props
, "", access
);
12871 RegCloseKey(props
);
12872 delete_key(userkey
, "", access
);
12873 RegCloseKey(userkey
);
12874 delete_key(prodkey
, "", access
);
12875 RegCloseKey(prodkey
);
12876 DeleteFileA(msifile
);
12879 static void test_MsiSetProperty(void)
12881 MSIHANDLE hpkg
, hdb
, hrec
;
12882 CHAR buf
[MAX_PATH
];
12887 r
= package_from_db(create_package_db(), &hpkg
);
12888 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
12890 skip("Not enough rights to perform tests\n");
12891 DeleteFile(msifile
);
12894 ok(r
== ERROR_SUCCESS
, "Expected a valid package %u\n", r
);
12896 /* invalid hInstall */
12897 r
= MsiSetPropertyA(0, "Prop", "Val");
12898 ok(r
== ERROR_INVALID_HANDLE
,
12899 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12901 /* invalid hInstall */
12902 r
= MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12903 ok(r
== ERROR_INVALID_HANDLE
,
12904 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
12906 /* szName is NULL */
12907 r
= MsiSetPropertyA(hpkg
, NULL
, "Val");
12908 ok(r
== ERROR_INVALID_PARAMETER
,
12909 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12911 /* both szName and szValue are NULL */
12912 r
= MsiSetPropertyA(hpkg
, NULL
, NULL
);
12913 ok(r
== ERROR_INVALID_PARAMETER
,
12914 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
12916 /* szName is empty */
12917 r
= MsiSetPropertyA(hpkg
, "", "Val");
12918 ok(r
== ERROR_FUNCTION_FAILED
,
12919 "Expected ERROR_FUNCTION_FAILED, got %d\n", r
);
12921 /* szName is empty and szValue is NULL */
12922 r
= MsiSetPropertyA(hpkg
, "", NULL
);
12923 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12925 /* set a property */
12926 r
= MsiSetPropertyA(hpkg
, "Prop", "Val");
12927 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12929 /* get the property */
12931 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12932 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12933 ok(!lstrcmpA(buf
, "Val"), "Expected \"Val\", got \"%s\"\n", buf
);
12934 ok(size
== 3, "Expected 3, got %d\n", size
);
12936 /* update the property */
12937 r
= MsiSetPropertyA(hpkg
, "Prop", "Nuvo");
12938 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12940 /* get the property */
12942 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12943 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12944 ok(!lstrcmpA(buf
, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf
);
12945 ok(size
== 4, "Expected 4, got %d\n", size
);
12947 hdb
= MsiGetActiveDatabase(hpkg
);
12948 ok(hdb
!= 0, "Expected a valid database handle\n");
12950 /* set prop is not in the _Property table */
12951 query
= "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12952 r
= do_query(hdb
, query
, &hrec
);
12953 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12954 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12956 /* set prop is not in the Property table */
12957 query
= "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12958 r
= do_query(hdb
, query
, &hrec
);
12959 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
12960 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
12962 MsiCloseHandle(hdb
);
12964 /* szValue is an empty string */
12965 r
= MsiSetPropertyA(hpkg
, "Prop", "");
12966 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12968 /* try to get the property */
12970 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12971 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12972 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
12973 ok(size
== 0, "Expected 0, got %d\n", size
);
12975 /* reset the property */
12976 r
= MsiSetPropertyA(hpkg
, "Prop", "BlueTap");
12977 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12979 /* delete the property */
12980 r
= MsiSetPropertyA(hpkg
, "Prop", NULL
);
12981 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12983 /* try to get the property */
12985 r
= MsiGetPropertyA(hpkg
, "Prop", buf
, &size
);
12986 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
12987 ok(!lstrcmpA(buf
, ""), "Expected \"\", got \"%s\"\n", buf
);
12988 ok(size
== 0, "Expected 0, got %d\n", size
);
12990 MsiCloseHandle(hpkg
);
12991 DeleteFileA(msifile
);
12994 static void test_MsiApplyMultiplePatches(void)
12996 UINT r
, type
= GetDriveType(NULL
);
12998 if (!pMsiApplyMultiplePatchesA
) {
12999 win_skip("MsiApplyMultiplePatchesA not found\n");
13003 r
= pMsiApplyMultiplePatchesA(NULL
, NULL
, NULL
);
13004 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13006 r
= pMsiApplyMultiplePatchesA("", NULL
, NULL
);
13007 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13009 r
= pMsiApplyMultiplePatchesA(";", NULL
, NULL
);
13010 if (type
== DRIVE_FIXED
)
13011 todo_wine
ok(r
== ERROR_PATH_NOT_FOUND
, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
13013 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
13015 r
= pMsiApplyMultiplePatchesA(" ;", NULL
, NULL
);
13016 if (type
== DRIVE_FIXED
)
13017 todo_wine
ok(r
== ERROR_PATCH_PACKAGE_OPEN_FAILED
, "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r
);
13019 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
13021 r
= pMsiApplyMultiplePatchesA(";;", NULL
, NULL
);
13022 if (type
== DRIVE_FIXED
)
13023 todo_wine
ok(r
== ERROR_PATH_NOT_FOUND
, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
13025 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
13027 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL
, NULL
);
13028 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
13030 r
= pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL
, NULL
);
13031 if (type
== DRIVE_FIXED
)
13032 todo_wine
ok(r
== ERROR_PATH_NOT_FOUND
, "Expected ERROR_PATH_NOT_FOUND, got %u\n", r
);
13034 ok(r
== ERROR_INVALID_NAME
, "Expected ERROR_INVALID_NAME, got %u\n", r
);
13036 r
= pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL
, NULL
);
13037 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
13039 r
= pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL
, NULL
);
13040 todo_wine
ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
13043 static void test_MsiApplyPatch(void)
13047 r
= MsiApplyPatch(NULL
, NULL
, INSTALLTYPE_DEFAULT
, NULL
);
13048 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13050 r
= MsiApplyPatch("", NULL
, INSTALLTYPE_DEFAULT
, NULL
);
13051 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13054 static void test_MsiEnumComponentCosts(void)
13056 MSIHANDLE hdb
, hpkg
;
13057 char package
[12], drive
[3];
13062 hdb
= create_package_db();
13063 ok( hdb
, "failed to create database\n" );
13065 r
= create_property_table( hdb
);
13066 ok( r
== ERROR_SUCCESS
, "cannot create Property table %u\n", r
);
13068 r
= add_property_entry( hdb
, "'ProductCode', '{379B1C47-40C1-42FA-A9BB-BEBB6F1B0172}'" );
13069 ok( r
== ERROR_SUCCESS
, "cannot add property entry %u\n", r
);
13071 r
= add_property_entry( hdb
, "'MSIFASTINSTALL', '1'" );
13072 ok( r
== ERROR_SUCCESS
, "cannot add property entry %u\n", r
);
13074 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
13075 ok( r
== ERROR_SUCCESS
, "failed to add directory entry %u\n" , r
);
13077 r
= create_media_table( hdb
);
13078 ok( r
== ERROR_SUCCESS
, "cannot create Media table %u\n", r
);
13080 r
= add_media_entry( hdb
, "'1', '2', 'cabinet', '', '', ''");
13081 ok( r
== ERROR_SUCCESS
, "cannot add media entry %u\n", r
);
13083 r
= create_file_table( hdb
);
13084 ok( r
== ERROR_SUCCESS
, "cannot create File table %u\n", r
);
13086 r
= add_file_entry( hdb
, "'one.txt', 'one', 'one.txt', 4096, '', '', 8192, 1" );
13087 ok( r
== ERROR_SUCCESS
, "cannot add file %u\n", r
);
13089 r
= create_component_table( hdb
);
13090 ok( r
== ERROR_SUCCESS
, "cannot create Component table %u\n", r
);
13092 r
= add_component_entry( hdb
, "'one', '{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '', 'one.txt'" );
13093 ok( r
== ERROR_SUCCESS
, "cannot add component %u\n", r
);
13095 r
= add_component_entry( hdb
, "'two', '{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '', ''" );
13096 ok( r
== ERROR_SUCCESS
, "cannot add component %u\n", r
);
13098 r
= create_feature_table( hdb
);
13099 ok( r
== ERROR_SUCCESS
, "cannot create Feature table %u\n", r
);
13101 r
= add_feature_entry( hdb
, "'one', '', '', '', 0, 1, '', 0" );
13102 ok( r
== ERROR_SUCCESS
, "cannot add feature %u\n", r
);
13104 r
= add_feature_entry( hdb
, "'two', '', '', '', 0, 1, '', 0" );
13105 ok( r
== ERROR_SUCCESS
, "cannot add feature %u\n", r
);
13107 r
= create_feature_components_table( hdb
);
13108 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table %u\n", r
);
13110 r
= add_feature_components_entry( hdb
, "'one', 'one'" );
13111 ok( r
== ERROR_SUCCESS
, "cannot add feature/component pair %u\n", r
);
13113 r
= add_feature_components_entry( hdb
, "'two', 'two'" );
13114 ok( r
== ERROR_SUCCESS
, "cannot add feature/component pair %u\n", r
);
13116 r
= create_install_execute_sequence_table( hdb
);
13117 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table %u\n", r
);
13119 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
13120 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13122 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
13123 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13125 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
13126 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13128 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1100'" );
13129 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry %u\n", r
);
13131 MsiDatabaseCommit( hdb
);
13133 sprintf( package
, "#%u", hdb
);
13134 r
= MsiOpenPackageA( package
, &hpkg
);
13135 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
13137 skip("Not enough rights to perform tests\n");
13140 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13142 r
= MsiEnumComponentCostsA( 0, NULL
, 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13143 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13145 r
= MsiEnumComponentCostsA( hpkg
, NULL
, 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13146 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13148 r
= MsiEnumComponentCostsA( hpkg
, NULL
, 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13149 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13151 r
= MsiEnumComponentCostsA( hpkg
, "", 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13152 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13154 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_UNKNOWN
, NULL
, NULL
, NULL
, NULL
);
13155 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13157 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, NULL
, NULL
, NULL
, NULL
);
13158 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13160 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, NULL
, NULL
, NULL
);
13161 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13163 len
= sizeof(drive
);
13164 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, NULL
, NULL
);
13165 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13167 len
= sizeof(drive
);
13168 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, NULL
);
13169 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13171 len
= sizeof(drive
);
13172 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13173 todo_wine
ok( r
== ERROR_INVALID_HANDLE_STATE
, "Expected ERROR_INVALID_HANDLE_STATE, got %u\n", r
);
13175 len
= sizeof(drive
);
13176 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, NULL
, &len
, &cost
, &temp
);
13177 ok( r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %u\n", r
);
13179 MsiSetInternalUI( INSTALLUILEVEL_NONE
, NULL
);
13181 r
= MsiDoAction( hpkg
, "CostInitialize" );
13182 ok( r
== ERROR_SUCCESS
, "CostInitialize failed %u\n", r
);
13184 r
= MsiDoAction( hpkg
, "FileCost" );
13185 ok( r
== ERROR_SUCCESS
, "FileCost failed %u\n", r
);
13187 len
= sizeof(drive
);
13188 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13189 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r
);
13191 r
= MsiDoAction( hpkg
, "CostFinalize" );
13192 ok( r
== ERROR_SUCCESS
, "CostFinalize failed %u\n", r
);
13194 /* contrary to what msdn says InstallValidate must be called too */
13195 len
= sizeof(drive
);
13196 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13197 todo_wine
ok( r
== ERROR_FUNCTION_NOT_CALLED
, "Expected ERROR_FUNCTION_NOT_CALLED, got %u\n", r
);
13199 r
= MsiDoAction( hpkg
, "InstallValidate" );
13200 ok( r
== ERROR_SUCCESS
, "InstallValidate failed %u\n", r
);
13203 r
= MsiEnumComponentCostsA( hpkg
, "three", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13204 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %u\n", r
);
13207 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13208 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %u\n", r
);
13209 ok( len
== 2, "expected len == 2, got %u\n", len
);
13212 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13213 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %u\n", r
);
13214 ok( len
== 2, "expected len == 2, got %u\n", len
);
13217 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13218 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %u\n", r
);
13219 ok( len
== 2, "expected len == 2, got %u\n", len
);
13221 /* install state doesn't seem to matter */
13222 len
= sizeof(drive
);
13223 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13224 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13226 len
= sizeof(drive
);
13227 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_ABSENT
, drive
, &len
, &cost
, &temp
);
13228 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13230 len
= sizeof(drive
);
13231 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_SOURCE
, drive
, &len
, &cost
, &temp
);
13232 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13234 len
= sizeof(drive
);
13236 cost
= temp
= 0xdead;
13237 r
= MsiEnumComponentCostsA( hpkg
, "one", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13238 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13239 ok( len
== 2, "expected len == 2, got %u\n", len
);
13240 ok( drive
[0], "expected a drive\n" );
13241 ok( cost
&& cost
!= 0xdead, "expected cost > 0, got %d\n", cost
);
13242 ok( !temp
, "expected temp == 0, got %d\n", temp
);
13244 len
= sizeof(drive
);
13246 cost
= temp
= 0xdead;
13247 r
= MsiEnumComponentCostsA( hpkg
, "two", 0, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13248 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13249 ok( len
== 2, "expected len == 2, got %u\n", len
);
13250 ok( drive
[0], "expected a drive\n" );
13251 ok( !cost
, "expected cost == 0, got %d\n", cost
);
13252 ok( !temp
, "expected temp == 0, got %d\n", temp
);
13254 len
= sizeof(drive
);
13256 cost
= temp
= 0xdead;
13257 r
= MsiEnumComponentCostsA( hpkg
, "", 0, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13258 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
13259 ok( len
== 2, "expected len == 2, got %u\n", len
);
13260 ok( drive
[0], "expected a drive\n" );
13261 ok( !cost
, "expected cost == 0, got %d\n", cost
);
13262 ok( temp
&& temp
!= 0xdead, "expected temp > 0, got %d\n", temp
);
13264 /* increased index */
13265 len
= sizeof(drive
);
13266 r
= MsiEnumComponentCostsA( hpkg
, "one", 1, INSTALLSTATE_LOCAL
, drive
, &len
, &cost
, &temp
);
13267 ok( r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r
);
13269 len
= sizeof(drive
);
13270 r
= MsiEnumComponentCostsA( hpkg
, "", 1, INSTALLSTATE_UNKNOWN
, drive
, &len
, &cost
, &temp
);
13271 ok( r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r
);
13273 MsiCloseHandle( hpkg
);
13275 MsiCloseHandle( hdb
);
13276 DeleteFileA( msifile
);
13279 START_TEST(package
)
13281 STATEMGRSTATUS status
;
13284 init_functionpointers();
13286 if (pIsWow64Process
)
13287 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
13289 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
13291 /* Create a restore point ourselves so we circumvent the multitude of restore points
13292 * that would have been created by all the installation and removal tests.
13294 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
13295 * creation of restore points.
13297 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
13299 memset(&status
, 0, sizeof(status
));
13300 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
13303 test_createpackage();
13305 test_gettargetpath_bad();
13306 test_settargetpath();
13308 test_property_table();
13311 test_formatrecord2();
13313 test_getproperty();
13314 test_removefiles();
13316 test_appsearch_complocator();
13317 test_appsearch_reglocator();
13318 test_appsearch_inilocator();
13319 test_appsearch_drlocator();
13320 test_featureparents();
13321 test_installprops();
13322 test_launchconditions();
13324 test_complocator();
13325 test_MsiGetSourcePath();
13326 test_shortlongsource();
13329 test_emptypackage();
13330 test_MsiGetProductProperty();
13331 test_MsiSetProperty();
13332 test_MsiApplyMultiplePatches();
13333 test_MsiApplyPatch();
13334 test_MsiEnumComponentCosts();
13336 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
13338 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
13340 remove_restore_point(status
.llSequenceNumber
);