2 * tests for Microsoft Installer functionality
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/test.h"
32 static const char msifile
[] = "winetest.msi";
33 char CURR_DIR
[MAX_PATH
];
35 static void get_user_sid(LPSTR
*usersid
)
41 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
42 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
45 pConvertSidToStringSidA
= (void *)GetProcAddress(hadvapi32
, "ConvertSidToStringSidA");
46 if (!pConvertSidToStringSidA
)
49 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
51 GetTokenInformation(token
, TokenUser
, buf
, size
, &size
);
52 user
= (PTOKEN_USER
)buf
;
53 pConvertSidToStringSidA(user
->User
.Sid
, usersid
);
57 /* RegDeleteTreeW from dlls/advapi32/registry.c */
58 static LSTATUS
package_RegDeleteTreeW(HKEY hKey
, LPCWSTR lpszSubKey
)
61 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
62 DWORD dwMaxLen
, dwSize
;
63 WCHAR szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
68 ret
= RegOpenKeyExW(hKey
, lpszSubKey
, 0, KEY_READ
, &hSubKey
);
72 ret
= RegQueryInfoKeyW(hSubKey
, NULL
, NULL
, NULL
, NULL
,
73 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
74 if (ret
) goto cleanup
;
78 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
79 if (dwMaxLen
> sizeof(szNameBuf
)/sizeof(WCHAR
))
81 /* Name too big: alloc a buffer for it */
82 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
*sizeof(WCHAR
))))
84 ret
= ERROR_NOT_ENOUGH_MEMORY
;
89 /* Recursively delete all the subkeys */
93 if (RegEnumKeyExW(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
94 NULL
, NULL
, NULL
)) break;
96 ret
= package_RegDeleteTreeW(hSubKey
, lpszName
);
97 if (ret
) goto cleanup
;
101 ret
= RegDeleteKeyW(hKey
, lpszSubKey
);
106 if (RegEnumValueW(hKey
, 0, lpszName
, &dwSize
,
107 NULL
, NULL
, NULL
, NULL
)) break;
109 ret
= RegDeleteValueW(hKey
, lpszName
);
110 if (ret
) goto cleanup
;
114 if (lpszName
!= szNameBuf
)
115 HeapFree(GetProcessHeap(), 0, lpszName
);
117 RegCloseKey(hSubKey
);
121 static BOOL
squash_guid(LPCWSTR in
, LPWSTR out
)
126 if (FAILED(CLSIDFromString((LPOLESTR
)in
, &guid
)))
140 out
[17+i
*2] = in
[n
++];
141 out
[16+i
*2] = in
[n
++];
146 out
[17+i
*2] = in
[n
++];
147 out
[16+i
*2] = in
[n
++];
153 static void create_test_guid(LPSTR prodcode
, LPSTR squashed
)
155 WCHAR guidW
[MAX_PATH
];
156 WCHAR squashedW
[MAX_PATH
];
161 hr
= CoCreateGuid(&guid
);
162 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
164 size
= StringFromGUID2(&guid
, guidW
, MAX_PATH
);
165 ok(size
== 39, "Expected 39, got %d\n", hr
);
167 WideCharToMultiByte(CP_ACP
, 0, guidW
, size
, prodcode
, MAX_PATH
, NULL
, NULL
);
168 squash_guid(guidW
, squashedW
);
169 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
172 static void set_component_path(LPCSTR filename
, MSIINSTALLCONTEXT context
,
173 LPCSTR guid
, LPSTR usersid
, BOOL dir
)
175 WCHAR guidW
[MAX_PATH
];
176 WCHAR squashedW
[MAX_PATH
];
177 CHAR squashed
[MAX_PATH
];
178 CHAR comppath
[MAX_PATH
];
179 CHAR prodpath
[MAX_PATH
];
184 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
185 squash_guid(guidW
, squashedW
);
186 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
188 if (context
== MSIINSTALLCONTEXT_MACHINE
)
190 prod
= "3D0DAE300FACA1300AD792060BCDAA92";
192 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
193 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
195 "SOFTWARE\\Classes\\Installer\\"
196 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
198 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
200 prod
= "7D2F387510109040002000060BECB6AB";
202 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
203 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
205 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
206 "Installer\\%s\\Installer\\Products\\"
207 "7D2F387510109040002000060BECB6AB", usersid
);
209 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
211 prod
= "7D2F387510109040002000060BECB6AB";
213 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
214 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
216 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
217 "Installer\\Managed\\%s\\Installer\\Products\\"
218 "7D2F387510109040002000060BECB6AB", usersid
);
221 RegCreateKeyA(HKEY_LOCAL_MACHINE
, comppath
, &hkey
);
223 lstrcpyA(path
, CURR_DIR
);
224 lstrcatA(path
, "\\");
225 if (!dir
) lstrcatA(path
, filename
);
227 RegSetValueExA(hkey
, prod
, 0, REG_SZ
, (LPBYTE
)path
, lstrlenA(path
));
230 RegCreateKeyA(HKEY_LOCAL_MACHINE
, prodpath
, &hkey
);
234 static void delete_component_path(LPCSTR guid
, MSIINSTALLCONTEXT context
, LPSTR usersid
)
236 WCHAR guidW
[MAX_PATH
];
237 WCHAR squashedW
[MAX_PATH
];
238 WCHAR substrW
[MAX_PATH
];
239 CHAR squashed
[MAX_PATH
];
240 CHAR comppath
[MAX_PATH
];
241 CHAR prodpath
[MAX_PATH
];
243 MultiByteToWideChar(CP_ACP
, 0, guid
, -1, guidW
, MAX_PATH
);
244 squash_guid(guidW
, squashedW
);
245 WideCharToMultiByte(CP_ACP
, 0, squashedW
, -1, squashed
, MAX_PATH
, NULL
, NULL
);
247 if (context
== MSIINSTALLCONTEXT_MACHINE
)
250 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
251 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed
);
253 "SOFTWARE\\Classes\\Installer\\"
254 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
256 else if (context
== MSIINSTALLCONTEXT_USERUNMANAGED
)
259 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
260 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
262 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
263 "Installer\\%s\\Installer\\Products\\"
264 "7D2F387510109040002000060BECB6AB", usersid
);
266 else if (context
== MSIINSTALLCONTEXT_USERMANAGED
)
269 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
270 "Installer\\UserData\\%s\\Components\\%s", usersid
, squashed
);
272 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
273 "Installer\\Managed\\%s\\Installer\\Products\\"
274 "7D2F387510109040002000060BECB6AB", usersid
);
277 MultiByteToWideChar(CP_ACP
, 0, comppath
, -1, substrW
, MAX_PATH
);
278 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
280 MultiByteToWideChar(CP_ACP
, 0, prodpath
, -1, substrW
, MAX_PATH
);
281 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE
, substrW
);
284 static UINT
do_query(MSIHANDLE hdb
, const char *query
, MSIHANDLE
*phrec
)
289 /* open a select query */
290 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
291 if (r
!= ERROR_SUCCESS
)
293 r
= MsiViewExecute(hview
, 0);
294 if (r
!= ERROR_SUCCESS
)
296 ret
= MsiViewFetch(hview
, phrec
);
297 r
= MsiViewClose(hview
);
298 if (r
!= ERROR_SUCCESS
)
300 r
= MsiCloseHandle(hview
);
301 if (r
!= ERROR_SUCCESS
)
306 static UINT
run_query( MSIHANDLE hdb
, const char *query
)
311 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
312 if( r
!= ERROR_SUCCESS
)
315 r
= MsiViewExecute(hview
, 0);
316 if( r
== ERROR_SUCCESS
)
317 r
= MsiViewClose(hview
);
318 MsiCloseHandle(hview
);
322 static UINT
create_component_table( MSIHANDLE hdb
)
324 return run_query( hdb
,
325 "CREATE TABLE `Component` ( "
326 "`Component` CHAR(72) NOT NULL, "
327 "`ComponentId` CHAR(38), "
328 "`Directory_` CHAR(72) NOT NULL, "
329 "`Attributes` SHORT NOT NULL, "
330 "`Condition` CHAR(255), "
331 "`KeyPath` CHAR(72) "
332 "PRIMARY KEY `Component`)" );
335 static UINT
create_feature_table( MSIHANDLE hdb
)
337 return run_query( hdb
,
338 "CREATE TABLE `Feature` ( "
339 "`Feature` CHAR(38) NOT NULL, "
340 "`Feature_Parent` CHAR(38), "
342 "`Description` CHAR(255), "
343 "`Display` SHORT NOT NULL, "
344 "`Level` SHORT NOT NULL, "
345 "`Directory_` CHAR(72), "
346 "`Attributes` SHORT NOT NULL "
347 "PRIMARY KEY `Feature`)" );
350 static UINT
create_feature_components_table( MSIHANDLE hdb
)
352 return run_query( hdb
,
353 "CREATE TABLE `FeatureComponents` ( "
354 "`Feature_` CHAR(38) NOT NULL, "
355 "`Component_` CHAR(72) NOT NULL "
356 "PRIMARY KEY `Feature_`, `Component_` )" );
359 static UINT
create_file_table( MSIHANDLE hdb
)
361 return run_query( hdb
,
362 "CREATE TABLE `File` ("
363 "`File` CHAR(72) NOT NULL, "
364 "`Component_` CHAR(72) NOT NULL, "
365 "`FileName` CHAR(255) NOT NULL, "
366 "`FileSize` LONG NOT NULL, "
367 "`Version` CHAR(72), "
368 "`Language` CHAR(20), "
369 "`Attributes` SHORT, "
370 "`Sequence` SHORT NOT NULL "
371 "PRIMARY KEY `File`)" );
374 static UINT
create_remove_file_table( MSIHANDLE hdb
)
376 return run_query( hdb
,
377 "CREATE TABLE `RemoveFile` ("
378 "`FileKey` CHAR(72) NOT NULL, "
379 "`Component_` CHAR(72) NOT NULL, "
380 "`FileName` CHAR(255) LOCALIZABLE, "
381 "`DirProperty` CHAR(72) NOT NULL, "
382 "`InstallMode` SHORT NOT NULL "
383 "PRIMARY KEY `FileKey`)" );
386 static UINT
create_appsearch_table( MSIHANDLE hdb
)
388 return run_query( hdb
,
389 "CREATE TABLE `AppSearch` ("
390 "`Property` CHAR(72) NOT NULL, "
391 "`Signature_` CHAR(72) NOT NULL "
392 "PRIMARY KEY `Property`, `Signature_`)" );
395 static UINT
create_reglocator_table( MSIHANDLE hdb
)
397 return run_query( hdb
,
398 "CREATE TABLE `RegLocator` ("
399 "`Signature_` CHAR(72) NOT NULL, "
400 "`Root` SHORT NOT NULL, "
401 "`Key` CHAR(255) NOT NULL, "
404 "PRIMARY KEY `Signature_`)" );
407 static UINT
create_signature_table( MSIHANDLE hdb
)
409 return run_query( hdb
,
410 "CREATE TABLE `Signature` ("
411 "`Signature` CHAR(72) NOT NULL, "
412 "`FileName` CHAR(255) NOT NULL, "
413 "`MinVersion` CHAR(20), "
414 "`MaxVersion` CHAR(20), "
419 "`Languages` CHAR(255) "
420 "PRIMARY KEY `Signature`)" );
423 static UINT
create_launchcondition_table( MSIHANDLE hdb
)
425 return run_query( hdb
,
426 "CREATE TABLE `LaunchCondition` ("
427 "`Condition` CHAR(255) NOT NULL, "
428 "`Description` CHAR(255) NOT NULL "
429 "PRIMARY KEY `Condition`)" );
432 static UINT
create_property_table( MSIHANDLE hdb
)
434 return run_query( hdb
,
435 "CREATE TABLE `Property` ("
436 "`Property` CHAR(72) NOT NULL, "
438 "PRIMARY KEY `Property`)" );
441 static UINT
create_install_execute_sequence_table( MSIHANDLE hdb
)
443 return run_query( hdb
,
444 "CREATE TABLE `InstallExecuteSequence` ("
445 "`Action` CHAR(72) NOT NULL, "
446 "`Condition` CHAR(255), "
448 "PRIMARY KEY `Action`)" );
451 static UINT
create_media_table( MSIHANDLE hdb
)
453 return run_query( hdb
,
454 "CREATE TABLE `Media` ("
455 "`DiskId` SHORT NOT NULL, "
456 "`LastSequence` SHORT NOT NULL, "
457 "`DiskPrompt` CHAR(64), "
458 "`Cabinet` CHAR(255), "
459 "`VolumeLabel` CHAR(32), "
461 "PRIMARY KEY `DiskId`)" );
464 static UINT
create_ccpsearch_table( MSIHANDLE hdb
)
466 return run_query( hdb
,
467 "CREATE TABLE `CCPSearch` ("
468 "`Signature_` CHAR(72) NOT NULL "
469 "PRIMARY KEY `Signature_`)" );
472 static UINT
create_drlocator_table( MSIHANDLE hdb
)
474 return run_query( hdb
,
475 "CREATE TABLE `DrLocator` ("
476 "`Signature_` CHAR(72) NOT NULL, "
477 "`Parent` CHAR(72), "
480 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
483 static UINT
create_complocator_table( MSIHANDLE hdb
)
485 return run_query( hdb
,
486 "CREATE TABLE `CompLocator` ("
487 "`Signature_` CHAR(72) NOT NULL, "
488 "`ComponentId` CHAR(38) NOT NULL, "
490 "PRIMARY KEY `Signature_`)" );
493 static UINT
create_inilocator_table( MSIHANDLE hdb
)
495 return run_query( hdb
,
496 "CREATE TABLE `IniLocator` ("
497 "`Signature_` CHAR(72) NOT NULL, "
498 "`FileName` CHAR(255) NOT NULL, "
499 "`Section` CHAR(96)NOT NULL, "
500 "`Key` CHAR(128)NOT NULL, "
503 "PRIMARY KEY `Signature_`)" );
506 #define make_add_entry(type, qtext) \
507 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
509 char insert[] = qtext; \
512 sz = strlen(values) + sizeof insert; \
513 query = HeapAlloc(GetProcessHeap(),0,sz); \
514 sprintf(query,insert,values); \
515 r = run_query( hdb, query ); \
516 HeapFree(GetProcessHeap(), 0, query); \
520 make_add_entry(component
,
521 "INSERT INTO `Component` "
522 "(`Component`, `ComponentId`, `Directory_`, "
523 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
525 make_add_entry(directory
,
526 "INSERT INTO `Directory` "
527 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
529 make_add_entry(feature
,
530 "INSERT INTO `Feature` "
531 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
532 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
534 make_add_entry(feature_components
,
535 "INSERT INTO `FeatureComponents` "
536 "(`Feature_`, `Component_`) VALUES( %s )")
539 "INSERT INTO `File` "
540 "(`File`, `Component_`, `FileName`, `FileSize`, "
541 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
543 make_add_entry(appsearch
,
544 "INSERT INTO `AppSearch` "
545 "(`Property`, `Signature_`) VALUES( %s )")
547 make_add_entry(reglocator
,
548 "INSERT INTO `RegLocator` "
549 "(`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES( %s )")
551 make_add_entry(signature
,
552 "INSERT INTO `Signature` "
553 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
554 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
557 make_add_entry(launchcondition
,
558 "INSERT INTO `LaunchCondition` "
559 "(`Condition`, `Description`) VALUES( %s )")
561 make_add_entry(property
,
562 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
564 make_add_entry(install_execute_sequence
,
565 "INSERT INTO `InstallExecuteSequence` "
566 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
568 make_add_entry(media
,
569 "INSERT INTO `Media` "
570 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
571 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
573 make_add_entry(ccpsearch
,
574 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
576 make_add_entry(drlocator
,
577 "INSERT INTO `DrLocator` "
578 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
580 make_add_entry(complocator
,
581 "INSERT INTO `CompLocator` "
582 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
584 make_add_entry(inilocator
,
585 "INSERT INTO `IniLocator` "
586 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
589 static UINT
set_summary_info(MSIHANDLE hdb
)
594 /* build summary info */
595 res
= MsiGetSummaryInformation(hdb
, NULL
, 7, &suminfo
);
596 ok( res
== ERROR_SUCCESS
, "Failed to open summaryinfo\n" );
598 res
= MsiSummaryInfoSetProperty(suminfo
,2, VT_LPSTR
, 0,NULL
,
599 "Installation Database");
600 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
602 res
= MsiSummaryInfoSetProperty(suminfo
,3, VT_LPSTR
, 0,NULL
,
603 "Installation Database");
604 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
606 res
= MsiSummaryInfoSetProperty(suminfo
,4, VT_LPSTR
, 0,NULL
,
608 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
610 res
= MsiSummaryInfoSetProperty(suminfo
,7, VT_LPSTR
, 0,NULL
,
612 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
614 res
= MsiSummaryInfoSetProperty(suminfo
,9, VT_LPSTR
, 0,NULL
,
615 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
616 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
618 res
= MsiSummaryInfoSetProperty(suminfo
, 14, VT_I4
, 100, NULL
, NULL
);
619 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
621 res
= MsiSummaryInfoSetProperty(suminfo
, 15, VT_I4
, 0, NULL
, NULL
);
622 ok( res
== ERROR_SUCCESS
, "Failed to set summary info\n" );
624 res
= MsiSummaryInfoPersist(suminfo
);
625 ok( res
== ERROR_SUCCESS
, "Failed to make summary info persist\n" );
627 res
= MsiCloseHandle( suminfo
);
628 ok( res
== ERROR_SUCCESS
, "Failed to close suminfo\n" );
634 static MSIHANDLE
create_package_db(void)
641 /* create an empty database */
642 res
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
643 ok( res
== ERROR_SUCCESS
, "Failed to create database\n" );
644 if( res
!= ERROR_SUCCESS
)
647 res
= MsiDatabaseCommit( hdb
);
648 ok( res
== ERROR_SUCCESS
, "Failed to commit database\n" );
650 res
= set_summary_info(hdb
);
652 res
= run_query( hdb
,
653 "CREATE TABLE `Directory` ( "
654 "`Directory` CHAR(255) NOT NULL, "
655 "`Directory_Parent` CHAR(255), "
656 "`DefaultDir` CHAR(255) NOT NULL "
657 "PRIMARY KEY `Directory`)" );
658 ok( res
== ERROR_SUCCESS
, "Failed to create directory table\n" );
663 static MSIHANDLE
package_from_db(MSIHANDLE hdb
)
669 sprintf(szPackage
,"#%i",hdb
);
670 res
= MsiOpenPackage(szPackage
,&hPackage
);
671 if (res
!= ERROR_SUCCESS
)
674 res
= MsiCloseHandle(hdb
);
675 if (res
!= ERROR_SUCCESS
)
681 static void create_test_file(const CHAR
*name
)
686 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
687 ok(file
!= INVALID_HANDLE_VALUE
, "Failure to open file %s\n", name
);
688 WriteFile(file
, name
, strlen(name
), &written
, NULL
);
689 WriteFile(file
, "\n", strlen("\n"), &written
, NULL
);
693 typedef struct _tagVS_VERSIONINFO
700 VS_FIXEDFILEINFO Value
;
705 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
706 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
708 static BOOL
create_file_with_version(const CHAR
*name
, LONG ms
, LONG ls
)
710 VS_VERSIONINFO
*pVerInfo
;
711 VS_FIXEDFILEINFO
*pFixedInfo
;
718 GetSystemDirectory(path
, MAX_PATH
);
719 lstrcatA(path
, "\\kernel32.dll");
721 CopyFileA(path
, name
, FALSE
);
723 size
= GetFileVersionInfoSize(path
, &handle
);
724 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
726 GetFileVersionInfoA(path
, 0, size
, buffer
);
728 pVerInfo
= (VS_VERSIONINFO
*)buffer
;
729 ofs
= (BYTE
*)&pVerInfo
->szKey
[lstrlenW(pVerInfo
->szKey
) + 1];
730 pFixedInfo
= (VS_FIXEDFILEINFO
*)roundpos(pVerInfo
, ofs
, 4);
732 pFixedInfo
->dwFileVersionMS
= ms
;
733 pFixedInfo
->dwFileVersionLS
= ls
;
734 pFixedInfo
->dwProductVersionMS
= ms
;
735 pFixedInfo
->dwProductVersionLS
= ls
;
737 resource
= BeginUpdateResource(name
, FALSE
);
741 if (!UpdateResource(resource
, RT_VERSION
, MAKEINTRESOURCE(VS_VERSION_INFO
),
742 MAKELANGID(LANG_NEUTRAL
, SUBLANG_NEUTRAL
), buffer
, size
))
745 if (!EndUpdateResource(resource
, FALSE
))
751 HeapFree(GetProcessHeap(), 0, buffer
);
755 static void test_createpackage(void)
757 MSIHANDLE hPackage
= 0;
760 hPackage
= package_from_db(create_package_db());
761 ok( hPackage
!= 0, " Failed to create package\n");
763 res
= MsiCloseHandle( hPackage
);
764 ok( res
== ERROR_SUCCESS
, "Failed to close package\n" );
768 static void test_doaction( void )
773 r
= MsiDoAction( -1, NULL
);
774 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
776 hpkg
= package_from_db(create_package_db());
777 ok( hpkg
, "failed to create package\n");
779 r
= MsiDoAction(hpkg
, NULL
);
780 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
782 r
= MsiDoAction(0, "boo");
783 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
785 r
= MsiDoAction(hpkg
, "boo");
786 ok( r
== ERROR_FUNCTION_NOT_CALLED
, "wrong return val\n");
788 MsiCloseHandle( hpkg
);
792 static void test_gettargetpath_bad(void)
799 hpkg
= package_from_db(create_package_db());
800 ok( hpkg
, "failed to create package\n");
802 r
= MsiGetTargetPath( 0, NULL
, NULL
, NULL
);
803 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
805 r
= MsiGetTargetPath( 0, NULL
, NULL
, &sz
);
806 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
808 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
809 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
811 r
= MsiGetTargetPath( 0, "boo", NULL
, NULL
);
812 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
814 r
= MsiGetTargetPath( hpkg
, "boo", NULL
, NULL
);
815 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
817 r
= MsiGetTargetPath( hpkg
, "boo", buffer
, NULL
);
818 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
820 MsiCloseHandle( hpkg
);
824 static void query_file_path(MSIHANDLE hpkg
, LPCSTR file
, LPSTR buff
)
830 rec
= MsiCreateRecord( 1 );
831 ok(rec
, "MsiCreate record failed\n");
833 r
= MsiRecordSetString( rec
, 0, file
);
834 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
837 r
= MsiFormatRecord( hpkg
, rec
, buff
, &size
);
838 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
840 MsiCloseHandle( rec
);
843 static void test_settargetpath(void)
845 char tempdir
[MAX_PATH
+8], buffer
[MAX_PATH
], file
[MAX_PATH
];
851 hdb
= create_package_db();
852 ok ( hdb
, "failed to create package database\n" );
854 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'" );
855 ok( r
== S_OK
, "failed to add directory entry: %d\n" , r
);
857 r
= create_component_table( hdb
);
858 ok( r
== S_OK
, "cannot create Component table: %d\n", r
);
860 r
= add_component_entry( hdb
, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
861 ok( r
== S_OK
, "cannot add dummy component: %d\n", r
);
863 r
= add_component_entry( hdb
, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
864 ok( r
== S_OK
, "cannot add test component: %d\n", r
);
866 r
= create_feature_table( hdb
);
867 ok( r
== S_OK
, "cannot create Feature table: %d\n", r
);
869 r
= add_feature_entry( hdb
, "'TestFeature', '', '', '', 0, 1, '', 0" );
870 ok( r
== ERROR_SUCCESS
, "cannot add TestFeature to Feature table: %d\n", r
);
872 r
= create_feature_components_table( hdb
);
873 ok( r
== S_OK
, "cannot create FeatureComponents table: %d\n", r
);
875 r
= add_feature_components_entry( hdb
, "'TestFeature', 'RootComp'" );
876 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
878 r
= add_feature_components_entry( hdb
, "'TestFeature', 'TestComp'" );
879 ok( r
== S_OK
, "cannot insert component into FeatureComponents table: %d\n", r
);
881 add_directory_entry( hdb
, "'TestParent', 'TARGETDIR', 'TestParent'" );
882 add_directory_entry( hdb
, "'TestDir', 'TestParent', 'TestDir'" );
884 r
= create_file_table( hdb
);
885 ok( r
== S_OK
, "cannot create File table: %d\n", r
);
887 r
= add_file_entry( hdb
, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
888 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
890 r
= add_file_entry( hdb
, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
891 ok( r
== S_OK
, "cannot add file to the File table: %d\n", r
);
893 hpkg
= package_from_db( hdb
);
894 ok( hpkg
, "failed to create package\n");
896 r
= MsiDoAction( hpkg
, "CostInitialize");
897 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
899 r
= MsiDoAction( hpkg
, "FileCost");
900 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
902 r
= MsiDoAction( hpkg
, "CostFinalize");
903 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
905 r
= MsiSetTargetPath( 0, NULL
, NULL
);
906 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
908 r
= MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
909 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
911 r
= MsiSetTargetPath( hpkg
, "boo", NULL
);
912 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
914 r
= MsiSetTargetPath( hpkg
, "boo", "c:\\bogusx" );
915 ok( r
== ERROR_DIRECTORY
, "wrong return val\n");
917 sz
= sizeof tempdir
- 1;
918 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", tempdir
, &sz
);
919 sprintf( file
, "%srootfile.txt", tempdir
);
920 query_file_path( hpkg
, "[#RootFile]", buffer
);
921 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
922 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
924 GetTempFileName( tempdir
, "_wt", 0, buffer
);
925 sprintf( tempdir
, "%s\\subdir", buffer
);
927 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
928 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
929 "MsiSetTargetPath on file returned %d\n", r
);
931 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
932 ok( r
== ERROR_SUCCESS
|| r
== ERROR_DIRECTORY
,
933 "MsiSetTargetPath on 'subdir' of file returned %d\n", r
);
935 DeleteFile( buffer
);
937 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", buffer
);
938 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
940 r
= GetFileAttributes( buffer
);
941 ok ( r
== INVALID_FILE_ATTRIBUTES
, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r
);
943 r
= MsiSetTargetPath( hpkg
, "TARGETDIR", tempdir
);
944 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath on subsubdir returned %d\n", r
);
946 sz
= sizeof buffer
- 1;
947 lstrcat( tempdir
, "\\" );
948 r
= MsiGetTargetPath( hpkg
, "TARGETDIR", buffer
, &sz
);
949 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
950 ok( !lstrcmp(buffer
, tempdir
), "Expected %s, got %s\n", tempdir
, buffer
);
952 sprintf( file
, "%srootfile.txt", tempdir
);
953 query_file_path( hpkg
, "[#RootFile]", buffer
);
954 ok( !lstrcmp(buffer
, file
), "Expected %s, got %s\n", file
, buffer
);
956 r
= MsiSetTargetPath( hpkg
, "TestParent", "C:\\one\\two" );
957 ok( r
== ERROR_SUCCESS
, "MsiSetTargetPath returned %d\n", r
);
959 query_file_path( hpkg
, "[#TestFile]", buffer
);
960 ok( !lstrcmp(buffer
, "C:\\one\\two\\TestDir\\testfile.txt"),
961 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer
);
963 sz
= sizeof buffer
- 1;
964 r
= MsiGetTargetPath( hpkg
, "TestParent", buffer
, &sz
);
965 ok( r
== ERROR_SUCCESS
, "failed to get target path: %d\n", r
);
966 ok( !lstrcmp(buffer
, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer
);
968 MsiCloseHandle( hpkg
);
971 static void test_condition(void)
976 hpkg
= package_from_db(create_package_db());
977 ok( hpkg
, "failed to create package\n");
979 r
= MsiEvaluateCondition(0, NULL
);
980 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
982 r
= MsiEvaluateCondition(hpkg
, NULL
);
983 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
985 r
= MsiEvaluateCondition(hpkg
, "");
986 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
988 r
= MsiEvaluateCondition(hpkg
, "1");
989 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
991 r
= MsiEvaluateCondition(hpkg
, "0");
992 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
994 r
= MsiEvaluateCondition(hpkg
, "-1");
995 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
997 r
= MsiEvaluateCondition(hpkg
, "0 = 0");
998 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1000 r
= MsiEvaluateCondition(hpkg
, "0 <> 0");
1001 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1003 r
= MsiEvaluateCondition(hpkg
, "0 = 1");
1004 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1006 r
= MsiEvaluateCondition(hpkg
, "0 > 1");
1007 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1009 r
= MsiEvaluateCondition(hpkg
, "0 ~> 1");
1010 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1012 r
= MsiEvaluateCondition(hpkg
, "1 > 1");
1013 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1015 r
= MsiEvaluateCondition(hpkg
, "1 ~> 1");
1016 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1018 r
= MsiEvaluateCondition(hpkg
, "0 >= 1");
1019 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1021 r
= MsiEvaluateCondition(hpkg
, "0 ~>= 1");
1022 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1024 r
= MsiEvaluateCondition(hpkg
, "1 >= 1");
1025 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1027 r
= MsiEvaluateCondition(hpkg
, "1 ~>= 1");
1028 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1030 r
= MsiEvaluateCondition(hpkg
, "0 < 1");
1031 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1033 r
= MsiEvaluateCondition(hpkg
, "0 ~< 1");
1034 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1036 r
= MsiEvaluateCondition(hpkg
, "1 < 1");
1037 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1039 r
= MsiEvaluateCondition(hpkg
, "1 ~< 1");
1040 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1042 r
= MsiEvaluateCondition(hpkg
, "0 <= 1");
1043 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1045 r
= MsiEvaluateCondition(hpkg
, "0 ~<= 1");
1046 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1048 r
= MsiEvaluateCondition(hpkg
, "1 <= 1");
1049 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1051 r
= MsiEvaluateCondition(hpkg
, "1 ~<= 1");
1052 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1054 r
= MsiEvaluateCondition(hpkg
, "0 >=");
1055 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1057 r
= MsiEvaluateCondition(hpkg
, " ");
1058 ok( r
== MSICONDITION_NONE
, "wrong return val\n");
1060 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"1\"");
1061 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1063 r
= MsiEvaluateCondition(hpkg
, "LicView <> \"0\"");
1064 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1066 r
= MsiEvaluateCondition(hpkg
, "LicView <> LicView");
1067 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1069 r
= MsiEvaluateCondition(hpkg
, "not 0");
1070 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1072 r
= MsiEvaluateCondition(hpkg
, "not LicView");
1073 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1075 r
= MsiEvaluateCondition(hpkg
, "not \"A\"");
1076 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1078 r
= MsiEvaluateCondition(hpkg
, "~not \"A\"");
1079 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1081 r
= MsiEvaluateCondition(hpkg
, "\"0\"");
1082 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1084 r
= MsiEvaluateCondition(hpkg
, "1 and 2");
1085 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1087 r
= MsiEvaluateCondition(hpkg
, "not 0 and 3");
1088 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1090 r
= MsiEvaluateCondition(hpkg
, "not 0 and 0");
1091 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1093 r
= MsiEvaluateCondition(hpkg
, "not 0 or 1");
1094 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1096 r
= MsiEvaluateCondition(hpkg
, "(0)");
1097 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1099 r
= MsiEvaluateCondition(hpkg
, "(((((1))))))");
1100 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1102 r
= MsiEvaluateCondition(hpkg
, "(((((1)))))");
1103 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1105 r
= MsiEvaluateCondition(hpkg
, " \"A\" < \"B\" ");
1106 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1108 r
= MsiEvaluateCondition(hpkg
, " \"A\" > \"B\" ");
1109 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1111 r
= MsiEvaluateCondition(hpkg
, " \"1\" > \"12\" ");
1112 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1114 r
= MsiEvaluateCondition(hpkg
, " \"100\" < \"21\" ");
1115 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1117 r
= MsiEvaluateCondition(hpkg
, "0 < > 0");
1118 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1120 r
= MsiEvaluateCondition(hpkg
, "(1<<1) == 2");
1121 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1123 r
= MsiEvaluateCondition(hpkg
, " \"A\" = \"a\" ");
1124 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1126 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~ = \"a\" ");
1127 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1129 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= \"a\" ");
1130 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1132 r
= MsiEvaluateCondition(hpkg
, " \"A\" ~= 1 ");
1133 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1135 r
= MsiEvaluateCondition(hpkg
, " \"A\" = 1 ");
1136 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1138 r
= MsiEvaluateCondition(hpkg
, " 1 ~= 1 ");
1139 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1141 r
= MsiEvaluateCondition(hpkg
, " 1 ~= \"1\" ");
1142 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1144 r
= MsiEvaluateCondition(hpkg
, " 1 = \"1\" ");
1145 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1147 r
= MsiEvaluateCondition(hpkg
, " 0 = \"1\" ");
1148 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1150 r
= MsiEvaluateCondition(hpkg
, " 0 < \"100\" ");
1151 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1153 r
= MsiEvaluateCondition(hpkg
, " 100 > \"0\" ");
1154 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1156 r
= MsiEvaluateCondition(hpkg
, "1 XOR 1");
1157 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1159 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1");
1160 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1162 r
= MsiEvaluateCondition(hpkg
, "1 IMP 0");
1163 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1165 r
= MsiEvaluateCondition(hpkg
, "0 IMP 0");
1166 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1168 r
= MsiEvaluateCondition(hpkg
, "0 EQV 0");
1169 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1171 r
= MsiEvaluateCondition(hpkg
, "0 EQV 1");
1172 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1174 r
= MsiEvaluateCondition(hpkg
, "1 IMP 1 OR 0");
1175 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1177 r
= MsiEvaluateCondition(hpkg
, "1 IMPL 1");
1178 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1180 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" >< \"S\" ");
1181 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1183 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"s\" ");
1184 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1186 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"\" ");
1187 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1189 r
= MsiEvaluateCondition(hpkg
, "\"ASFD\" ~>< \"sss\" ");
1190 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1192 MsiSetProperty(hpkg
, "mm", "5" );
1194 r
= MsiEvaluateCondition(hpkg
, "mm = 5");
1195 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1197 r
= MsiEvaluateCondition(hpkg
, "mm < 6");
1198 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1200 r
= MsiEvaluateCondition(hpkg
, "mm <= 5");
1201 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1203 r
= MsiEvaluateCondition(hpkg
, "mm > 4");
1204 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1206 r
= MsiEvaluateCondition(hpkg
, "mm < 12");
1207 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1209 r
= MsiEvaluateCondition(hpkg
, "mm = \"5\"");
1210 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1212 r
= MsiEvaluateCondition(hpkg
, "0 = \"\"");
1213 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1215 r
= MsiEvaluateCondition(hpkg
, "0 AND \"\"");
1216 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1218 r
= MsiEvaluateCondition(hpkg
, "1 AND \"\"");
1219 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1221 r
= MsiEvaluateCondition(hpkg
, "1 AND \"1\"");
1222 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1224 r
= MsiEvaluateCondition(hpkg
, "3 >< 1");
1225 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1227 r
= MsiEvaluateCondition(hpkg
, "3 >< 4");
1228 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1230 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 0");
1231 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1233 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1");
1234 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1236 r
= MsiEvaluateCondition(hpkg
, "NOT 1 OR 0");
1237 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1239 r
= MsiEvaluateCondition(hpkg
, "0 AND 1 OR 1");
1240 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1242 r
= MsiEvaluateCondition(hpkg
, "0 AND 0 OR 1");
1243 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1245 r
= MsiEvaluateCondition(hpkg
, "NOT 0 AND 1 OR 0");
1246 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1248 r
= MsiEvaluateCondition(hpkg
, "_1 = _1");
1249 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1251 r
= MsiEvaluateCondition(hpkg
, "( 1 AND 1 ) = 2");
1252 ok( r
== MSICONDITION_ERROR
, "wrong return val\n");
1254 r
= MsiEvaluateCondition(hpkg
, "NOT ( 1 AND 1 )");
1255 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1257 r
= MsiEvaluateCondition(hpkg
, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1258 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1260 r
= MsiEvaluateCondition(hpkg
, "Installed<>\"\"");
1261 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1263 r
= MsiEvaluateCondition(hpkg
, "NOT 1 AND 0");
1264 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1266 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1267 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1269 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1270 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1272 r
= MsiEvaluateCondition(hpkg
, "bandalmael<0");
1273 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1275 r
= MsiEvaluateCondition(hpkg
, "bandalmael>0");
1276 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1278 r
= MsiEvaluateCondition(hpkg
, "bandalmael>=0");
1279 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1281 r
= MsiEvaluateCondition(hpkg
, "bandalmael<=0");
1282 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1284 r
= MsiEvaluateCondition(hpkg
, "bandalmael~<>0");
1285 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1287 MsiSetProperty(hpkg
, "bandalmael", "0" );
1288 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1289 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1291 MsiSetProperty(hpkg
, "bandalmael", "" );
1292 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1293 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1295 MsiSetProperty(hpkg
, "bandalmael", "asdf" );
1296 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1297 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1299 MsiSetProperty(hpkg
, "bandalmael", "0asdf" );
1300 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1301 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1303 MsiSetProperty(hpkg
, "bandalmael", "0 " );
1304 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1305 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1307 MsiSetProperty(hpkg
, "bandalmael", "-0" );
1308 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1309 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1311 MsiSetProperty(hpkg
, "bandalmael", "0000000000000" );
1312 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1313 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1315 MsiSetProperty(hpkg
, "bandalmael", "--0" );
1316 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1317 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1319 MsiSetProperty(hpkg
, "bandalmael", "0x00" );
1320 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1321 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1323 MsiSetProperty(hpkg
, "bandalmael", "-" );
1324 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1325 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1327 MsiSetProperty(hpkg
, "bandalmael", "+0" );
1328 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1329 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1331 MsiSetProperty(hpkg
, "bandalmael", "0.0" );
1332 r
= MsiEvaluateCondition(hpkg
, "bandalmael=0");
1333 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1334 r
= MsiEvaluateCondition(hpkg
, "bandalmael<>0");
1335 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1337 MsiSetProperty(hpkg
, "one", "hi");
1338 MsiSetProperty(hpkg
, "two", "hithere");
1339 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1340 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1342 MsiSetProperty(hpkg
, "one", "hithere");
1343 MsiSetProperty(hpkg
, "two", "hi");
1344 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1345 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1347 MsiSetProperty(hpkg
, "one", "hello");
1348 MsiSetProperty(hpkg
, "two", "hi");
1349 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1350 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1352 MsiSetProperty(hpkg
, "one", "hellohithere");
1353 MsiSetProperty(hpkg
, "two", "hi");
1354 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1355 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1357 MsiSetProperty(hpkg
, "one", "");
1358 MsiSetProperty(hpkg
, "two", "hi");
1359 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1360 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1362 MsiSetProperty(hpkg
, "one", "hi");
1363 MsiSetProperty(hpkg
, "two", "");
1364 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1365 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1367 MsiSetProperty(hpkg
, "one", "");
1368 MsiSetProperty(hpkg
, "two", "");
1369 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1370 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1372 MsiSetProperty(hpkg
, "one", "1234");
1373 MsiSetProperty(hpkg
, "two", "1");
1374 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1375 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1377 MsiSetProperty(hpkg
, "one", "one 1234");
1378 MsiSetProperty(hpkg
, "two", "1");
1379 r
= MsiEvaluateCondition(hpkg
, "one >< two");
1380 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1382 MsiSetProperty(hpkg
, "one", "hithere");
1383 MsiSetProperty(hpkg
, "two", "hi");
1384 r
= MsiEvaluateCondition(hpkg
, "one << two");
1385 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1387 MsiSetProperty(hpkg
, "one", "hi");
1388 MsiSetProperty(hpkg
, "two", "hithere");
1389 r
= MsiEvaluateCondition(hpkg
, "one << two");
1390 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1392 MsiSetProperty(hpkg
, "one", "hi");
1393 MsiSetProperty(hpkg
, "two", "hi");
1394 r
= MsiEvaluateCondition(hpkg
, "one << two");
1395 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1397 MsiSetProperty(hpkg
, "one", "abcdhithere");
1398 MsiSetProperty(hpkg
, "two", "hi");
1399 r
= MsiEvaluateCondition(hpkg
, "one << two");
1400 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1402 MsiSetProperty(hpkg
, "one", "");
1403 MsiSetProperty(hpkg
, "two", "hi");
1404 r
= MsiEvaluateCondition(hpkg
, "one << two");
1405 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1407 MsiSetProperty(hpkg
, "one", "hithere");
1408 MsiSetProperty(hpkg
, "two", "");
1409 r
= MsiEvaluateCondition(hpkg
, "one << two");
1410 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1412 MsiSetProperty(hpkg
, "one", "");
1413 MsiSetProperty(hpkg
, "two", "");
1414 r
= MsiEvaluateCondition(hpkg
, "one << two");
1415 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1417 MsiSetProperty(hpkg
, "one", "1234");
1418 MsiSetProperty(hpkg
, "two", "1");
1419 r
= MsiEvaluateCondition(hpkg
, "one << two");
1420 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1422 MsiSetProperty(hpkg
, "one", "1234 one");
1423 MsiSetProperty(hpkg
, "two", "1");
1424 r
= MsiEvaluateCondition(hpkg
, "one << two");
1425 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1427 MsiSetProperty(hpkg
, "one", "hithere");
1428 MsiSetProperty(hpkg
, "two", "there");
1429 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1430 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1432 MsiSetProperty(hpkg
, "one", "hithere");
1433 MsiSetProperty(hpkg
, "two", "hi");
1434 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1435 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1437 MsiSetProperty(hpkg
, "one", "there");
1438 MsiSetProperty(hpkg
, "two", "hithere");
1439 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1440 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1442 MsiSetProperty(hpkg
, "one", "there");
1443 MsiSetProperty(hpkg
, "two", "there");
1444 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1445 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1447 MsiSetProperty(hpkg
, "one", "abcdhithere");
1448 MsiSetProperty(hpkg
, "two", "hi");
1449 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1450 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1452 MsiSetProperty(hpkg
, "one", "");
1453 MsiSetProperty(hpkg
, "two", "there");
1454 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1455 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1457 MsiSetProperty(hpkg
, "one", "there");
1458 MsiSetProperty(hpkg
, "two", "");
1459 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1460 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1462 MsiSetProperty(hpkg
, "one", "");
1463 MsiSetProperty(hpkg
, "two", "");
1464 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1465 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1467 MsiSetProperty(hpkg
, "one", "1234");
1468 MsiSetProperty(hpkg
, "two", "4");
1469 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1470 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1472 MsiSetProperty(hpkg
, "one", "one 1234");
1473 MsiSetProperty(hpkg
, "two", "4");
1474 r
= MsiEvaluateCondition(hpkg
, "one >> two");
1475 ok( r
== MSICONDITION_TRUE
, "wrong return val\n");
1477 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", NULL
); /* make sure it's empty */
1479 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1480 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1482 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport > \"1.1.4322\"");
1483 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1485 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport >= \"1.1.4322\"");
1486 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1488 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <= \"1.1.4322\"");
1489 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1491 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport <> \"1.1.4322\"");
1492 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1494 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1495 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1497 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"abcd\"");
1498 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1500 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a1.1.4322\"");
1501 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1503 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322a\"");
1504 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1506 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1507 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1509 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1510 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1512 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1513 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1515 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1");
1516 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1518 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"1.1\"");
1519 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1521 r
= MsiEvaluateCondition(hpkg
, "\"2\" < \"12.1\"");
1522 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1524 r
= MsiEvaluateCondition(hpkg
, "\"02.1\" < \"2.11\"");
1525 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1527 r
= MsiEvaluateCondition(hpkg
, "\"02.1.1\" < \"2.1\"");
1528 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1530 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1531 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1533 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1534 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1536 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"0\"");
1537 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1539 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"-1\"");
1540 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1542 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a\"");
1543 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1545 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1546 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1548 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"!\"");
1549 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1551 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"/\"");
1552 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1554 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \" \"");
1555 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1557 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"azAZ_\"");
1558 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1560 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]\"");
1561 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1563 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a[a]a\"");
1564 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1566 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]\"");
1567 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1569 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a]a\"");
1570 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1572 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a}\"");
1573 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1575 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"{a\"");
1576 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1578 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"[a\"");
1579 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1581 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a{\"");
1582 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1584 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"a]\"");
1585 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1587 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"A\"");
1588 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1590 MsiSetProperty(hpkg
, "MsiNetAssemblySupport", "1.1.4322");
1591 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.4322\"");
1592 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1594 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.14322\"");
1595 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1597 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1.5\"");
1598 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1600 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1.1\"");
1601 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1603 r
= MsiEvaluateCondition(hpkg
, "MsiNetAssemblySupport < \"1\"");
1604 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1606 MsiSetProperty(hpkg
, "one", "1");
1607 r
= MsiEvaluateCondition(hpkg
, "one < \"1\"");
1608 ok( r
== MSICONDITION_FALSE
, "wrong return val\n");
1610 MsiSetProperty(hpkg
, "X", "5.0");
1612 r
= MsiEvaluateCondition(hpkg
, "X != \"\"");
1613 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1615 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\"");
1616 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1618 r
= MsiEvaluateCondition(hpkg
, "X =\"5.1\"");
1619 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1621 r
= MsiEvaluateCondition(hpkg
, "X =\"6.0\"");
1622 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1624 r
= MsiEvaluateCondition(hpkg
, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1625 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1627 r
= MsiEvaluateCondition(hpkg
, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1628 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1630 r
= MsiEvaluateCondition(hpkg
, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1631 ok( r
== MSICONDITION_ERROR
, "wrong return val (%d)\n", r
);
1633 /* feature doesn't exist */
1634 r
= MsiEvaluateCondition(hpkg
, "&nofeature");
1635 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1637 MsiSetProperty(hpkg
, "A", "2");
1638 MsiSetProperty(hpkg
, "X", "50");
1640 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1641 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1643 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1644 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1646 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1647 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1649 MsiSetProperty(hpkg
, "X", "50val");
1651 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1652 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1654 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1655 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1657 MsiSetProperty(hpkg
, "A", "7");
1658 MsiSetProperty(hpkg
, "X", "50");
1660 r
= MsiEvaluateCondition(hpkg
, "7 <= X");
1661 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1663 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1664 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1666 r
= MsiEvaluateCondition(hpkg
, "A <= 50");
1667 ok( r
== MSICONDITION_TRUE
, "wrong return val (%d)\n", r
);
1669 MsiSetProperty(hpkg
, "X", "50val");
1671 r
= MsiEvaluateCondition(hpkg
, "2 <= X");
1672 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1674 r
= MsiEvaluateCondition(hpkg
, "A <= X");
1675 ok( r
== MSICONDITION_FALSE
, "wrong return val (%d)\n", r
);
1677 MsiCloseHandle( hpkg
);
1678 DeleteFile(msifile
);
1681 static BOOL
check_prop_empty( MSIHANDLE hpkg
, const char * prop
)
1689 r
= MsiGetProperty( hpkg
, prop
, buffer
, &sz
);
1690 return r
== ERROR_SUCCESS
&& buffer
[0] == 0 && sz
== 0;
1693 static void test_props(void)
1695 MSIHANDLE hpkg
, hdb
;
1700 hdb
= create_package_db();
1702 "CREATE TABLE `Property` ( "
1703 "`Property` CHAR(255) NOT NULL, "
1704 "`Value` CHAR(255) "
1705 "PRIMARY KEY `Property`)" );
1706 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1709 "INSERT INTO `Property` "
1710 "(`Property`, `Value`) "
1711 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1712 ok( r
== ERROR_SUCCESS
, "Failed\n" );
1714 hpkg
= package_from_db( hdb
);
1715 ok( hpkg
, "failed to create package\n");
1717 /* test invalid values */
1718 r
= MsiGetProperty( 0, NULL
, NULL
, NULL
);
1719 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1721 r
= MsiGetProperty( hpkg
, NULL
, NULL
, NULL
);
1722 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1724 r
= MsiGetProperty( hpkg
, "boo", NULL
, NULL
);
1725 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1727 r
= MsiGetProperty( hpkg
, "boo", buffer
, NULL
);
1728 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1730 /* test retrieving an empty/nonexistent property */
1732 r
= MsiGetProperty( hpkg
, "boo", NULL
, &sz
);
1733 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1734 ok( sz
== 0, "wrong size returned\n");
1736 check_prop_empty( hpkg
, "boo");
1739 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1740 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1741 ok( !strcmp(buffer
,"x"), "buffer was changed\n");
1742 ok( sz
== 0, "wrong size returned\n");
1746 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1747 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1748 ok( buffer
[0] == 0, "buffer was not changed\n");
1749 ok( sz
== 0, "wrong size returned\n");
1751 /* set the property to something */
1752 r
= MsiSetProperty( 0, NULL
, NULL
);
1753 ok( r
== ERROR_INVALID_HANDLE
, "wrong return val\n");
1755 r
= MsiSetProperty( hpkg
, NULL
, NULL
);
1756 ok( r
== ERROR_INVALID_PARAMETER
, "wrong return val\n");
1758 r
= MsiSetProperty( hpkg
, "", NULL
);
1759 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1761 /* try set and get some illegal property identifiers */
1762 r
= MsiSetProperty( hpkg
, "", "asdf" );
1763 ok( r
== ERROR_FUNCTION_FAILED
, "wrong return val\n");
1765 r
= MsiSetProperty( hpkg
, "=", "asdf" );
1766 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1768 r
= MsiSetProperty( hpkg
, " ", "asdf" );
1769 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1771 r
= MsiSetProperty( hpkg
, "'", "asdf" );
1772 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1776 r
= MsiGetProperty( hpkg
, "'", buffer
, &sz
);
1777 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1778 ok( !strcmp(buffer
,"asdf"), "buffer was not changed\n");
1780 /* set empty values */
1781 r
= MsiSetProperty( hpkg
, "boo", NULL
);
1782 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1783 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1785 r
= MsiSetProperty( hpkg
, "boo", "" );
1786 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1787 ok( check_prop_empty( hpkg
, "boo"), "prop wasn't empty\n");
1789 /* set a non-empty value */
1790 r
= MsiSetProperty( hpkg
, "boo", "xyz" );
1791 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1795 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1796 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1797 ok( buffer
[0] == 0, "buffer was not changed\n");
1798 ok( sz
== 3, "wrong size returned\n");
1802 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1803 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1804 ok( !strcmp(buffer
,"xyz"), "buffer was not changed\n");
1805 ok( sz
== 3, "wrong size returned\n");
1809 r
= MsiGetProperty( hpkg
, "boo", buffer
, &sz
);
1810 ok( r
== ERROR_MORE_DATA
, "wrong return val\n");
1811 ok( !strcmp(buffer
,"xy"), "buffer was not changed\n");
1812 ok( sz
== 3, "wrong size returned\n");
1814 r
= MsiSetProperty(hpkg
, "SourceDir", "foo");
1815 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1818 r
= MsiGetProperty(hpkg
, "SOURCEDIR", buffer
, &sz
);
1819 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1820 ok( !strcmp(buffer
,""), "buffer wrong\n");
1821 ok( sz
== 0, "wrong size returned\n");
1824 r
= MsiGetProperty(hpkg
, "SOMERANDOMNAME", buffer
, &sz
);
1825 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1826 ok( !strcmp(buffer
,""), "buffer wrong\n");
1827 ok( sz
== 0, "wrong size returned\n");
1830 r
= MsiGetProperty(hpkg
, "SourceDir", buffer
, &sz
);
1831 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1832 ok( !strcmp(buffer
,"foo"), "buffer wrong\n");
1833 ok( sz
== 3, "wrong size returned\n");
1835 r
= MsiSetProperty(hpkg
, "MetadataCompName", "Photoshop.dll");
1836 ok( r
== ERROR_SUCCESS
, "wrong return val\n");
1839 r
= MsiGetProperty(hpkg
, "MetadataCompName", NULL
, &sz
);
1840 ok( r
== ERROR_SUCCESS
, "return wrong\n");
1841 ok( sz
== 13, "size wrong (%d)\n", sz
);
1844 r
= MsiGetProperty(hpkg
, "MetadataCompName", buffer
, &sz
);
1845 ok( r
== ERROR_MORE_DATA
, "return wrong\n");
1846 ok( !strcmp(buffer
,"Photoshop.dl"), "buffer wrong\n");
1848 r
= MsiSetProperty(hpkg
, "property", "value");
1849 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1852 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
1853 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1854 ok( !strcmp(buffer
, "value"), "Expected value, got %s\n", buffer
);
1856 r
= MsiSetProperty(hpkg
, "property", NULL
);
1857 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1860 r
= MsiGetProperty(hpkg
, "property", buffer
, &sz
);
1861 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1862 ok( !strlen(buffer
), "Expected empty string, got %s\n", buffer
);
1864 MsiCloseHandle( hpkg
);
1865 DeleteFile(msifile
);
1868 static BOOL
find_prop_in_property(MSIHANDLE hdb
, LPCSTR prop
, LPCSTR val
)
1870 MSIHANDLE hview
, hrec
;
1872 CHAR buffer
[MAX_PATH
];
1876 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
1877 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
1878 r
= MsiViewExecute(hview
, 0);
1879 ok(r
== ERROR_SUCCESS
, "MsiViewExecute failed\n");
1882 while (r
== ERROR_SUCCESS
&& !found
)
1884 r
= MsiViewFetch(hview
, &hrec
);
1885 if (r
!= ERROR_SUCCESS
) break;
1888 r
= MsiRecordGetString(hrec
, 1, buffer
, &sz
);
1889 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, prop
))
1892 r
= MsiRecordGetString(hrec
, 2, buffer
, &sz
);
1893 if (r
== ERROR_SUCCESS
&& !lstrcmpA(buffer
, val
))
1897 MsiCloseHandle(hrec
);
1900 MsiViewClose(hview
);
1901 MsiCloseHandle(hview
);
1906 static void test_property_table(void)
1910 MSIHANDLE hpkg
, hdb
, hrec
;
1911 char buffer
[MAX_PATH
];
1915 hdb
= create_package_db();
1916 ok( hdb
, "failed to create package\n");
1918 hpkg
= package_from_db(hdb
);
1919 ok( hpkg
, "failed to create package\n");
1921 MsiCloseHandle(hdb
);
1923 hdb
= MsiGetActiveDatabase(hpkg
);
1925 query
= "CREATE TABLE `_Property` ( "
1926 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1927 r
= run_query(hdb
, query
);
1928 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
1930 MsiCloseHandle(hdb
);
1931 MsiCloseHandle(hpkg
);
1932 DeleteFile(msifile
);
1934 hdb
= create_package_db();
1935 ok( hdb
, "failed to create package\n");
1937 query
= "CREATE TABLE `_Property` ( "
1938 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
1939 r
= run_query(hdb
, query
);
1940 ok(r
== ERROR_SUCCESS
, "failed to create table\n");
1942 query
= "ALTER `_Property` ADD `foo` INTEGER";
1943 r
= run_query(hdb
, query
);
1944 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
1946 query
= "ALTER TABLE `_Property` ADD `foo` INTEGER";
1947 r
= run_query(hdb
, query
);
1948 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "failed to add column\n");
1950 query
= "ALTER TABLE `_Property` ADD `extra` INTEGER";
1951 r
= run_query(hdb
, query
);
1952 ok(r
== ERROR_SUCCESS
, "failed to add column\n");
1954 hpkg
= package_from_db(hdb
);
1957 ok(!hpkg
, "package should not be created\n");
1960 MsiCloseHandle(hdb
);
1961 MsiCloseHandle(hpkg
);
1962 DeleteFile(msifile
);
1964 hdb
= create_package_db();
1965 ok (hdb
, "failed to create package database\n");
1967 r
= create_property_table(hdb
);
1968 ok(r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
1970 r
= add_property_entry(hdb
, "'prop', 'val'");
1971 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
1973 hpkg
= package_from_db(hdb
);
1974 ok(hpkg
, "failed to create package\n");
1976 MsiCloseHandle(hdb
);
1979 r
= MsiGetProperty(hpkg
, "prop", buffer
, &sz
);
1980 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
1981 ok(!lstrcmp(buffer
, "val"), "Expected val, got %s\n", buffer
);
1983 hdb
= MsiGetActiveDatabase(hpkg
);
1985 found
= find_prop_in_property(hdb
, "prop", "val");
1986 ok(found
, "prop should be in the _Property table\n");
1988 r
= add_property_entry(hdb
, "'dantes', 'mercedes'");
1989 ok(r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
1991 query
= "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
1992 r
= do_query(hdb
, query
, &hrec
);
1993 ok(r
== ERROR_BAD_QUERY_SYNTAX
, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
1995 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
1996 ok(found
== FALSE
, "dantes should not be in the _Property table\n");
1999 lstrcpy(buffer
, "aaa");
2000 r
= MsiGetProperty(hpkg
, "dantes", buffer
, &sz
);
2001 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2002 ok(lstrlenA(buffer
) == 0, "Expected empty string, got %s\n", buffer
);
2004 r
= MsiSetProperty(hpkg
, "dantes", "mercedes");
2005 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2007 found
= find_prop_in_property(hdb
, "dantes", "mercedes");
2008 ok(found
== TRUE
, "dantes should be in the _Property table\n");
2010 MsiCloseHandle(hdb
);
2011 MsiCloseHandle(hpkg
);
2012 DeleteFile(msifile
);
2015 static UINT
try_query_param( MSIHANDLE hdb
, LPCSTR szQuery
, MSIHANDLE hrec
)
2020 res
= MsiDatabaseOpenView( hdb
, szQuery
, &htab
);
2021 if( res
== ERROR_SUCCESS
)
2025 r
= MsiViewExecute( htab
, hrec
);
2026 if( r
!= ERROR_SUCCESS
)
2029 fprintf(stderr
,"MsiViewExecute failed %08x\n", res
);
2032 r
= MsiViewClose( htab
);
2033 if( r
!= ERROR_SUCCESS
)
2036 r
= MsiCloseHandle( htab
);
2037 if( r
!= ERROR_SUCCESS
)
2043 static UINT
try_query( MSIHANDLE hdb
, LPCSTR szQuery
)
2045 return try_query_param( hdb
, szQuery
, 0 );
2048 static void set_summary_str(MSIHANDLE hdb
, DWORD pid
, LPCSTR value
)
2053 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2054 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2056 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_LPSTR
, 0, NULL
, value
);
2057 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2059 r
= MsiSummaryInfoPersist(summary
);
2060 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2062 MsiCloseHandle(summary
);
2065 static void set_summary_dword(MSIHANDLE hdb
, DWORD pid
, DWORD value
)
2070 r
= MsiGetSummaryInformationA(hdb
, NULL
, 1, &summary
);
2071 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2073 r
= MsiSummaryInfoSetPropertyA(summary
, pid
, VT_I4
, value
, NULL
, NULL
);
2074 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2076 r
= MsiSummaryInfoPersist(summary
);
2077 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2079 MsiCloseHandle(summary
);
2082 static void test_msipackage(void)
2084 MSIHANDLE hdb
= 0, hpack
= 100;
2089 /* NULL szPackagePath */
2090 r
= MsiOpenPackage(NULL
, &hpack
);
2091 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2093 /* empty szPackagePath */
2094 r
= MsiOpenPackage("", &hpack
);
2097 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2100 if (r
== ERROR_SUCCESS
)
2101 MsiCloseHandle(hpack
);
2103 /* nonexistent szPackagePath */
2104 r
= MsiOpenPackage("nonexistent", &hpack
);
2105 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r
);
2108 r
= MsiOpenPackage(msifile
, NULL
);
2109 ok(r
== ERROR_INVALID_PARAMETER
, "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2113 r
= MsiOpenPackage(name
, &hpack
);
2114 ok(r
== ERROR_INVALID_HANDLE
, "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
2116 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2117 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2119 /* database exists, but is emtpy */
2120 sprintf(name
, "#%d", hdb
);
2121 r
= MsiOpenPackage(name
, &hpack
);
2122 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2123 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2125 query
= "CREATE TABLE `Property` ( "
2126 "`Property` CHAR(72), `Value` CHAR(0) "
2127 "PRIMARY KEY `Property`)";
2128 r
= try_query(hdb
, query
);
2129 ok(r
== ERROR_SUCCESS
, "failed to create Properties table\n");
2131 query
= "CREATE TABLE `InstallExecuteSequence` ("
2132 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2133 "PRIMARY KEY `Action`)";
2134 r
= try_query(hdb
, query
);
2135 ok(r
== ERROR_SUCCESS
, "failed to create InstallExecuteSequence table\n");
2137 /* a few key tables exist */
2138 sprintf(name
, "#%d", hdb
);
2139 r
= MsiOpenPackage(name
, &hpack
);
2140 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2141 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2143 MsiCloseHandle(hdb
);
2144 DeleteFile(msifile
);
2146 /* start with a clean database to show what constitutes a valid package */
2147 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
2148 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2150 sprintf(name
, "#%d", hdb
);
2152 /* The following summary information props must exist:
2157 set_summary_dword(hdb
, PID_PAGECOUNT
, 100);
2158 r
= MsiOpenPackage(name
, &hpack
);
2159 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
2160 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
2162 set_summary_str(hdb
, PID_REVNUMBER
, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2163 r
= MsiOpenPackage(name
, &hpack
);
2164 ok(r
== ERROR_SUCCESS
,
2165 "Expected ERROR_SUCCESS, got %d\n", r
);
2167 MsiCloseHandle(hpack
);
2168 MsiCloseHandle(hdb
);
2169 DeleteFile(msifile
);
2172 static void test_formatrecord2(void)
2174 MSIHANDLE hpkg
, hrec
;
2179 hpkg
= package_from_db(create_package_db());
2180 ok( hpkg
, "failed to create package\n");
2182 r
= MsiSetProperty(hpkg
, "Manufacturer", " " );
2183 ok( r
== ERROR_SUCCESS
, "set property failed\n");
2185 hrec
= MsiCreateRecord(2);
2186 ok(hrec
, "create record failed\n");
2188 r
= MsiRecordSetString( hrec
, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2189 ok( r
== ERROR_SUCCESS
, "format record failed\n");
2193 r
= MsiFormatRecord( hpkg
, hrec
, buffer
, &sz
);
2195 r
= MsiRecordSetString(hrec
, 0, "[foo][1]");
2196 r
= MsiRecordSetString(hrec
, 1, "hoo");
2198 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2199 ok( sz
== 3, "size wrong\n");
2200 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2201 ok( r
== ERROR_SUCCESS
, "format failed\n");
2203 r
= MsiRecordSetString(hrec
, 0, "x[~]x");
2205 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2206 ok( sz
== 3, "size wrong\n");
2207 ok( 0 == strcmp(buffer
,"x"), "wrong output %s\n",buffer
);
2208 ok( r
== ERROR_SUCCESS
, "format failed\n");
2210 r
= MsiRecordSetString(hrec
, 0, "[foo.$%}][1]");
2211 r
= MsiRecordSetString(hrec
, 1, "hoo");
2213 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2214 ok( sz
== 3, "size wrong\n");
2215 ok( 0 == strcmp(buffer
,"hoo"), "wrong output %s\n",buffer
);
2216 ok( r
== ERROR_SUCCESS
, "format failed\n");
2218 r
= MsiRecordSetString(hrec
, 0, "[\\[]");
2220 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2221 ok( sz
== 1, "size wrong\n");
2222 ok( 0 == strcmp(buffer
,"["), "wrong output %s\n",buffer
);
2223 ok( r
== ERROR_SUCCESS
, "format failed\n");
2225 SetEnvironmentVariable("FOO", "BAR");
2226 r
= MsiRecordSetString(hrec
, 0, "[%FOO]");
2228 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2229 ok( sz
== 3, "size wrong\n");
2230 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2231 ok( r
== ERROR_SUCCESS
, "format failed\n");
2233 r
= MsiRecordSetString(hrec
, 0, "[[1]]");
2234 r
= MsiRecordSetString(hrec
, 1, "%FOO");
2236 r
= MsiFormatRecord(hpkg
, hrec
, buffer
, &sz
);
2237 ok( sz
== 3, "size wrong\n");
2238 ok( 0 == strcmp(buffer
,"BAR"), "wrong output %s\n",buffer
);
2239 ok( r
== ERROR_SUCCESS
, "format failed\n");
2241 MsiCloseHandle( hrec
);
2242 MsiCloseHandle( hpkg
);
2243 DeleteFile(msifile
);
2246 static void test_states(void)
2251 INSTALLSTATE state
, action
;
2253 static const CHAR msifile2
[] = "winetest2.msi";
2254 static const CHAR msifile3
[] = "winetest3.msi";
2255 static const CHAR msifile4
[] = "winetest4.msi";
2257 hdb
= create_package_db();
2258 ok ( hdb
, "failed to create package database\n" );
2260 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
2261 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
2263 r
= create_property_table( hdb
);
2264 ok( r
== ERROR_SUCCESS
, "cannot create Property table: %d\n", r
);
2266 r
= add_property_entry( hdb
, "'ProductCode', '{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}'" );
2267 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2269 r
= add_property_entry( hdb
, "'ProductLanguage', '1033'" );
2270 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2272 r
= add_property_entry( hdb
, "'ProductName', 'MSITEST'" );
2273 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2275 r
= add_property_entry( hdb
, "'ProductVersion', '1.1.1'" );
2276 ok( r
== ERROR_SUCCESS
, "cannot add property entry: %d\n", r
);
2278 r
= create_install_execute_sequence_table( hdb
);
2279 ok( r
== ERROR_SUCCESS
, "cannot create InstallExecuteSequence table: %d\n", r
);
2281 r
= add_install_execute_sequence_entry( hdb
, "'CostInitialize', '', '800'" );
2282 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2284 r
= add_install_execute_sequence_entry( hdb
, "'FileCost', '', '900'" );
2285 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2287 r
= add_install_execute_sequence_entry( hdb
, "'CostFinalize', '', '1000'" );
2288 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2290 r
= add_install_execute_sequence_entry( hdb
, "'InstallValidate', '', '1400'" );
2291 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2293 r
= add_install_execute_sequence_entry( hdb
, "'InstallInitialize', '', '1500'" );
2294 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2296 r
= add_install_execute_sequence_entry( hdb
, "'ProcessComponents', '', '1600'" );
2297 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2299 r
= add_install_execute_sequence_entry( hdb
, "'UnpublishFeatures', '', '1800'" );
2300 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2302 r
= add_install_execute_sequence_entry( hdb
, "'RegisterProduct', '', '6100'" );
2303 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2305 r
= add_install_execute_sequence_entry( hdb
, "'PublishFeatures', '', '6300'" );
2306 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2308 r
= add_install_execute_sequence_entry( hdb
, "'PublishProduct', '', '6400'" );
2309 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2311 r
= add_install_execute_sequence_entry( hdb
, "'InstallFinalize', '', '6600'" );
2312 ok( r
== ERROR_SUCCESS
, "cannot add install execute sequence entry: %d\n", r
);
2314 r
= create_media_table( hdb
);
2315 ok( r
== ERROR_SUCCESS
, "cannot create media table: %d\n", r
);
2317 r
= add_media_entry( hdb
, "'1', '3', '', '', 'DISK1', ''");
2318 ok( r
== ERROR_SUCCESS
, "cannot add media entry: %d\n", r
);
2320 r
= create_feature_table( hdb
);
2321 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
2323 r
= create_component_table( hdb
);
2324 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
2326 /* msidbFeatureAttributesFavorLocal */
2327 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
2328 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2330 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2331 r
= add_component_entry( hdb
, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2332 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2334 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2335 r
= add_component_entry( hdb
, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2336 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2338 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2339 r
= add_component_entry( hdb
, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2340 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2342 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2343 r
= add_component_entry( hdb
, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2344 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2346 /* msidbFeatureAttributesFavorSource */
2347 r
= add_feature_entry( hdb
, "'two', '', '', '', 2, 1, '', 1" );
2348 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2350 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2351 r
= add_component_entry( hdb
, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2352 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2354 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2355 r
= add_component_entry( hdb
, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2356 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2358 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2359 r
= add_component_entry( hdb
, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2360 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2362 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2363 r
= add_component_entry( hdb
, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2364 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2366 /* msidbFeatureAttributesFavorSource */
2367 r
= add_feature_entry( hdb
, "'three', '', '', '', 2, 1, '', 1" );
2368 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2370 /* msidbFeatureAttributesFavorLocal */
2371 r
= add_feature_entry( hdb
, "'four', '', '', '', 2, 1, '', 0" );
2372 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2375 r
= add_feature_entry( hdb
, "'five', '', '', '', 2, 0, '', 1" );
2376 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2378 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2379 r
= add_component_entry( hdb
, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2380 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2382 /* no feature parent:msidbComponentAttributesLocalOnly */
2383 r
= add_component_entry( hdb
, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2384 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2386 /* msidbFeatureAttributesFavorLocal:removed */
2387 r
= add_feature_entry( hdb
, "'six', '', '', '', 2, 1, '', 0" );
2388 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2390 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2391 r
= add_component_entry( hdb
, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2392 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2394 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2395 r
= add_component_entry( hdb
, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2396 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2398 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2399 r
= add_component_entry( hdb
, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2400 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2402 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2403 r
= add_component_entry( hdb
, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2404 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2406 /* msidbFeatureAttributesFavorSource:removed */
2407 r
= add_feature_entry( hdb
, "'seven', '', '', '', 2, 1, '', 1" );
2408 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2410 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2411 r
= add_component_entry( hdb
, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2412 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2414 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2415 r
= add_component_entry( hdb
, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2416 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2418 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2419 r
= add_component_entry( hdb
, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2420 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2422 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2423 r
= add_component_entry( hdb
, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2424 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2426 /* msidbFeatureAttributesFavorLocal */
2427 r
= add_feature_entry( hdb
, "'eight', '', '', '', 2, 1, '', 0" );
2428 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2430 r
= add_component_entry( hdb
, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2431 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2433 /* msidbFeatureAttributesFavorSource */
2434 r
= add_feature_entry( hdb
, "'nine', '', '', '', 2, 1, '', 1" );
2435 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
2437 r
= add_component_entry( hdb
, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2438 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
2440 r
= create_feature_components_table( hdb
);
2441 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
2443 r
= add_feature_components_entry( hdb
, "'one', 'alpha'" );
2444 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2446 r
= add_feature_components_entry( hdb
, "'one', 'beta'" );
2447 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2449 r
= add_feature_components_entry( hdb
, "'one', 'gamma'" );
2450 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2452 r
= add_feature_components_entry( hdb
, "'one', 'theta'" );
2453 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2455 r
= add_feature_components_entry( hdb
, "'two', 'delta'" );
2456 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2458 r
= add_feature_components_entry( hdb
, "'two', 'epsilon'" );
2459 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2461 r
= add_feature_components_entry( hdb
, "'two', 'zeta'" );
2462 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2464 r
= add_feature_components_entry( hdb
, "'two', 'iota'" );
2465 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2467 r
= add_feature_components_entry( hdb
, "'three', 'eta'" );
2468 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2470 r
= add_feature_components_entry( hdb
, "'four', 'eta'" );
2471 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2473 r
= add_feature_components_entry( hdb
, "'five', 'eta'" );
2474 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2476 r
= add_feature_components_entry( hdb
, "'six', 'lambda'" );
2477 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2479 r
= add_feature_components_entry( hdb
, "'six', 'mu'" );
2480 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2482 r
= add_feature_components_entry( hdb
, "'six', 'nu'" );
2483 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2485 r
= add_feature_components_entry( hdb
, "'six', 'xi'" );
2486 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2488 r
= add_feature_components_entry( hdb
, "'seven', 'omicron'" );
2489 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2491 r
= add_feature_components_entry( hdb
, "'seven', 'pi'" );
2492 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2494 r
= add_feature_components_entry( hdb
, "'seven', 'rho'" );
2495 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2497 r
= add_feature_components_entry( hdb
, "'seven', 'sigma'" );
2498 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2500 r
= add_feature_components_entry( hdb
, "'eight', 'tau'" );
2501 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2503 r
= add_feature_components_entry( hdb
, "'nine', 'phi'" );
2504 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
2506 r
= create_file_table( hdb
);
2507 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
2509 r
= add_file_entry( hdb
, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2510 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2512 r
= add_file_entry( hdb
, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2513 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2515 r
= add_file_entry( hdb
, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2516 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2518 r
= add_file_entry( hdb
, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2519 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2521 r
= add_file_entry( hdb
, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2522 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2524 r
= add_file_entry( hdb
, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2525 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2527 r
= add_file_entry( hdb
, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2528 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2530 r
= add_file_entry( hdb
, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2531 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2533 /* compressed file */
2534 r
= add_file_entry( hdb
, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2535 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2537 r
= add_file_entry( hdb
, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2538 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2540 r
= add_file_entry( hdb
, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2541 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2543 r
= add_file_entry( hdb
, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2544 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2546 r
= add_file_entry( hdb
, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2547 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2549 r
= add_file_entry( hdb
, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2550 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2552 r
= add_file_entry( hdb
, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2553 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2555 r
= add_file_entry( hdb
, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2556 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2558 r
= add_file_entry( hdb
, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2559 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2561 r
= add_file_entry( hdb
, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2562 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2564 r
= add_file_entry( hdb
, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2565 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2567 r
= add_file_entry( hdb
, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2568 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
2570 MsiDatabaseCommit(hdb
);
2572 /* these properties must not be in the saved msi file */
2573 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
2574 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2576 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
2577 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2579 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
2580 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2582 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine'");
2583 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2585 r
= add_property_entry( hdb
, "'REINSTALLMODE', 'omus'");
2586 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
2588 hpkg
= package_from_db( hdb
);
2589 ok( hpkg
, "failed to create package\n");
2591 MsiCloseHandle(hdb
);
2593 CopyFileA(msifile
, msifile2
, FALSE
);
2594 CopyFileA(msifile
, msifile3
, FALSE
);
2595 CopyFileA(msifile
, msifile4
, FALSE
);
2599 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2600 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2601 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2602 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2606 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2607 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2608 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2609 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2613 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2614 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2615 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2616 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2620 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2621 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2622 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2623 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2627 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2628 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2629 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2630 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2634 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2635 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2636 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2637 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2641 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2642 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2643 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2644 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2648 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
2649 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2650 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2651 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2655 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
2656 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
2657 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2658 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2662 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2663 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2664 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2665 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2669 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2670 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2671 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2672 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2676 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2677 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2678 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2679 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2683 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2684 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2685 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2686 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2690 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2691 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2692 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2693 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2697 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2698 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2699 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2700 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2704 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2705 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2706 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2707 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2711 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2712 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2713 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2714 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2718 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2719 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2720 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2721 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2725 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2726 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2727 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2728 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2732 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2733 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2734 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2735 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2739 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2740 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2741 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2742 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2746 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2747 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2748 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2749 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2753 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2754 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2755 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2756 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2760 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
2761 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2762 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2763 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2767 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
2768 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2769 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2770 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2774 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
2775 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2776 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2777 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2781 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
2782 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2783 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2784 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2788 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
2789 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2790 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2791 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2795 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
2796 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
2797 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
2798 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
2800 r
= MsiDoAction( hpkg
, "CostInitialize");
2801 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
2805 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
2806 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2807 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2808 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2812 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
2813 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2814 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2815 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2819 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
2820 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2821 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2822 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2826 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
2827 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2828 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2829 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2833 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
2834 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2835 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2836 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2840 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
2841 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2842 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2843 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2847 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
2848 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2849 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2850 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2854 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
2855 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2856 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2857 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2861 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
2862 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2863 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2864 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2868 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
2869 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2870 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2871 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2875 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
2876 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2877 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2878 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2882 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
2883 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2884 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2885 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2889 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
2890 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2891 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2892 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2896 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
2897 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2898 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2899 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2903 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
2904 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2905 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2906 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2910 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
2911 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2912 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2913 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2917 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
2918 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2919 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2920 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2924 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
2925 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2926 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2927 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2931 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
2932 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2933 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2934 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2938 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
2939 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2940 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2941 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2945 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
2946 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2947 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2948 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2952 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
2953 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2954 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2955 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2959 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
2960 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2961 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2962 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2966 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
2967 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2968 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2969 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2973 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
2974 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2975 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2976 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2980 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
2981 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2982 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2983 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2987 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
2988 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2989 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2990 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2994 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
2995 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2996 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
2997 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3001 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3002 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3003 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3004 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3006 r
= MsiDoAction( hpkg
, "FileCost");
3007 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3011 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3012 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3013 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3014 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3018 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3019 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3020 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3021 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3025 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3026 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3027 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3028 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3032 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3033 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3034 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3035 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3039 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3040 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3041 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3042 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3046 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3047 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3048 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3049 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3053 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3054 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3055 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3056 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3060 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3061 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3062 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3063 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3067 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3068 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3069 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3070 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3074 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3075 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3076 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3077 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3081 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3082 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3083 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3084 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3088 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3089 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3090 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3091 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3095 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3096 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3097 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3098 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3102 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3103 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3104 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3105 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3109 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3110 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3111 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3112 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3116 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3117 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3118 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3119 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3123 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3124 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3125 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3126 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3130 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3131 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3132 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3133 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3137 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3138 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3139 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3140 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3144 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3145 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3146 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3147 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3151 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3152 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3153 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3154 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3158 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3159 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3160 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3161 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3165 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3166 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3167 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3168 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3172 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3173 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3174 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3175 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3179 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3180 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3181 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3182 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3186 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3187 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3188 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3189 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3193 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3194 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3195 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3196 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3200 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3201 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3202 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3203 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3207 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3208 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3209 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3210 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3212 r
= MsiDoAction( hpkg
, "CostFinalize");
3213 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
3217 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3218 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3219 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3220 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3224 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3225 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3226 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3227 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3231 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3232 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3233 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3234 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3238 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3239 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3240 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3241 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3245 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3246 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3247 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3248 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3252 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3253 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3254 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3255 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3259 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3260 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3261 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3262 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3266 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3267 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3268 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3269 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3273 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3274 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3275 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3276 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3280 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3281 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3282 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3283 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3287 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3288 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3289 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3290 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3294 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3295 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3296 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3297 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3301 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3302 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3303 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3304 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3308 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3309 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3310 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3311 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3315 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3316 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3317 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3318 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3322 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3323 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3324 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3325 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
3329 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3330 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3331 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3332 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3336 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3337 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3338 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3339 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
3343 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3344 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3345 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3346 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3350 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3351 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3352 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3353 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3357 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3358 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3359 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3360 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3364 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3365 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3366 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3367 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3371 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3372 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3373 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3374 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3378 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3379 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3380 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3381 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3385 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3386 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3387 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3388 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3392 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3393 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3394 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3395 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3399 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3400 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3401 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3402 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3406 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3407 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3408 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3409 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3413 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3414 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3415 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
3416 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3418 MsiCloseHandle( hpkg
);
3420 /* publish the features and components */
3421 r
= MsiInstallProduct(msifile
, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine");
3422 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3424 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
3425 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
3427 /* these properties must not be in the saved msi file */
3428 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,four'");
3429 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3431 r
= add_property_entry( hdb
, "'ADDSOURCE', 'two,three'");
3432 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3434 r
= add_property_entry( hdb
, "'REMOVE', 'six,seven'");
3435 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3437 r
= add_property_entry( hdb
, "'REINSTALL', 'eight,nine'");
3438 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
3440 hpkg
= package_from_db( hdb
);
3441 ok( hpkg
, "failed to create package\n");
3443 MsiCloseHandle(hdb
);
3447 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3448 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3449 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3450 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3454 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3455 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3456 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3457 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3461 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3462 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3463 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3464 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3468 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3469 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3470 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3471 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3475 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3476 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3477 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3478 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3482 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3483 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3484 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3485 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3489 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3490 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3491 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3492 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3496 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3497 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3498 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3499 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3503 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3504 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
3505 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3506 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3510 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3511 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3512 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3513 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3517 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3518 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3519 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3520 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3524 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3525 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3526 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3527 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3531 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3532 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3533 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3534 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3538 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3539 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3540 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3541 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3545 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3546 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3547 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3548 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3552 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3553 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3554 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3555 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3559 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3560 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3561 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3562 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3566 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3567 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3568 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3569 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3573 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3574 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3575 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3576 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3580 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3581 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3582 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3583 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3587 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3588 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3589 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3590 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3594 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3595 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3596 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3597 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3601 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3602 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3603 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3604 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3608 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3609 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3610 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3611 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3615 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3616 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3617 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3618 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3622 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3623 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3624 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3625 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3629 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3630 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3631 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3632 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3636 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3637 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3638 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3639 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3643 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3644 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3645 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
3646 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
3648 r
= MsiDoAction( hpkg
, "CostInitialize");
3649 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
3653 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3654 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3655 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3656 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3660 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3661 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3662 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3663 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3667 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3668 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3669 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3670 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3674 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3675 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3676 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3677 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3681 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3682 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3683 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3684 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3688 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3689 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3690 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3691 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3695 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3696 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3697 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3698 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3702 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3703 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3704 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3705 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3709 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3710 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3711 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3712 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3716 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3717 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3718 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3719 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3723 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3724 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3725 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3726 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3730 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3731 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3732 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3733 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3737 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3738 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3739 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3740 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3744 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3745 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3746 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3747 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3751 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3752 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3753 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3754 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3758 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3759 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3760 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3761 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3765 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3766 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3767 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3768 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3772 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3773 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3774 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3775 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3779 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3780 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3781 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3782 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3786 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3787 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3788 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3789 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3793 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
3794 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3795 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3796 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3800 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
3801 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3802 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3803 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3807 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
3808 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3809 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3810 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3814 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
3815 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3816 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3817 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3821 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
3822 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3823 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3824 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3828 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
3829 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3830 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3831 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3835 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
3836 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3837 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3838 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3842 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
3843 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3844 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3845 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3849 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
3850 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3851 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3852 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3854 r
= MsiDoAction( hpkg
, "FileCost");
3855 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
3859 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
3860 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3861 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3862 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3866 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
3867 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3868 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3869 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3873 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
3874 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3875 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3876 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3880 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
3881 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3882 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3883 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3887 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
3888 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3889 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3890 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3894 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
3895 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3896 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3897 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3901 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
3902 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3903 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3904 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3908 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
3909 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3910 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3911 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3915 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
3916 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3917 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3918 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3922 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
3923 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3924 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3925 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3929 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
3930 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3931 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3932 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3936 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
3937 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3938 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3939 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3943 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
3944 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3945 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3946 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3950 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
3951 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3952 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3953 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3957 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
3958 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3959 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3960 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3964 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
3965 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3966 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3967 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3971 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
3972 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3973 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3974 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3978 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
3979 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3980 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3981 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3985 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
3986 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3987 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3988 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3992 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
3993 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3994 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3995 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
3999 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4000 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4001 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4002 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4006 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4007 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4008 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4009 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4013 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4014 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4015 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4016 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4020 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4021 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4022 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4023 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4027 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4028 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4029 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4030 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4034 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4035 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4036 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4037 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4041 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4042 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4043 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4044 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4048 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4049 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4050 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4051 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4055 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4056 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4057 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4058 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4060 r
= MsiDoAction( hpkg
, "CostFinalize");
4061 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4065 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4066 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4067 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4068 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4072 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4073 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4074 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4075 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4079 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4080 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4081 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4082 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4086 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4087 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4088 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4089 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4093 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4094 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4095 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4096 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4100 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4101 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4102 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4103 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4107 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4108 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4109 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4110 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4114 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4115 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4116 todo_wine
ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4117 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4121 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4122 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4123 todo_wine
ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4124 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4128 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4129 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4130 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4131 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4135 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4136 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4137 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4138 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4142 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4143 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4144 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4145 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4149 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4150 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4151 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4152 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4156 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4157 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4158 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4159 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4163 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4164 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4165 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4166 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4170 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4171 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4172 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4173 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4177 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4178 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4179 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4180 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4184 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4185 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4186 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4187 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4191 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4192 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4193 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4194 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4198 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4199 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4200 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4201 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4205 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4206 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4207 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4208 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4212 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4213 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4214 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4215 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4219 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4220 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4221 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4222 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4226 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4227 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4228 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4229 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4233 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4234 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4235 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4236 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4240 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4241 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4242 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4243 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4247 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4248 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4249 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4250 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4254 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4255 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4256 todo_wine
ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4257 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4261 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4262 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4263 todo_wine
ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4264 todo_wine
ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4266 MsiCloseHandle(hpkg
);
4268 /* uninstall the product */
4269 r
= MsiInstallProduct(msifile
, "REMOVE=ALL");
4270 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4272 /* all features installed locally */
4273 r
= MsiInstallProduct(msifile2
, "ADDLOCAL=ALL");
4274 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4276 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_DIRECT
, &hdb
);
4277 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
4279 /* these properties must not be in the saved msi file */
4280 r
= add_property_entry( hdb
, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine'");
4281 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
4283 hpkg
= package_from_db( hdb
);
4284 ok( hpkg
, "failed to create package\n");
4288 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4289 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4290 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4291 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4295 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4296 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4297 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4298 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4302 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4303 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4304 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4305 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4309 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4310 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4311 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4312 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4316 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4317 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4318 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4319 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4323 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4324 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4325 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4326 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4330 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4331 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4332 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4333 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4337 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4338 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4339 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4340 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4344 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4345 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
4346 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4347 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4351 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4352 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4353 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4354 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4358 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4359 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4360 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4361 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4365 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4366 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4367 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4368 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4372 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4373 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4374 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4375 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4379 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4380 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4381 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4382 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4386 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4387 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4388 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4389 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4393 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4394 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4395 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4396 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4400 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4401 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4402 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4403 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4407 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4408 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4409 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4410 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4414 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4415 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4416 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4417 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4421 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4422 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4423 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4424 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4428 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4429 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4430 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4431 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4435 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4436 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4437 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4438 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4442 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4443 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4444 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4445 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4449 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4450 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4451 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4452 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4456 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4457 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4458 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4459 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4463 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4464 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4465 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4466 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4470 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4471 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4472 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4473 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4477 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4478 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4479 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4480 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4484 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4485 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4486 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
4487 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
4489 r
= MsiDoAction( hpkg
, "CostInitialize");
4490 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
4494 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4495 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4496 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4497 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4501 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4502 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4503 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4504 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4508 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4509 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4510 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4511 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4515 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4516 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4517 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4518 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4522 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4523 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4524 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4525 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4529 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4530 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4531 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4532 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4536 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4537 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4538 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4539 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4543 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4544 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4545 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4546 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4550 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4551 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4552 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4553 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4557 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4558 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4559 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4560 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4564 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4565 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4566 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4567 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4571 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4572 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4573 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4574 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4578 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4579 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4580 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4581 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4585 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4586 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4587 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4588 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4592 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4593 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4594 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4595 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4599 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4600 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4601 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4602 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4606 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4607 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4608 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4609 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4613 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4614 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4615 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4616 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4620 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4621 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4622 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4623 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4627 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4628 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4629 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4630 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4634 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4635 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4636 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4637 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4641 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4642 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4643 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4644 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4648 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4649 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4650 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4651 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4655 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4656 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4657 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4658 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4662 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4663 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4664 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4665 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4669 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4670 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4671 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4672 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4676 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4677 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4678 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4679 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4683 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4684 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4685 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4686 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4690 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4691 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4692 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4693 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4695 r
= MsiDoAction( hpkg
, "FileCost");
4696 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
4700 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4701 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4702 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4703 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4707 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4708 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4709 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4710 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4714 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4715 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4716 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4717 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4721 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4722 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4723 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4724 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4728 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4729 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4730 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4731 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4735 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4736 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4737 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4738 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4742 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4743 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4744 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4745 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4749 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4750 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4751 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4752 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4756 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4757 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4758 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4759 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4763 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4764 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4765 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4766 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4770 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4771 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4772 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4773 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4777 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4778 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4779 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4780 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4784 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4785 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4786 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4787 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4791 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4792 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4793 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4794 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4798 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
4799 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4800 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4801 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4805 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
4806 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4807 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4808 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4812 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
4813 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4814 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4815 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4819 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
4820 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4821 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4822 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4826 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
4827 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4828 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4829 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4833 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
4834 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4835 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4836 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4840 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
4841 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4842 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4843 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4847 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
4848 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4849 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4850 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4854 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
4855 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4856 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4857 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4861 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
4862 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4863 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4864 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4868 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
4869 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4870 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4871 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4875 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
4876 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4877 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4878 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4882 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
4883 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4884 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4885 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4889 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
4890 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4891 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4892 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4896 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
4897 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4898 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4899 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4901 r
= MsiDoAction( hpkg
, "CostFinalize");
4902 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
4906 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
4907 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4908 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4909 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4913 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
4914 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4915 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4916 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4920 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
4921 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4922 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4923 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4927 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
4928 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4929 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4930 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4934 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
4935 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4936 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
4937 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
4941 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
4942 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4943 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4944 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4948 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
4949 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4950 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4951 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4955 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
4956 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4957 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4958 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4962 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
4963 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4964 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4965 todo_wine
ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
4969 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
4970 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4971 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4972 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4976 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
4977 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4978 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4979 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
4983 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
4984 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4985 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4986 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4990 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
4991 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4992 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4993 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
4997 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
4998 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4999 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5000 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5004 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5005 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5006 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5007 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5011 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5012 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5013 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5014 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5018 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5019 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5020 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5021 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5025 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5026 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5027 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5028 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5032 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5033 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5034 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5035 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5039 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5040 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5041 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5042 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5046 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5047 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5048 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5049 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5053 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5054 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5055 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5056 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5060 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5061 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5062 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5063 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5067 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5068 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5069 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5070 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5074 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5075 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5076 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5077 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
5081 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5082 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5083 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5084 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5088 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5089 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5090 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5091 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5095 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5096 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5097 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5098 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5102 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5103 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5104 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5105 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5107 MsiCloseHandle(hpkg
);
5109 /* uninstall the product */
5110 r
= MsiInstallProduct(msifile2
, "REMOVE=ALL");
5111 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5113 /* all features installed from source */
5114 r
= MsiInstallProduct(msifile3
, "ADDSOURCE=ALL");
5115 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5117 r
= MsiOpenDatabase(msifile3
, MSIDBOPEN_DIRECT
, &hdb
);
5118 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
5120 /* this property must not be in the saved msi file */
5121 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine'");
5122 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
5124 hpkg
= package_from_db( hdb
);
5125 ok( hpkg
, "failed to create package\n");
5129 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5130 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5131 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5132 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5136 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5137 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5138 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5139 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5143 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5144 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5145 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5146 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5150 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5151 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5152 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5153 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5157 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5158 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5159 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5160 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5164 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5165 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5166 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5167 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5171 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5172 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5173 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5174 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5178 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5179 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5180 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5181 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5185 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5186 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5187 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5188 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5192 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5193 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5194 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5195 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5199 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5200 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5201 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5202 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5206 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5207 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5208 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5209 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5213 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5214 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5215 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5216 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5220 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5221 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5222 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5223 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5227 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5228 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5229 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5230 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5234 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5235 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5236 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5237 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5241 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5242 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5243 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5244 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5248 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5249 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5250 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5251 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5255 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5256 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5257 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5258 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5262 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5263 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5264 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5265 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5269 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5270 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5271 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5272 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5276 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5277 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5278 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5279 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5283 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5284 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5285 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5286 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5290 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5291 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5292 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5293 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5297 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5298 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5299 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5300 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5304 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5305 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5306 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5307 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5311 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5312 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5313 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5314 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5318 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5319 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5320 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5321 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5325 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5326 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
5327 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5328 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5330 r
= MsiDoAction( hpkg
, "CostInitialize");
5331 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
5335 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5336 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5337 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5338 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5342 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5343 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5344 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5345 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5349 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5350 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5351 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5352 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5356 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5357 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5358 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5359 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5363 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5364 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5365 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5366 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5370 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5371 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5372 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5373 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5377 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5378 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5379 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5380 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5384 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5385 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5386 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5387 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5391 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5392 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5393 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5394 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5398 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5399 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5400 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5401 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5405 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5406 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5407 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5408 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5412 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5413 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5414 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5415 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5419 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5420 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5421 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5422 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5426 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5427 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5428 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5429 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5433 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5434 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5435 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5436 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5440 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5441 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5442 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5443 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5447 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5448 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5449 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5450 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5454 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5455 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5456 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5457 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5461 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5462 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5463 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5464 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5468 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5469 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5470 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5471 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5475 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5476 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5477 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5478 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5482 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5483 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5484 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5485 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5489 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5490 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5491 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5492 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5496 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5497 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5498 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5499 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5503 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5504 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5505 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5506 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5510 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5511 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5512 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5513 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5517 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5518 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5519 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5520 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5524 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5525 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5526 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5527 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5531 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5532 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5533 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5534 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5536 r
= MsiDoAction( hpkg
, "FileCost");
5537 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
5541 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5542 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5543 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5544 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5548 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5549 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5550 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5551 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5555 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5556 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5557 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5558 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5562 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5563 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5564 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5565 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5569 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5570 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5571 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5572 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5576 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5577 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5578 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5579 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5583 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5584 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5585 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5586 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5590 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5591 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5592 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5593 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5597 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5598 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5599 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5600 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5604 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5605 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5606 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5607 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5611 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5612 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5613 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5614 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5618 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5619 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5620 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5621 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5625 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5626 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5627 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5628 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5632 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5633 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5634 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5635 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5639 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5640 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5641 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5642 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5646 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5647 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5648 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5649 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5653 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5654 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5655 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5656 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5660 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5661 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5662 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5663 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5667 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5668 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5669 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5670 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5674 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5675 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5676 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5677 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5681 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5682 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5683 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5684 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5688 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5689 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5690 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5691 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5695 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5696 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5697 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5698 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5702 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5703 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5704 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5705 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5709 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5710 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5711 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5712 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5716 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5717 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5718 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5719 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5723 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5724 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5725 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5726 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5730 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5731 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5732 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5733 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5737 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5738 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5739 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
5740 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5742 r
= MsiDoAction( hpkg
, "CostFinalize");
5743 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
5747 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5748 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5749 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5750 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5754 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5755 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5756 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5757 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5761 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5762 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5763 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5764 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5768 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5769 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5770 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5771 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5775 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5776 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5777 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5778 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5782 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
5783 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5784 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5785 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5789 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
5790 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5791 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5792 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5796 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
5797 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5798 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5799 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5803 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
5804 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5805 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5806 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5810 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
5811 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5812 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5813 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5817 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
5818 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5819 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5820 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5824 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
5825 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5826 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5827 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5831 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
5832 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5833 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5834 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5838 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
5839 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5840 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5841 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5845 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
5846 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5847 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5848 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5852 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
5853 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5854 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5855 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5859 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
5860 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5861 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5862 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5866 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
5867 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5868 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5869 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
5873 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
5874 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5875 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
5876 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5880 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
5881 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5882 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5883 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5887 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
5888 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5889 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5890 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5894 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
5895 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5896 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5897 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5901 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
5902 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5903 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5904 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5908 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
5909 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5910 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5911 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5915 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
5916 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5917 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5918 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5922 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
5923 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5924 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5925 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
5929 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
5930 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5931 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5932 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
5936 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
5937 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5938 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5939 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5943 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
5944 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5945 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5946 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
5948 MsiCloseHandle(hpkg
);
5950 /* reinstall the product */
5951 r
= MsiInstallProduct(msifile3
, "REINSTALL=ALL");
5952 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
5954 r
= MsiOpenDatabase(msifile4
, MSIDBOPEN_DIRECT
, &hdb
);
5955 ok(r
== ERROR_SUCCESS
, "failed to open database: %d\n", r
);
5957 /* this property must not be in the saved msi file */
5958 r
= add_property_entry( hdb
, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine'");
5959 ok( r
== ERROR_SUCCESS
, "cannot add property: %d\n", r
);
5961 hpkg
= package_from_db( hdb
);
5962 ok( hpkg
, "failed to create package\n");
5966 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
5967 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5968 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5969 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5973 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
5974 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5975 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5976 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5980 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
5981 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5982 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5983 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5987 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
5988 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5989 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5990 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
5994 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
5995 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
5996 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
5997 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6001 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6002 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6003 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6004 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6008 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6009 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6010 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6011 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6015 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6016 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6017 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6018 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6022 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6023 ok( r
== ERROR_UNKNOWN_FEATURE
, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r
);
6024 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6025 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6029 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6030 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6031 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6032 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6036 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6037 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6038 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6039 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6043 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6044 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6045 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6046 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6050 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6051 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6052 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6053 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6057 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6058 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6059 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6060 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6064 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6065 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6066 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6067 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6071 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6072 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6073 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6074 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6078 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6079 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6080 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6081 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6085 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6086 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6087 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6088 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6092 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6093 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6094 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6095 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6099 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6100 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6101 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6102 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6106 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6107 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6108 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6109 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6113 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6114 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6115 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6116 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6120 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6121 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6122 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6123 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6127 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6128 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6129 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6130 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6134 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6135 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6136 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6137 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6141 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6142 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6143 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6144 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6148 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6149 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6150 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6151 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6155 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6156 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6157 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6158 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6162 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6163 ok( r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
6164 ok( state
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", state
);
6165 ok( action
== 0xdeadbee, "Expected 0xdeadbee, got %d\n", action
);
6167 r
= MsiDoAction( hpkg
, "CostInitialize");
6168 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
6172 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6173 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6174 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6175 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6179 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6180 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6181 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6182 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6186 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6187 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6188 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6189 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6193 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6194 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6195 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6196 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6200 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6201 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6202 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6203 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6207 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6208 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6209 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6210 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6214 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6215 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6216 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6217 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6221 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6222 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6223 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6224 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6228 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6229 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6230 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6231 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6235 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6236 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6237 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6238 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6242 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6243 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6244 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6245 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6249 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6250 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6251 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6252 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6256 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6257 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6258 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6259 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6263 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6264 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6265 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6266 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6270 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6271 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6272 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6273 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6277 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6278 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6279 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6280 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6284 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6285 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6286 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6287 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6291 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6292 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6293 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6294 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6298 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6299 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6300 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6301 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6305 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6306 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6307 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6308 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6312 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6313 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6314 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6315 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6319 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6320 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6321 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6322 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6326 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6327 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6328 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6329 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6333 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6334 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6335 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6336 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6340 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6341 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6342 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6343 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6347 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6348 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6349 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6350 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6354 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6355 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6356 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6357 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6361 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6362 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6363 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6364 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6368 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6369 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6370 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6371 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6373 r
= MsiDoAction( hpkg
, "FileCost");
6374 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
6378 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6379 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6380 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6381 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6385 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6386 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6387 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6388 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6392 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6393 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6394 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6395 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6399 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6400 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6401 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6402 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6406 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6407 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6408 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6409 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6413 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6414 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6415 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6416 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6420 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6421 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6422 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6423 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6427 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6428 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6429 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6430 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6434 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6435 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6436 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6437 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6441 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6442 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6443 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6444 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6448 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6449 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6450 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6451 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6455 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6456 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6457 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6458 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6462 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6463 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6464 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6465 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6469 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6470 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6471 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6472 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6476 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6477 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6478 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6479 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6483 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6484 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6485 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6486 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6490 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6491 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6492 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6493 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6497 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6498 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6499 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6500 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6504 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6505 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6506 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6507 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6511 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6512 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6513 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6514 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6518 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6519 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6520 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6521 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6525 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6526 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6527 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6528 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6532 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6533 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6534 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6535 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6539 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6540 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6541 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6542 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6546 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6547 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6548 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6549 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6553 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6554 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6555 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6556 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6560 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6561 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6562 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6563 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6567 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6568 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6569 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6570 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6574 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6575 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6576 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
6577 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6579 r
= MsiDoAction( hpkg
, "CostFinalize");
6580 ok( r
== ERROR_SUCCESS
, "cost finalize failed: %d\n", r
);
6584 r
= MsiGetFeatureState(hpkg
, "one", &state
, &action
);
6585 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6586 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6587 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6591 r
= MsiGetFeatureState(hpkg
, "two", &state
, &action
);
6592 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6593 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6594 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6598 r
= MsiGetFeatureState(hpkg
, "three", &state
, &action
);
6599 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6600 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6601 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6605 r
= MsiGetFeatureState(hpkg
, "four", &state
, &action
);
6606 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6607 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6608 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6612 r
= MsiGetFeatureState(hpkg
, "five", &state
, &action
);
6613 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6614 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6615 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6619 r
= MsiGetFeatureState(hpkg
, "six", &state
, &action
);
6620 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6621 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6622 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6626 r
= MsiGetFeatureState(hpkg
, "seven", &state
, &action
);
6627 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6628 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6629 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6633 r
= MsiGetFeatureState(hpkg
, "eight", &state
, &action
);
6634 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6635 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6636 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6640 r
= MsiGetFeatureState(hpkg
, "nine", &state
, &action
);
6641 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6642 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6643 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
6647 r
= MsiGetComponentState(hpkg
, "alpha", &state
, &action
);
6648 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6649 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6650 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6654 r
= MsiGetComponentState(hpkg
, "beta", &state
, &action
);
6655 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6656 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6657 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6661 r
= MsiGetComponentState(hpkg
, "gamma", &state
, &action
);
6662 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6663 todo_wine
ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6664 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6668 r
= MsiGetComponentState(hpkg
, "theta", &state
, &action
);
6669 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6670 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6671 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6675 r
= MsiGetComponentState(hpkg
, "delta", &state
, &action
);
6676 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6677 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6678 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6682 r
= MsiGetComponentState(hpkg
, "epsilon", &state
, &action
);
6683 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6684 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6685 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6689 r
= MsiGetComponentState(hpkg
, "zeta", &state
, &action
);
6690 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6691 todo_wine
ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6692 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6696 r
= MsiGetComponentState(hpkg
, "iota", &state
, &action
);
6697 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6698 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6699 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6703 r
= MsiGetComponentState(hpkg
, "eta", &state
, &action
);
6704 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6705 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6706 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
6710 r
= MsiGetComponentState(hpkg
, "kappa", &state
, &action
);
6711 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6712 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
6713 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6717 r
= MsiGetComponentState(hpkg
, "lambda", &state
, &action
);
6718 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6719 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6720 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6724 r
= MsiGetComponentState(hpkg
, "mu", &state
, &action
);
6725 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6726 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6727 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6731 r
= MsiGetComponentState(hpkg
, "nu", &state
, &action
);
6732 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6733 todo_wine
ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6734 todo_wine
ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6738 r
= MsiGetComponentState(hpkg
, "xi", &state
, &action
);
6739 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6740 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6741 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6745 r
= MsiGetComponentState(hpkg
, "omicron", &state
, &action
);
6746 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6747 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6748 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6752 r
= MsiGetComponentState(hpkg
, "pi", &state
, &action
);
6753 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6754 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6755 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
6759 r
= MsiGetComponentState(hpkg
, "rho", &state
, &action
);
6760 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6761 todo_wine
ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6762 todo_wine
ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6766 r
= MsiGetComponentState(hpkg
, "sigma", &state
, &action
);
6767 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6768 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6769 ok( state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
6773 r
= MsiGetComponentState(hpkg
, "tau", &state
, &action
);
6774 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6775 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6776 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6780 r
= MsiGetComponentState(hpkg
, "phi", &state
, &action
);
6781 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6782 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6783 ok( state
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", state
);
6785 MsiCloseHandle(hpkg
);
6787 /* uninstall the product */
6788 r
= MsiInstallProduct(msifile4
, "REMOVE=ALL");
6789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6791 DeleteFileA(msifile
);
6792 DeleteFileA(msifile2
);
6793 DeleteFileA(msifile3
);
6794 DeleteFileA(msifile4
);
6797 static void test_getproperty(void)
6799 MSIHANDLE hPackage
= 0;
6801 static CHAR empty
[] = "";
6805 hPackage
= package_from_db(create_package_db());
6806 ok( hPackage
!= 0, " Failed to create package\n");
6808 /* set the property */
6809 r
= MsiSetProperty(hPackage
, "Name", "Value");
6810 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6812 /* retrieve the size, NULL pointer */
6814 r
= MsiGetProperty(hPackage
, "Name", NULL
, &size
);
6815 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6816 ok( size
== 5, "Expected 5, got %d\n", size
);
6818 /* retrieve the size, empty string */
6820 r
= MsiGetProperty(hPackage
, "Name", empty
, &size
);
6821 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
6822 ok( size
== 5, "Expected 5, got %d\n", size
);
6824 /* don't change size */
6825 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
6826 ok( r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
6827 ok( size
== 5, "Expected 5, got %d\n", size
);
6828 ok( !lstrcmp(prop
, "Valu"), "Expected Valu, got %s\n", prop
);
6830 /* increase the size by 1 */
6832 r
= MsiGetProperty(hPackage
, "Name", prop
, &size
);
6833 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6834 ok( size
== 5, "Expected 5, got %d\n", size
);
6835 ok( !lstrcmp(prop
, "Value"), "Expected Value, got %s\n", prop
);
6837 r
= MsiCloseHandle( hPackage
);
6838 ok( r
== ERROR_SUCCESS
, "Failed to close package\n" );
6839 DeleteFile(msifile
);
6842 static void test_removefiles(void)
6848 hdb
= create_package_db();
6849 ok ( hdb
, "failed to create package database\n" );
6851 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
6852 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
6854 r
= create_feature_table( hdb
);
6855 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
6857 r
= create_component_table( hdb
);
6858 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
6860 r
= add_feature_entry( hdb
, "'one', '', '', '', 2, 1, '', 0" );
6861 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
6863 r
= add_component_entry( hdb
, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
6864 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
6866 r
= add_component_entry( hdb
, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
6867 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
6869 r
= add_component_entry( hdb
, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
6870 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
6872 r
= add_component_entry( hdb
, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
6873 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
6875 r
= add_component_entry( hdb
, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
6876 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
6878 r
= add_component_entry( hdb
, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
6879 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
6881 r
= create_feature_components_table( hdb
);
6882 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
6884 r
= add_feature_components_entry( hdb
, "'one', 'hydrogen'" );
6885 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
6887 r
= add_feature_components_entry( hdb
, "'one', 'helium'" );
6888 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
6890 r
= add_feature_components_entry( hdb
, "'one', 'lithium'" );
6891 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
6893 r
= add_feature_components_entry( hdb
, "'one', 'beryllium'" );
6894 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
6896 r
= add_feature_components_entry( hdb
, "'one', 'boron'" );
6897 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
6899 r
= add_feature_components_entry( hdb
, "'one', 'carbon'" );
6900 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
6902 r
= create_file_table( hdb
);
6903 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
6905 r
= add_file_entry( hdb
, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
6906 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
6908 r
= add_file_entry( hdb
, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
6909 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
6911 r
= add_file_entry( hdb
, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
6912 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
6914 r
= add_file_entry( hdb
, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
6915 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
6917 r
= add_file_entry( hdb
, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
6918 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
6920 r
= add_file_entry( hdb
, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
6921 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
6923 r
= create_remove_file_table( hdb
);
6924 ok( r
== ERROR_SUCCESS
, "cannot create Remove File table: %d\n", r
);
6926 hpkg
= package_from_db( hdb
);
6927 ok( hpkg
, "failed to create package\n");
6929 MsiCloseHandle( hdb
);
6931 create_test_file( "hydrogen.txt" );
6932 create_test_file( "helium.txt" );
6933 create_test_file( "lithium.txt" );
6934 create_test_file( "beryllium.txt" );
6935 create_test_file( "boron.txt" );
6936 create_test_file( "carbon.txt" );
6938 r
= MsiSetProperty( hpkg
, "TARGETDIR", CURR_DIR
);
6939 ok( r
== ERROR_SUCCESS
, "set property failed\n");
6941 r
= MsiDoAction( hpkg
, "CostInitialize");
6942 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
6944 r
= MsiDoAction( hpkg
, "FileCost");
6945 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
6947 r
= MsiDoAction( hpkg
, "CostFinalize");
6948 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
6950 r
= MsiDoAction( hpkg
, "InstallValidate");
6951 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
6953 r
= MsiSetComponentState( hpkg
, "hydrogen", INSTALLSTATE_ABSENT
);
6954 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
6956 r
= MsiSetComponentState( hpkg
, "helium", INSTALLSTATE_LOCAL
);
6957 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
6959 r
= MsiSetComponentState( hpkg
, "lithium", INSTALLSTATE_SOURCE
);
6960 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
6962 r
= MsiSetComponentState( hpkg
, "beryllium", INSTALLSTATE_ABSENT
);
6963 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
6965 r
= MsiSetComponentState( hpkg
, "boron", INSTALLSTATE_LOCAL
);
6966 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
6968 r
= MsiSetComponentState( hpkg
, "carbon", INSTALLSTATE_SOURCE
);
6969 ok( r
== ERROR_SUCCESS
, "failed to set component state: %d\n", r
);
6971 r
= MsiDoAction( hpkg
, "RemoveFiles");
6972 ok( r
== ERROR_SUCCESS
, "remove files failed\n");
6974 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
6975 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
6976 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
6977 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
6978 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
6979 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
6981 MsiCloseHandle( hpkg
);
6982 DeleteFileA(msifile
);
6985 static void test_appsearch(void)
6990 CHAR prop
[MAX_PATH
];
6991 DWORD size
= MAX_PATH
;
6993 hdb
= create_package_db();
6994 ok ( hdb
, "failed to create package database\n" );
6996 r
= create_appsearch_table( hdb
);
6997 ok( r
== ERROR_SUCCESS
, "cannot create AppSearch table: %d\n", r
);
6999 r
= add_appsearch_entry( hdb
, "'WEBBROWSERPROG', 'NewSignature1'" );
7000 ok( r
== ERROR_SUCCESS
, "cannot add entry: %d\n", r
);
7002 r
= create_reglocator_table( hdb
);
7003 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7005 r
= add_reglocator_entry( hdb
, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" );
7006 ok( r
== ERROR_SUCCESS
, "cannot create RegLocator table: %d\n", r
);
7008 r
= create_signature_table( hdb
);
7009 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
7011 r
= add_signature_entry( hdb
, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7012 ok( r
== ERROR_SUCCESS
, "cannot create Signature table: %d\n", r
);
7014 hpkg
= package_from_db( hdb
);
7015 ok( hpkg
, "failed to create package\n");
7017 MsiCloseHandle( hdb
);
7019 r
= MsiDoAction( hpkg
, "AppSearch" );
7020 ok( r
== ERROR_SUCCESS
, "AppSearch failed: %d\n", r
);
7022 r
= MsiGetPropertyA( hpkg
, "WEBBROWSERPROG", prop
, &size
);
7023 ok( r
== ERROR_SUCCESS
, "get property failed: %d\n", r
);
7026 ok( lstrlenA(prop
) != 0, "Expected non-zero length\n");
7029 MsiCloseHandle( hpkg
);
7030 DeleteFileA(msifile
);
7033 static void test_appsearch_complocator(void)
7035 MSIHANDLE hpkg
, hdb
;
7036 CHAR path
[MAX_PATH
];
7037 CHAR prop
[MAX_PATH
];
7042 get_user_sid(&usersid
);
7045 skip("ConvertSidToStringSidA is not available\n");
7049 create_test_file("FileName1");
7050 create_test_file("FileName4");
7051 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE
,
7052 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL
, FALSE
);
7054 create_test_file("FileName2");
7055 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED
,
7056 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid
, FALSE
);
7058 create_test_file("FileName3");
7059 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED
,
7060 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid
, FALSE
);
7062 create_test_file("FileName5");
7063 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE
,
7064 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL
, TRUE
);
7066 create_test_file("FileName6");
7067 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE
,
7068 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL
, TRUE
);
7070 create_test_file("FileName7");
7071 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE
,
7072 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL
, FALSE
);
7074 /* dir is FALSE, but we're pretending it's a directory */
7075 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE
,
7076 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL
, FALSE
);
7078 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7079 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE
,
7080 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL
, FALSE
);
7082 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7083 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE
,
7084 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL
, FALSE
);
7086 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7087 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE
,
7088 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL
, FALSE
);
7090 hdb
= create_package_db();
7091 ok(hdb
, "Expected a valid database handle\n");
7093 r
= create_appsearch_table(hdb
);
7094 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7096 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
7097 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7099 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
7100 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7102 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
7103 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7105 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
7106 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7108 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
7109 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7111 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
7112 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7114 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
7115 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7117 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
7118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7120 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
7121 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7123 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
7124 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7126 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
7127 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7129 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
7130 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7132 r
= create_complocator_table(hdb
);
7133 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7135 /* published component, machine, file, signature, misdbLocatorTypeFile */
7136 r
= add_complocator_entry(hdb
, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
7137 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7139 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
7140 r
= add_complocator_entry(hdb
, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
7141 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7143 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
7144 r
= add_complocator_entry(hdb
, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
7145 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7147 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
7148 r
= add_complocator_entry(hdb
, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
7149 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7151 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
7152 r
= add_complocator_entry(hdb
, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
7153 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7155 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
7156 r
= add_complocator_entry(hdb
, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
7157 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7159 /* published component, machine, file, no signature, misdbLocatorTypeFile */
7160 r
= add_complocator_entry(hdb
, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
7161 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7163 /* unpublished component, no signature, misdbLocatorTypeDir */
7164 r
= add_complocator_entry(hdb
, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
7165 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7167 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
7168 r
= add_complocator_entry(hdb
, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
7169 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7171 /* published component, signature w/ ver, misdbLocatorTypeFile */
7172 r
= add_complocator_entry(hdb
, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
7173 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7175 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
7176 r
= add_complocator_entry(hdb
, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
7177 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7179 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
7180 r
= add_complocator_entry(hdb
, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
7181 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7183 r
= create_signature_table(hdb
);
7184 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7186 r
= add_signature_entry(hdb
, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
7187 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7189 r
= add_signature_entry(hdb
, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
7190 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7192 r
= add_signature_entry(hdb
, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
7193 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7195 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
7196 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7198 r
= add_signature_entry(hdb
, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
7199 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7201 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7202 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7204 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7205 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7207 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
7208 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7210 hpkg
= package_from_db(hdb
);
7211 ok(hpkg
, "Expected a valid package handle\n");
7213 r
= MsiSetPropertyA(hpkg
, "SIGPROP8", "october");
7214 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7216 r
= MsiDoAction(hpkg
, "AppSearch");
7217 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7220 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7221 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
7222 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7223 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7226 sprintf(path
, "%s\\FileName2", CURR_DIR
);
7227 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
7228 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7229 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7232 sprintf(path
, "%s\\FileName3", CURR_DIR
);
7233 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
7234 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7235 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7238 sprintf(path
, "%s\\FileName4", CURR_DIR
);
7239 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
7240 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7241 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7244 sprintf(path
, "%s\\FileName5", CURR_DIR
);
7245 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
7246 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7247 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7250 sprintf(path
, "%s\\", CURR_DIR
);
7251 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
7252 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7253 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7256 sprintf(path
, "%s\\", CURR_DIR
);
7257 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
7258 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7259 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7262 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
7263 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7264 ok(!lstrcmpA(prop
, "october"), "Expected \"october\", got \"%s\"\n", prop
);
7267 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
7268 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7269 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7272 sprintf(path
, "%s\\FileName8.dll", CURR_DIR
);
7273 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
7274 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7275 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7278 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
7279 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7280 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7283 sprintf(path
, "%s\\FileName10.dll", CURR_DIR
);
7284 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
7285 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7286 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7288 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
7289 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7290 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
7291 MSIINSTALLCONTEXT_USERUNMANAGED
, usersid
);
7292 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
7293 MSIINSTALLCONTEXT_USERMANAGED
, usersid
);
7294 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
7295 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7296 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
7297 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7298 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
7299 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7300 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
7301 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7302 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
7303 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7304 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
7305 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7306 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
7307 MSIINSTALLCONTEXT_MACHINE
, NULL
);
7309 DeleteFileA("FileName1");
7310 DeleteFileA("FileName2");
7311 DeleteFileA("FileName3");
7312 DeleteFileA("FileName4");
7313 DeleteFileA("FileName5");
7314 DeleteFileA("FileName6");
7315 DeleteFileA("FileName7");
7316 DeleteFileA("FileName8.dll");
7317 DeleteFileA("FileName9.dll");
7318 DeleteFileA("FileName10.dll");
7319 MsiCloseHandle(hpkg
);
7320 DeleteFileA(msifile
);
7323 static void test_appsearch_reglocator(void)
7325 MSIHANDLE hpkg
, hdb
;
7326 CHAR path
[MAX_PATH
];
7327 CHAR prop
[MAX_PATH
];
7330 BOOL space
, version
;
7341 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
7344 DeleteFileA("test.dll");
7346 res
= RegCreateKeyA(HKEY_CLASSES_ROOT
, "Software\\Wine", &classes
);
7347 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7349 res
= RegSetValueExA(classes
, "Value1", 0, REG_SZ
,
7350 (const BYTE
*)"regszdata", 10);
7351 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7353 res
= RegCreateKeyA(HKEY_CURRENT_USER
, "Software\\Wine", &hkcu
);
7354 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7356 res
= RegSetValueExA(hkcu
, "Value1", 0, REG_SZ
,
7357 (const BYTE
*)"regszdata", 10);
7358 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7361 res
= RegCreateKeyA(HKEY_USERS
, "S-1-5-18\\Software\\Wine", &users
);
7362 ok(res
== ERROR_SUCCESS
||
7363 broken(res
== ERROR_INVALID_PARAMETER
),
7364 "Expected ERROR_SUCCESS, got %d\n", res
);
7366 if (res
== ERROR_SUCCESS
)
7368 res
= RegSetValueExA(users
, "Value1", 0, REG_SZ
,
7369 (const BYTE
*)"regszdata", 10);
7370 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7373 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine", &hklm
);
7374 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7376 res
= RegSetValueA(hklm
, NULL
, REG_SZ
, "defvalue", 8);
7377 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7379 res
= RegSetValueExA(hklm
, "Value1", 0, REG_SZ
,
7380 (const BYTE
*)"regszdata", 10);
7381 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7384 res
= RegSetValueExA(hklm
, "Value2", 0, REG_DWORD
,
7385 (const BYTE
*)&val
, sizeof(DWORD
));
7386 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7389 res
= RegSetValueExA(hklm
, "Value3", 0, REG_DWORD
,
7390 (const BYTE
*)&val
, sizeof(DWORD
));
7391 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7393 res
= RegSetValueExA(hklm
, "Value4", 0, REG_EXPAND_SZ
,
7394 (const BYTE
*)"%PATH%", 7);
7395 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7397 res
= RegSetValueExA(hklm
, "Value5", 0, REG_EXPAND_SZ
,
7398 (const BYTE
*)"my%NOVAR%", 10);
7399 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7401 res
= RegSetValueExA(hklm
, "Value6", 0, REG_MULTI_SZ
,
7402 (const BYTE
*)"one\0two\0", 9);
7403 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7405 binary
[0] = 0x1234abcd;
7406 binary
[1] = 0x567890ef;
7407 res
= RegSetValueExA(hklm
, "Value7", 0, REG_BINARY
,
7408 (const BYTE
*)binary
, sizeof(binary
));
7409 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7411 res
= RegSetValueExA(hklm
, "Value8", 0, REG_SZ
,
7412 (const BYTE
*)"#regszdata", 11);
7413 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7415 create_test_file("FileName1");
7416 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7417 res
= RegSetValueExA(hklm
, "Value9", 0, REG_SZ
,
7418 (const BYTE
*)path
, lstrlenA(path
) + 1);
7419 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7421 sprintf(path
, "%s\\FileName2", CURR_DIR
);
7422 res
= RegSetValueExA(hklm
, "Value10", 0, REG_SZ
,
7423 (const BYTE
*)path
, lstrlenA(path
) + 1);
7424 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7426 lstrcpyA(path
, CURR_DIR
);
7427 res
= RegSetValueExA(hklm
, "Value11", 0, REG_SZ
,
7428 (const BYTE
*)path
, lstrlenA(path
) + 1);
7429 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7431 res
= RegSetValueExA(hklm
, "Value12", 0, REG_SZ
,
7432 (const BYTE
*)"", 1);
7433 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7435 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7436 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
7437 res
= RegSetValueExA(hklm
, "Value13", 0, REG_SZ
,
7438 (const BYTE
*)path
, lstrlenA(path
) + 1);
7439 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7441 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7442 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
7443 res
= RegSetValueExA(hklm
, "Value14", 0, REG_SZ
,
7444 (const BYTE
*)path
, lstrlenA(path
) + 1);
7445 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7447 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7448 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
7449 res
= RegSetValueExA(hklm
, "Value15", 0, REG_SZ
,
7450 (const BYTE
*)path
, lstrlenA(path
) + 1);
7451 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
7453 sprintf(path
, "\"%s\\FileName1\" -option", CURR_DIR
);
7454 res
= RegSetValueExA(hklm
, "value16", 0, REG_SZ
,
7455 (const BYTE
*)path
, lstrlenA(path
) + 1);
7457 space
= (strchr(CURR_DIR
, ' ')) ? TRUE
: FALSE
;
7458 sprintf(path
, "%s\\FileName1 -option", CURR_DIR
);
7459 res
= RegSetValueExA(hklm
, "value17", 0, REG_SZ
,
7460 (const BYTE
*)path
, lstrlenA(path
) + 1);
7462 hdb
= create_package_db();
7463 ok(hdb
, "Expected a valid database handle\n");
7465 r
= create_appsearch_table(hdb
);
7466 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7468 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
7469 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7471 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
7472 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7474 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
7475 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7477 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
7478 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7480 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
7481 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7483 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
7484 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7486 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
7487 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7489 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
7490 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7492 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
7493 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7495 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
7496 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7498 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
7499 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7501 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
7502 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7504 r
= add_appsearch_entry(hdb
, "'SIGPROP13', 'NewSignature13'");
7505 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7507 r
= add_appsearch_entry(hdb
, "'SIGPROP14', 'NewSignature14'");
7508 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7510 r
= add_appsearch_entry(hdb
, "'SIGPROP15', 'NewSignature15'");
7511 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7513 r
= add_appsearch_entry(hdb
, "'SIGPROP16', 'NewSignature16'");
7514 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7516 r
= add_appsearch_entry(hdb
, "'SIGPROP17', 'NewSignature17'");
7517 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7519 r
= add_appsearch_entry(hdb
, "'SIGPROP18', 'NewSignature18'");
7520 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7522 r
= add_appsearch_entry(hdb
, "'SIGPROP19', 'NewSignature19'");
7523 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7525 r
= add_appsearch_entry(hdb
, "'SIGPROP20', 'NewSignature20'");
7526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7528 r
= add_appsearch_entry(hdb
, "'SIGPROP21', 'NewSignature21'");
7529 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7531 r
= add_appsearch_entry(hdb
, "'SIGPROP22', 'NewSignature22'");
7532 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7534 r
= add_appsearch_entry(hdb
, "'SIGPROP23', 'NewSignature23'");
7535 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7537 r
= add_appsearch_entry(hdb
, "'SIGPROP24', 'NewSignature24'");
7538 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7540 r
= add_appsearch_entry(hdb
, "'SIGPROP25', 'NewSignature25'");
7541 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7543 r
= add_appsearch_entry(hdb
, "'SIGPROP26', 'NewSignature26'");
7544 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7546 r
= add_appsearch_entry(hdb
, "'SIGPROP27', 'NewSignature27'");
7547 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7549 r
= add_appsearch_entry(hdb
, "'SIGPROP28', 'NewSignature28'");
7550 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7552 r
= add_appsearch_entry(hdb
, "'SIGPROP29', 'NewSignature29'");
7553 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7555 r
= add_appsearch_entry(hdb
, "'SIGPROP30', 'NewSignature30'");
7556 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7558 r
= create_reglocator_table(hdb
);
7559 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7561 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
7562 str
= "'NewSignature1', 2, 'Software\\Wine', 'Value1', 2";
7563 r
= add_reglocator_entry(hdb
, str
);
7564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7566 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
7567 str
= "'NewSignature2', 2, 'Software\\Wine', 'Value2', 2";
7568 r
= add_reglocator_entry(hdb
, str
);
7569 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7571 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
7572 str
= "'NewSignature3', 2, 'Software\\Wine', 'Value3', 2";
7573 r
= add_reglocator_entry(hdb
, str
);
7574 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7576 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7577 str
= "'NewSignature4', 2, 'Software\\Wine', 'Value4', 2";
7578 r
= add_reglocator_entry(hdb
, str
);
7579 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7581 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
7582 str
= "'NewSignature5', 2, 'Software\\Wine', 'Value5', 2";
7583 r
= add_reglocator_entry(hdb
, str
);
7584 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7586 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
7587 str
= "'NewSignature6', 2, 'Software\\Wine', 'Value6', 2";
7588 r
= add_reglocator_entry(hdb
, str
);
7589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7591 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
7592 str
= "'NewSignature7', 2, 'Software\\Wine', 'Value7', 2";
7593 r
= add_reglocator_entry(hdb
, str
);
7594 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7596 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
7597 str
= "'NewSignature8', 2, 'Software\\Wine', 'Value8', 2";
7598 r
= add_reglocator_entry(hdb
, str
);
7599 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7601 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
7602 str
= "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1";
7603 r
= add_reglocator_entry(hdb
, str
);
7604 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7606 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
7607 str
= "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1";
7608 r
= add_reglocator_entry(hdb
, str
);
7609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7611 /* HKLM, msidbLocatorTypeFileName, no signature */
7612 str
= "'NewSignature11', 2, 'Software\\Wine', 'Value9', 1";
7613 r
= add_reglocator_entry(hdb
, str
);
7614 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7616 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
7617 str
= "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0";
7618 r
= add_reglocator_entry(hdb
, str
);
7619 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7621 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
7622 str
= "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0";
7623 r
= add_reglocator_entry(hdb
, str
);
7624 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7626 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
7627 str
= "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0";
7628 r
= add_reglocator_entry(hdb
, str
);
7629 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7631 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
7632 str
= "'NewSignature15', 0, 'Software\\Wine', 'Value1', 2";
7633 r
= add_reglocator_entry(hdb
, str
);
7634 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7636 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
7637 str
= "'NewSignature16', 1, 'Software\\Wine', 'Value1', 2";
7638 r
= add_reglocator_entry(hdb
, str
);
7639 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7641 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
7642 str
= "'NewSignature17', 3, 'S-1-5-18\\Software\\Wine', 'Value1', 2";
7643 r
= add_reglocator_entry(hdb
, str
);
7644 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7646 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
7647 str
= "'NewSignature18', 2, 'Software\\Wine', '', 2";
7648 r
= add_reglocator_entry(hdb
, str
);
7649 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7651 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
7652 str
= "'NewSignature19', 2, 'Software\\IDontExist', '', 2";
7653 r
= add_reglocator_entry(hdb
, str
);
7654 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7656 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
7657 str
= "'NewSignature20', 2, 'Software\\Wine', 'Value12', 2";
7658 r
= add_reglocator_entry(hdb
, str
);
7659 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7661 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
7662 str
= "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1";
7663 r
= add_reglocator_entry(hdb
, str
);
7664 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7666 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
7667 str
= "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1";
7668 r
= add_reglocator_entry(hdb
, str
);
7669 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7671 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
7672 str
= "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1";
7673 r
= add_reglocator_entry(hdb
, str
);
7674 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7676 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
7677 str
= "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1";
7678 r
= add_reglocator_entry(hdb
, str
);
7679 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7681 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
7682 str
= "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1";
7683 r
= add_reglocator_entry(hdb
, str
);
7684 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7686 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
7687 str
= "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0";
7688 r
= add_reglocator_entry(hdb
, str
);
7689 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7691 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
7692 str
= "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0";
7693 r
= add_reglocator_entry(hdb
, str
);
7694 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7696 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
7697 str
= "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0";
7698 r
= add_reglocator_entry(hdb
, str
);
7699 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7701 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
7702 str
= "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1";
7703 r
= add_reglocator_entry(hdb
, str
);
7704 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7706 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
7707 str
= "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1";
7708 r
= add_reglocator_entry(hdb
, str
);
7709 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7711 r
= create_signature_table(hdb
);
7712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7714 str
= "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
7715 r
= add_signature_entry(hdb
, str
);
7716 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7718 str
= "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
7719 r
= add_signature_entry(hdb
, str
);
7720 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7722 str
= "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
7723 r
= add_signature_entry(hdb
, str
);
7724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7726 str
= "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7727 r
= add_signature_entry(hdb
, str
);
7728 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7730 str
= "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7731 r
= add_signature_entry(hdb
, str
);
7732 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7734 str
= "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
7735 r
= add_signature_entry(hdb
, str
);
7736 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7738 ptr
= strrchr(CURR_DIR
, '\\') + 1;
7739 sprintf(path
, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr
);
7740 r
= add_signature_entry(hdb
, path
);
7741 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7743 str
= "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
7744 r
= add_signature_entry(hdb
, str
);
7745 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7747 str
= "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
7748 r
= add_signature_entry(hdb
, str
);
7749 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7751 str
= "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
7752 r
= add_signature_entry(hdb
, str
);
7753 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7755 hpkg
= package_from_db(hdb
);
7756 ok(hpkg
, "Expected a valid package handle\n");
7758 r
= MsiDoAction(hpkg
, "AppSearch");
7759 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7762 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
7763 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7764 ok(!lstrcmpA(prop
, "regszdata"),
7765 "Expected \"regszdata\", got \"%s\"\n", prop
);
7768 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
7769 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7770 ok(!lstrcmpA(prop
, "#42"), "Expected \"#42\", got \"%s\"\n", prop
);
7773 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
7774 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7775 ok(!lstrcmpA(prop
, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop
);
7777 size
= ExpandEnvironmentStringsA("%PATH%", NULL
, 0);
7778 if (size
== 0 && GetLastError() == ERROR_INVALID_PARAMETER
)
7780 /* Workaround for Win95 */
7782 size
= ExpandEnvironmentStringsA("%PATH%", tempbuf
, 0);
7784 pathvar
= HeapAlloc(GetProcessHeap(), 0, size
);
7785 ExpandEnvironmentStringsA("%PATH%", pathvar
, size
);
7788 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", NULL
, &size
);
7789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7791 pathdata
= HeapAlloc(GetProcessHeap(), 0, ++size
);
7792 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", pathdata
, &size
);
7793 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7794 ok(!lstrcmpA(pathdata
, pathvar
),
7795 "Expected \"%s\", got \"%s\"\n", pathvar
, pathdata
);
7797 HeapFree(GetProcessHeap(), 0, pathvar
);
7798 HeapFree(GetProcessHeap(), 0, pathdata
);
7801 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
7802 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7804 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop
);
7807 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
7808 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7811 ok(!memcmp(prop
, "\0one\0two\0\0", 10),
7812 "Expected \"\\0one\\0two\\0\\0\"\n");
7816 lstrcpyA(path
, "#xCDAB3412EF907856");
7817 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
7818 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7819 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7822 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
7823 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7824 ok(!lstrcmpA(prop
, "##regszdata"),
7825 "Expected \"##regszdata\", got \"%s\"\n", prop
);
7828 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7829 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
7830 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7831 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7834 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
7835 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7836 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7839 sprintf(path
, "%s\\", CURR_DIR
);
7840 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
7841 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7842 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7845 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
7846 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7847 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7850 sprintf(path
, "%s\\", CURR_DIR
);
7851 r
= MsiGetPropertyA(hpkg
, "SIGPROP13", prop
, &size
);
7852 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7853 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7856 r
= MsiGetPropertyA(hpkg
, "SIGPROP14", prop
, &size
);
7857 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7858 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7861 r
= MsiGetPropertyA(hpkg
, "SIGPROP15", prop
, &size
);
7862 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7863 ok(!lstrcmpA(prop
, "regszdata"),
7864 "Expected \"regszdata\", got \"%s\"\n", prop
);
7867 r
= MsiGetPropertyA(hpkg
, "SIGPROP16", prop
, &size
);
7868 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7869 ok(!lstrcmpA(prop
, "regszdata"),
7870 "Expected \"regszdata\", got \"%s\"\n", prop
);
7875 r
= MsiGetPropertyA(hpkg
, "SIGPROP17", prop
, &size
);
7876 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7877 ok(!lstrcmpA(prop
, "regszdata"),
7878 "Expected \"regszdata\", got \"%s\"\n", prop
);
7882 r
= MsiGetPropertyA(hpkg
, "SIGPROP18", prop
, &size
);
7883 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7884 ok(!lstrcmpA(prop
, "defvalue"),
7885 "Expected \"defvalue\", got \"%s\"\n", prop
);
7888 r
= MsiGetPropertyA(hpkg
, "SIGPROP19", prop
, &size
);
7889 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7890 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7893 r
= MsiGetPropertyA(hpkg
, "SIGPROP20", prop
, &size
);
7894 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7895 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7900 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
7901 r
= MsiGetPropertyA(hpkg
, "SIGPROP21", prop
, &size
);
7902 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7903 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7906 r
= MsiGetPropertyA(hpkg
, "SIGPROP22", prop
, &size
);
7907 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7908 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7911 sprintf(path
, "%s\\FileName5.dll", CURR_DIR
);
7912 r
= MsiGetPropertyA(hpkg
, "SIGPROP23", prop
, &size
);
7913 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7914 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7918 lstrcpyA(path
, CURR_DIR
);
7919 ptr
= strrchr(path
, '\\') + 1;
7921 r
= MsiGetPropertyA(hpkg
, "SIGPROP24", prop
, &size
);
7922 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7923 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7926 sprintf(path
, "%s\\", CURR_DIR
);
7927 r
= MsiGetPropertyA(hpkg
, "SIGPROP25", prop
, &size
);
7928 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7929 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7932 r
= MsiGetPropertyA(hpkg
, "SIGPROP26", prop
, &size
);
7933 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7934 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7937 r
= MsiGetPropertyA(hpkg
, "SIGPROP27", prop
, &size
);
7938 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7939 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7942 r
= MsiGetPropertyA(hpkg
, "SIGPROP28", prop
, &size
);
7943 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7944 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7947 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7948 r
= MsiGetPropertyA(hpkg
, "SIGPROP29", prop
, &size
);
7949 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7950 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7953 sprintf(path
, "%s\\FileName1", CURR_DIR
);
7954 r
= MsiGetPropertyA(hpkg
, "SIGPROP30", prop
, &size
);
7955 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
7957 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
7959 todo_wine
ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
7961 RegSetValueA(hklm
, NULL
, REG_SZ
, "", 0);
7962 RegDeleteValueA(hklm
, "Value1");
7963 RegDeleteValueA(hklm
, "Value2");
7964 RegDeleteValueA(hklm
, "Value3");
7965 RegDeleteValueA(hklm
, "Value4");
7966 RegDeleteValueA(hklm
, "Value5");
7967 RegDeleteValueA(hklm
, "Value6");
7968 RegDeleteValueA(hklm
, "Value7");
7969 RegDeleteValueA(hklm
, "Value8");
7970 RegDeleteValueA(hklm
, "Value9");
7971 RegDeleteValueA(hklm
, "Value10");
7972 RegDeleteValueA(hklm
, "Value11");
7973 RegDeleteValueA(hklm
, "Value12");
7974 RegDeleteValueA(hklm
, "Value13");
7975 RegDeleteValueA(hklm
, "Value14");
7976 RegDeleteValueA(hklm
, "Value15");
7977 RegDeleteValueA(hklm
, "Value16");
7978 RegDeleteValueA(hklm
, "Value17");
7979 RegDeleteKeyA(hklm
, "");
7982 RegDeleteValueA(classes
, "Value1");
7983 RegDeleteKeyA(classes
, "");
7984 RegCloseKey(classes
);
7986 RegDeleteValueA(hkcu
, "Value1");
7987 RegDeleteKeyA(hkcu
, "");
7990 RegDeleteValueA(users
, "Value1");
7991 RegDeleteKeyA(users
, "");
7994 DeleteFileA("FileName1");
7995 DeleteFileA("FileName3.dll");
7996 DeleteFileA("FileName4.dll");
7997 DeleteFileA("FileName5.dll");
7998 MsiCloseHandle(hpkg
);
7999 DeleteFileA(msifile
);
8002 static void delete_win_ini(LPCSTR file
)
8004 CHAR path
[MAX_PATH
];
8006 GetWindowsDirectoryA(path
, MAX_PATH
);
8007 lstrcatA(path
, "\\");
8008 lstrcatA(path
, file
);
8013 static void test_appsearch_inilocator(void)
8015 MSIHANDLE hpkg
, hdb
;
8016 CHAR path
[MAX_PATH
];
8017 CHAR prop
[MAX_PATH
];
8025 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8028 DeleteFileA("test.dll");
8030 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8032 create_test_file("FileName1");
8033 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8034 WritePrivateProfileStringA("Section", "Key2", path
, "IniFile.ini");
8036 WritePrivateProfileStringA("Section", "Key3", CURR_DIR
, "IniFile.ini");
8038 sprintf(path
, "%s\\IDontExist", CURR_DIR
);
8039 WritePrivateProfileStringA("Section", "Key4", path
, "IniFile.ini");
8041 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8042 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
8043 WritePrivateProfileStringA("Section", "Key5", path
, "IniFile.ini");
8045 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8046 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8047 WritePrivateProfileStringA("Section", "Key6", path
, "IniFile.ini");
8049 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8050 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
8051 WritePrivateProfileStringA("Section", "Key7", path
, "IniFile.ini");
8053 hdb
= create_package_db();
8054 ok(hdb
, "Expected a valid database handle\n");
8056 r
= create_appsearch_table(hdb
);
8057 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8059 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8060 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8062 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8063 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8065 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8068 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8069 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8071 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8072 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8074 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8075 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8077 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8078 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8080 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8081 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8083 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8084 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8086 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8087 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8089 r
= add_appsearch_entry(hdb
, "'SIGPROP11', 'NewSignature11'");
8090 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8092 r
= add_appsearch_entry(hdb
, "'SIGPROP12', 'NewSignature12'");
8093 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8095 r
= create_inilocator_table(hdb
);
8096 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8098 /* msidbLocatorTypeRawValue, field 1 */
8099 str
= "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8100 r
= add_inilocator_entry(hdb
, str
);
8101 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8103 /* msidbLocatorTypeRawValue, field 2 */
8104 str
= "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8105 r
= add_inilocator_entry(hdb
, str
);
8106 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8108 /* msidbLocatorTypeRawValue, entire field */
8109 str
= "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8110 r
= add_inilocator_entry(hdb
, str
);
8111 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8113 /* msidbLocatorTypeFile */
8114 str
= "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8115 r
= add_inilocator_entry(hdb
, str
);
8116 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8118 /* msidbLocatorTypeDirectory, file */
8119 str
= "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
8120 r
= add_inilocator_entry(hdb
, str
);
8121 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8123 /* msidbLocatorTypeDirectory, directory */
8124 str
= "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
8125 r
= add_inilocator_entry(hdb
, str
);
8126 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8128 /* msidbLocatorTypeFile, file, no signature */
8129 str
= "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
8130 r
= add_inilocator_entry(hdb
, str
);
8131 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8133 /* msidbLocatorTypeFile, dir, no signature */
8134 str
= "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
8135 r
= add_inilocator_entry(hdb
, str
);
8136 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8138 /* msidbLocatorTypeFile, file does not exist */
8139 str
= "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
8140 r
= add_inilocator_entry(hdb
, str
);
8141 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8143 /* msidbLocatorTypeFile, signature with version */
8144 str
= "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
8145 r
= add_inilocator_entry(hdb
, str
);
8146 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8148 /* msidbLocatorTypeFile, signature with version, ver > max */
8149 str
= "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
8150 r
= add_inilocator_entry(hdb
, str
);
8151 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8153 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
8154 str
= "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
8155 r
= add_inilocator_entry(hdb
, str
);
8156 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8158 r
= create_signature_table(hdb
);
8159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8161 r
= add_signature_entry(hdb
, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
8162 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8164 r
= add_signature_entry(hdb
, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
8165 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8167 r
= add_signature_entry(hdb
, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8168 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8170 r
= add_signature_entry(hdb
, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8171 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8173 r
= add_signature_entry(hdb
, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8174 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8176 hpkg
= package_from_db(hdb
);
8177 ok(hpkg
, "Expected a valid package handle\n");
8179 r
= MsiDoAction(hpkg
, "AppSearch");
8180 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8183 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8184 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8185 ok(!lstrcmpA(prop
, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop
);
8188 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8189 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8190 ok(!lstrcmpA(prop
, "field2"), "Expected \"field2\", got \"%s\"\n", prop
);
8193 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8194 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8195 ok(!lstrcmpA(prop
, "keydata,field2"),
8196 "Expected \"keydata,field2\", got \"%s\"\n", prop
);
8199 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8200 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
8201 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8202 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8205 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8206 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8207 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8210 sprintf(path
, "%s\\", CURR_DIR
);
8211 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8212 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8213 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8216 sprintf(path
, "%s\\", CURR_DIR
);
8217 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8218 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8219 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8222 lstrcpyA(path
, CURR_DIR
);
8223 ptr
= strrchr(path
, '\\');
8225 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8226 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8227 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8230 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8231 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8232 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8237 sprintf(path
, "%s\\FileName2.dll", CURR_DIR
);
8238 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8239 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8240 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8243 r
= MsiGetPropertyA(hpkg
, "SIGPROP11", prop
, &size
);
8244 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8245 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8248 sprintf(path
, "%s\\FileName4.dll", CURR_DIR
);
8249 r
= MsiGetPropertyA(hpkg
, "SIGPROP12", prop
, &size
);
8250 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8251 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8254 delete_win_ini("IniFile.ini");
8255 DeleteFileA("FileName1");
8256 DeleteFileA("FileName2.dll");
8257 DeleteFileA("FileName3.dll");
8258 DeleteFileA("FileName4.dll");
8259 MsiCloseHandle(hpkg
);
8260 DeleteFileA(msifile
);
8263 static void test_appsearch_drlocator(void)
8265 MSIHANDLE hpkg
, hdb
;
8266 CHAR path
[MAX_PATH
];
8267 CHAR prop
[MAX_PATH
];
8274 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8277 DeleteFileA("test.dll");
8279 create_test_file("FileName1");
8280 CreateDirectoryA("one", NULL
);
8281 CreateDirectoryA("one\\two", NULL
);
8282 CreateDirectoryA("one\\two\\three", NULL
);
8283 create_test_file("one\\two\\three\\FileName2");
8284 CreateDirectoryA("another", NULL
);
8285 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8286 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8287 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8289 hdb
= create_package_db();
8290 ok(hdb
, "Expected a valid database handle\n");
8292 r
= create_appsearch_table(hdb
);
8293 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8295 r
= add_appsearch_entry(hdb
, "'SIGPROP1', 'NewSignature1'");
8296 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8298 r
= add_appsearch_entry(hdb
, "'SIGPROP2', 'NewSignature2'");
8299 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8301 r
= add_appsearch_entry(hdb
, "'SIGPROP3', 'NewSignature3'");
8302 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8304 r
= add_appsearch_entry(hdb
, "'SIGPROP4', 'NewSignature4'");
8305 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8307 r
= add_appsearch_entry(hdb
, "'SIGPROP5', 'NewSignature5'");
8308 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8310 r
= add_appsearch_entry(hdb
, "'SIGPROP6', 'NewSignature6'");
8311 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8313 r
= add_appsearch_entry(hdb
, "'SIGPROP7', 'NewSignature7'");
8314 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8316 r
= add_appsearch_entry(hdb
, "'SIGPROP8', 'NewSignature8'");
8317 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8319 r
= add_appsearch_entry(hdb
, "'SIGPROP9', 'NewSignature9'");
8320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8322 r
= add_appsearch_entry(hdb
, "'SIGPROP10', 'NewSignature10'");
8323 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8325 r
= create_drlocator_table(hdb
);
8326 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8328 /* no parent, full path, depth 0, signature */
8329 sprintf(path
, "'NewSignature1', '', '%s', 0", CURR_DIR
);
8330 r
= add_drlocator_entry(hdb
, path
);
8331 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8333 /* no parent, full path, depth 0, no signature */
8334 sprintf(path
, "'NewSignature2', '', '%s', 0", CURR_DIR
);
8335 r
= add_drlocator_entry(hdb
, path
);
8336 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8338 /* no parent, relative path, depth 0, no signature */
8339 sprintf(path
, "'NewSignature3', '', '%s', 0", CURR_DIR
+ 3);
8340 r
= add_drlocator_entry(hdb
, path
);
8341 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8343 /* no parent, full path, depth 2, signature */
8344 sprintf(path
, "'NewSignature4', '', '%s', 2", CURR_DIR
);
8345 r
= add_drlocator_entry(hdb
, path
);
8346 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8348 /* no parent, full path, depth 3, signature */
8349 sprintf(path
, "'NewSignature5', '', '%s', 3", CURR_DIR
);
8350 r
= add_drlocator_entry(hdb
, path
);
8351 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8353 /* no parent, full path, depth 1, signature is dir */
8354 sprintf(path
, "'NewSignature6', '', '%s', 1", CURR_DIR
);
8355 r
= add_drlocator_entry(hdb
, path
);
8356 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8358 /* parent is in DrLocator, relative path, depth 0, signature */
8359 sprintf(path
, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
8360 r
= add_drlocator_entry(hdb
, path
);
8361 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8363 /* no parent, full path, depth 0, signature w/ version */
8364 sprintf(path
, "'NewSignature8', '', '%s', 0", CURR_DIR
);
8365 r
= add_drlocator_entry(hdb
, path
);
8366 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8368 /* no parent, full path, depth 0, signature w/ version, ver > max */
8369 sprintf(path
, "'NewSignature9', '', '%s', 0", CURR_DIR
);
8370 r
= add_drlocator_entry(hdb
, path
);
8371 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8373 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
8374 sprintf(path
, "'NewSignature10', '', '%s', 0", CURR_DIR
);
8375 r
= add_drlocator_entry(hdb
, path
);
8376 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8378 r
= create_signature_table(hdb
);
8379 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8381 str
= "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
8382 r
= add_signature_entry(hdb
, str
);
8383 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8385 str
= "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
8386 r
= add_signature_entry(hdb
, str
);
8387 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8389 str
= "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
8390 r
= add_signature_entry(hdb
, str
);
8391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8393 str
= "'NewSignature6', 'another', '', '', '', '', '', '', ''";
8394 r
= add_signature_entry(hdb
, str
);
8395 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8397 str
= "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
8398 r
= add_signature_entry(hdb
, str
);
8399 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8401 str
= "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8402 r
= add_signature_entry(hdb
, str
);
8403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8405 str
= "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8406 r
= add_signature_entry(hdb
, str
);
8407 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8409 str
= "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8410 r
= add_signature_entry(hdb
, str
);
8411 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8413 hpkg
= package_from_db(hdb
);
8414 ok(hpkg
, "Expected a valid package handle\n");
8416 r
= MsiDoAction(hpkg
, "AppSearch");
8417 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8420 sprintf(path
, "%s\\FileName1", CURR_DIR
);
8421 r
= MsiGetPropertyA(hpkg
, "SIGPROP1", prop
, &size
);
8422 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8423 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8426 sprintf(path
, "%s\\", CURR_DIR
);
8427 r
= MsiGetPropertyA(hpkg
, "SIGPROP2", prop
, &size
);
8428 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8429 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8432 sprintf(path
, "%s\\", CURR_DIR
);
8433 r
= MsiGetPropertyA(hpkg
, "SIGPROP3", prop
, &size
);
8434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8435 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8438 r
= MsiGetPropertyA(hpkg
, "SIGPROP4", prop
, &size
);
8439 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8440 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8443 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
8444 r
= MsiGetPropertyA(hpkg
, "SIGPROP5", prop
, &size
);
8445 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8446 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8449 r
= MsiGetPropertyA(hpkg
, "SIGPROP6", prop
, &size
);
8450 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8451 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8454 sprintf(path
, "%s\\one\\two\\three\\FileName2", CURR_DIR
);
8455 r
= MsiGetPropertyA(hpkg
, "SIGPROP7", prop
, &size
);
8456 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8457 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8462 sprintf(path
, "%s\\FileName3.dll", CURR_DIR
);
8463 r
= MsiGetPropertyA(hpkg
, "SIGPROP8", prop
, &size
);
8464 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8465 ok(!lstrcmpA(prop
, path
), "Expected \"%s\", got \"%s\"\n", path
, prop
);
8468 r
= MsiGetPropertyA(hpkg
, "SIGPROP9", prop
, &size
);
8469 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8470 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8473 r
= MsiGetPropertyA(hpkg
, "SIGPROP10", prop
, &size
);
8474 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8475 ok(!lstrcmpA(prop
, ""), "Expected \"\", got \"%s\"\n", prop
);
8478 DeleteFileA("FileName1");
8479 DeleteFileA("FileName3.dll");
8480 DeleteFileA("FileName4.dll");
8481 DeleteFileA("FileName5.dll");
8482 DeleteFileA("one\\two\\three\\FileName2");
8483 RemoveDirectoryA("one\\two\\three");
8484 RemoveDirectoryA("one\\two");
8485 RemoveDirectoryA("one");
8486 RemoveDirectoryA("another");
8487 MsiCloseHandle(hpkg
);
8488 DeleteFileA(msifile
);
8491 static void test_featureparents(void)
8496 INSTALLSTATE state
, action
;
8498 hdb
= create_package_db();
8499 ok ( hdb
, "failed to create package database\n" );
8501 r
= add_directory_entry( hdb
, "'TARGETDIR', '', 'SourceDir'");
8502 ok( r
== ERROR_SUCCESS
, "cannot add directory: %d\n", r
);
8504 r
= create_feature_table( hdb
);
8505 ok( r
== ERROR_SUCCESS
, "cannot create Feature table: %d\n", r
);
8507 r
= create_component_table( hdb
);
8508 ok( r
== ERROR_SUCCESS
, "cannot create Component table: %d\n", r
);
8510 r
= create_feature_components_table( hdb
);
8511 ok( r
== ERROR_SUCCESS
, "cannot create FeatureComponents table: %d\n", r
);
8513 r
= create_file_table( hdb
);
8514 ok( r
== ERROR_SUCCESS
, "cannot create File table: %d\n", r
);
8516 /* msidbFeatureAttributesFavorLocal */
8517 r
= add_feature_entry( hdb
, "'zodiac', '', '', '', 2, 1, '', 0" );
8518 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8520 /* msidbFeatureAttributesFavorSource */
8521 r
= add_feature_entry( hdb
, "'perseus', '', '', '', 2, 1, '', 1" );
8522 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8524 /* msidbFeatureAttributesFavorLocal */
8525 r
= add_feature_entry( hdb
, "'orion', '', '', '', 2, 1, '', 0" );
8526 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8528 /* disabled because of install level */
8529 r
= add_feature_entry( hdb
, "'waters', '', '', '', 15, 101, '', 9" );
8530 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8532 /* child feature of disabled feature */
8533 r
= add_feature_entry( hdb
, "'bayer', 'waters', '', '', 14, 1, '', 9" );
8534 ok( r
== ERROR_SUCCESS
, "cannot add feature: %d\n", r
);
8536 /* component of disabled feature (install level) */
8537 r
= add_component_entry( hdb
, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
8538 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8540 /* component of disabled child feature (install level) */
8541 r
= add_component_entry( hdb
, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
8542 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8544 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8545 r
= add_component_entry( hdb
, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
8546 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8548 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8549 r
= add_component_entry( hdb
, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
8550 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8552 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8553 r
= add_component_entry( hdb
, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
8554 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8556 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
8557 r
= add_component_entry( hdb
, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
8558 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8560 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
8561 r
= add_component_entry( hdb
, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
8562 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8564 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
8565 r
= add_component_entry( hdb
, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
8566 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8568 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
8569 r
= add_component_entry( hdb
, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
8570 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8572 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
8573 r
= add_component_entry( hdb
, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
8574 ok( r
== ERROR_SUCCESS
, "cannot add component: %d\n", r
);
8576 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
8577 r
= add_component_entry( hdb
, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
8579 r
= add_feature_components_entry( hdb
, "'zodiac', 'leo'" );
8580 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8582 r
= add_feature_components_entry( hdb
, "'zodiac', 'virgo'" );
8583 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8585 r
= add_feature_components_entry( hdb
, "'zodiac', 'libra'" );
8586 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8588 r
= add_feature_components_entry( hdb
, "'perseus', 'cassiopeia'" );
8589 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8591 r
= add_feature_components_entry( hdb
, "'perseus', 'cepheus'" );
8592 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8594 r
= add_feature_components_entry( hdb
, "'perseus', 'andromeda'" );
8595 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8597 r
= add_feature_components_entry( hdb
, "'orion', 'leo'" );
8598 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8600 r
= add_feature_components_entry( hdb
, "'orion', 'virgo'" );
8601 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8603 r
= add_feature_components_entry( hdb
, "'orion', 'libra'" );
8604 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8606 r
= add_feature_components_entry( hdb
, "'orion', 'cassiopeia'" );
8607 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8609 r
= add_feature_components_entry( hdb
, "'orion', 'cepheus'" );
8610 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8612 r
= add_feature_components_entry( hdb
, "'orion', 'andromeda'" );
8613 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8615 r
= add_feature_components_entry( hdb
, "'orion', 'canis'" );
8616 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8618 r
= add_feature_components_entry( hdb
, "'orion', 'monoceros'" );
8619 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8621 r
= add_feature_components_entry( hdb
, "'orion', 'lepus'" );
8622 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8624 r
= add_feature_components_entry( hdb
, "'waters', 'delphinus'" );
8625 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8627 r
= add_feature_components_entry( hdb
, "'bayer', 'hydrus'" );
8628 ok( r
== ERROR_SUCCESS
, "cannot add feature components: %d\n", r
);
8630 r
= add_file_entry( hdb
, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
8631 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8633 r
= add_file_entry( hdb
, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
8634 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8636 r
= add_file_entry( hdb
, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
8637 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8639 r
= add_file_entry( hdb
, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
8640 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8642 r
= add_file_entry( hdb
, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
8643 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8645 r
= add_file_entry( hdb
, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
8646 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8648 r
= add_file_entry( hdb
, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
8649 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8651 r
= add_file_entry( hdb
, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
8652 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8654 r
= add_file_entry( hdb
, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
8655 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8657 r
= add_file_entry( hdb
, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
8658 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8660 r
= add_file_entry( hdb
, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
8661 ok( r
== ERROR_SUCCESS
, "cannot add file: %d\n", r
);
8663 hpkg
= package_from_db( hdb
);
8664 ok( hpkg
, "failed to create package\n");
8666 MsiCloseHandle( hdb
);
8668 r
= MsiDoAction( hpkg
, "CostInitialize");
8669 ok( r
== ERROR_SUCCESS
, "cost init failed\n");
8671 r
= MsiDoAction( hpkg
, "FileCost");
8672 ok( r
== ERROR_SUCCESS
, "file cost failed\n");
8674 r
= MsiDoAction( hpkg
, "CostFinalize");
8675 ok( r
== ERROR_SUCCESS
, "cost finalize failed\n");
8679 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
8680 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8681 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
8682 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
8686 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
8687 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8688 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
8689 ok( action
== INSTALLSTATE_SOURCE
, "Expected INSTALLSTATE_SOURCE, got %d\n", action
);
8693 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
8694 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8695 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
8696 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
8700 r
= MsiGetFeatureState(hpkg
, "waters", &state
, &action
);
8701 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8702 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
8703 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
8707 r
= MsiGetFeatureState(hpkg
, "bayer", &state
, &action
);
8708 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8709 ok( state
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", state
);
8710 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
8714 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
8715 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8716 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
8717 ok( action
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", action
);
8721 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
8722 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8723 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
8724 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
8728 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
8729 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8730 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
8731 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
8735 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
8736 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8737 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
8738 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
8742 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
8743 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8744 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8745 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
8749 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
8750 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8751 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
8752 ok( action
== INSTALLSTATE_LOCAL
, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action
);
8756 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
8757 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8758 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
8759 ok( action
== INSTALLSTATE_LOCAL
, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action
);
8763 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
8764 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8765 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
8766 ok( action
== INSTALLSTATE_SOURCE
, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action
);
8770 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
8771 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8772 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8773 ok( action
== INSTALLSTATE_LOCAL
, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action
);
8777 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
8778 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8779 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8780 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
8784 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
8785 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8786 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8787 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
8789 r
= MsiSetFeatureState(hpkg
, "orion", INSTALLSTATE_ABSENT
);
8790 ok( r
== ERROR_SUCCESS
, "failed to set feature state: %d\n", r
);
8794 r
= MsiGetFeatureState(hpkg
, "zodiac", &state
, &action
);
8795 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8796 ok( state
== INSTALLSTATE_ABSENT
, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state
);
8797 ok( action
== INSTALLSTATE_LOCAL
, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action
);
8801 r
= MsiGetFeatureState(hpkg
, "perseus", &state
, &action
);
8802 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8803 ok( state
== INSTALLSTATE_ABSENT
, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state
);
8804 ok( action
== INSTALLSTATE_SOURCE
, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action
);
8808 r
= MsiGetFeatureState(hpkg
, "orion", &state
, &action
);
8809 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8810 ok( state
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state
);
8811 ok( action
== INSTALLSTATE_ABSENT
, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action
);
8815 r
= MsiGetComponentState(hpkg
, "leo", &state
, &action
);
8816 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8817 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state
);
8818 ok( action
== INSTALLSTATE_LOCAL
, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action
);
8822 r
= MsiGetComponentState(hpkg
, "virgo", &state
, &action
);
8823 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8824 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state
);
8825 ok( action
== INSTALLSTATE_SOURCE
, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action
);
8829 r
= MsiGetComponentState(hpkg
, "libra", &state
, &action
);
8830 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8831 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state
);
8832 ok( action
== INSTALLSTATE_LOCAL
, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action
);
8836 r
= MsiGetComponentState(hpkg
, "cassiopeia", &state
, &action
);
8837 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8838 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state
);
8839 ok( action
== INSTALLSTATE_LOCAL
, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action
);
8843 r
= MsiGetComponentState(hpkg
, "cepheus", &state
, &action
);
8844 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8845 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8846 ok( action
== INSTALLSTATE_SOURCE
, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action
);
8850 r
= MsiGetComponentState(hpkg
, "andromeda", &state
, &action
);
8851 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8852 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state
);
8853 ok( action
== INSTALLSTATE_SOURCE
, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action
);
8857 r
= MsiGetComponentState(hpkg
, "canis", &state
, &action
);
8858 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8859 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state
);
8860 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action
);
8864 r
= MsiGetComponentState(hpkg
, "monoceros", &state
, &action
);
8865 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8866 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state
);
8867 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action
);
8871 r
= MsiGetComponentState(hpkg
, "lepus", &state
, &action
);
8872 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8873 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8874 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action
);
8878 r
= MsiGetComponentState(hpkg
, "delphinus", &state
, &action
);
8879 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8880 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8881 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action
);
8885 r
= MsiGetComponentState(hpkg
, "hydrus", &state
, &action
);
8886 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
8887 ok( state
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state
);
8888 ok( action
== INSTALLSTATE_UNKNOWN
, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action
);
8890 MsiCloseHandle(hpkg
);
8891 DeleteFileA(msifile
);
8894 static void test_installprops(void)
8896 MSIHANDLE hpkg
, hdb
;
8897 CHAR path
[MAX_PATH
];
8905 GetCurrentDirectory(MAX_PATH
, path
);
8906 lstrcat(path
, "\\");
8907 lstrcat(path
, msifile
);
8909 hdb
= create_package_db();
8910 ok( hdb
, "failed to create database\n");
8912 hpkg
= package_from_db(hdb
);
8913 ok( hpkg
, "failed to create package\n");
8915 MsiCloseHandle(hdb
);
8918 r
= MsiGetProperty(hpkg
, "DATABASE", buf
, &size
);
8919 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8920 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
8922 RegOpenKey(HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1
);
8924 RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hkey2
);
8929 if (RegQueryValueEx(hkey1
, "DefName", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
8933 RegQueryValueEx(hkey2
, "RegisteredOwner", NULL
, &type
, (LPBYTE
)path
, &size
);
8936 /* win9x doesn't set this */
8940 r
= MsiGetProperty(hpkg
, "USERNAME", buf
, &size
);
8941 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8942 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
8948 if (RegQueryValueEx(hkey1
, "DefCompany", NULL
, &type
, (LPBYTE
)path
, &size
) != ERROR_SUCCESS
)
8952 RegQueryValueEx(hkey2
, "RegisteredOrganization", NULL
, &type
, (LPBYTE
)path
, &size
);
8958 r
= MsiGetProperty(hpkg
, "COMPANYNAME", buf
, &size
);
8959 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8960 ok( !lstrcmp(buf
, path
), "Expected %s, got %s\n", path
, buf
);
8964 r
= MsiGetProperty(hpkg
, "VersionDatabase", buf
, &size
);
8965 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8966 trace("VersionDatabase = %s\n", buf
);
8969 r
= MsiGetProperty(hpkg
, "VersionMsi", buf
, &size
);
8970 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8971 trace("VersionMsi = %s\n", buf
);
8974 r
= MsiGetProperty(hpkg
, "Date", buf
, &size
);
8975 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8976 trace("Date = %s\n", buf
);
8979 r
= MsiGetProperty(hpkg
, "Time", buf
, &size
);
8980 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8981 trace("Time = %s\n", buf
);
8984 r
= MsiGetProperty(hpkg
, "PackageCode", buf
, &size
);
8985 ok( r
== ERROR_SUCCESS
, "failed to get property: %d\n", r
);
8986 trace("PackageCode = %s\n", buf
);
8988 langid
= GetUserDefaultLangID();
8989 sprintf(path
, "%d", langid
);
8992 r
= MsiGetProperty(hpkg
, "UserLanguageID", buf
, &size
);
8993 ok( r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS< got %d\n", r
);
8994 ok( !lstrcmpA(buf
, path
), "Expected \"%s\", got \"%s\"\n", path
, buf
);
8996 res
= GetSystemMetrics(SM_CXSCREEN
);
8998 r
= MsiGetProperty(hpkg
, "ScreenX", buf
, &size
);
8999 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
9001 res
= GetSystemMetrics(SM_CYSCREEN
);
9003 r
= MsiGetProperty(hpkg
, "ScreenY", buf
, &size
);
9004 ok(atol(buf
) == res
, "Expected %d, got %ld\n", res
, atol(buf
));
9008 MsiCloseHandle(hpkg
);
9009 DeleteFile(msifile
);
9012 static void test_launchconditions(void)
9018 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9020 hdb
= create_package_db();
9021 ok( hdb
, "failed to create package database\n" );
9023 r
= create_launchcondition_table( hdb
);
9024 ok( r
== ERROR_SUCCESS
, "cannot create LaunchCondition table: %d\n", r
);
9026 r
= add_launchcondition_entry( hdb
, "'X = \"1\"', 'one'" );
9027 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
9029 /* invalid condition */
9030 r
= add_launchcondition_entry( hdb
, "'X != \"1\"', 'one'" );
9031 ok( r
== ERROR_SUCCESS
, "cannot add launch condition: %d\n", r
);
9033 hpkg
= package_from_db( hdb
);
9034 ok( hpkg
, "failed to create package\n");
9036 MsiCloseHandle( hdb
);
9038 r
= MsiSetProperty( hpkg
, "X", "1" );
9039 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
9041 /* invalid conditions are ignored */
9042 r
= MsiDoAction( hpkg
, "LaunchConditions" );
9043 ok( r
== ERROR_SUCCESS
, "cost init failed\n" );
9045 /* verify LaunchConditions still does some verification */
9046 r
= MsiSetProperty( hpkg
, "X", "2" );
9047 ok( r
== ERROR_SUCCESS
, "failed to set property\n" );
9049 r
= MsiDoAction( hpkg
, "LaunchConditions" );
9050 ok( r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %d\n", r
);
9052 MsiCloseHandle( hpkg
);
9053 DeleteFile( msifile
);
9056 static void test_ccpsearch(void)
9058 MSIHANDLE hdb
, hpkg
;
9059 CHAR prop
[MAX_PATH
];
9060 DWORD size
= MAX_PATH
;
9063 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
9065 hdb
= create_package_db();
9066 ok(hdb
, "failed to create package database\n");
9068 r
= create_ccpsearch_table(hdb
);
9069 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9071 r
= add_ccpsearch_entry(hdb
, "'CCP_random'");
9072 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9074 r
= add_ccpsearch_entry(hdb
, "'RMCCP_random'");
9075 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9077 r
= create_reglocator_table(hdb
);
9078 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9080 r
= add_reglocator_entry(hdb
, "'CCP_random', 0, 'htmlfile\\shell\\open\\nonexistent', '', 1");
9081 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9083 r
= create_drlocator_table(hdb
);
9084 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9086 r
= add_drlocator_entry(hdb
, "'RMCCP_random', '', 'C:\\', '0'");
9087 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9089 r
= create_signature_table(hdb
);
9090 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9092 hpkg
= package_from_db(hdb
);
9093 ok(hpkg
, "failed to create package\n");
9095 MsiCloseHandle(hdb
);
9097 r
= MsiDoAction(hpkg
, "CCPSearch");
9098 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9100 r
= MsiGetPropertyA(hpkg
, "CCP_Success", prop
, &size
);
9101 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9102 ok(!lstrcmpA(prop
, "1"), "Expected 1, got %s\n", prop
);
9104 MsiCloseHandle(hpkg
);
9105 DeleteFileA(msifile
);
9108 static void test_complocator(void)
9110 MSIHANDLE hdb
, hpkg
;
9112 CHAR prop
[MAX_PATH
];
9113 CHAR expected
[MAX_PATH
];
9114 DWORD size
= MAX_PATH
;
9116 hdb
= create_package_db();
9117 ok(hdb
, "failed to create package database\n");
9119 r
= create_appsearch_table(hdb
);
9120 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9122 r
= add_appsearch_entry(hdb
, "'ABELISAURUS', 'abelisaurus'");
9123 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9125 r
= add_appsearch_entry(hdb
, "'BACTROSAURUS', 'bactrosaurus'");
9126 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9128 r
= add_appsearch_entry(hdb
, "'CAMELOTIA', 'camelotia'");
9129 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9131 r
= add_appsearch_entry(hdb
, "'DICLONIUS', 'diclonius'");
9132 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9134 r
= add_appsearch_entry(hdb
, "'ECHINODON', 'echinodon'");
9135 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9137 r
= add_appsearch_entry(hdb
, "'FALCARIUS', 'falcarius'");
9138 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9140 r
= add_appsearch_entry(hdb
, "'GALLIMIMUS', 'gallimimus'");
9141 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9143 r
= add_appsearch_entry(hdb
, "'HAGRYPHUS', 'hagryphus'");
9144 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9146 r
= add_appsearch_entry(hdb
, "'IGUANODON', 'iguanodon'");
9147 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9149 r
= add_appsearch_entry(hdb
, "'JOBARIA', 'jobaria'");
9150 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9152 r
= add_appsearch_entry(hdb
, "'KAKURU', 'kakuru'");
9153 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9155 r
= add_appsearch_entry(hdb
, "'LABOCANIA', 'labocania'");
9156 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9158 r
= add_appsearch_entry(hdb
, "'MEGARAPTOR', 'megaraptor'");
9159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9161 r
= add_appsearch_entry(hdb
, "'NEOSODON', 'neosodon'");
9162 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9164 r
= add_appsearch_entry(hdb
, "'OLOROTITAN', 'olorotitan'");
9165 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9167 r
= add_appsearch_entry(hdb
, "'PANTYDRACO', 'pantydraco'");
9168 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9170 r
= create_complocator_table(hdb
);
9171 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9173 r
= add_complocator_entry(hdb
, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
9174 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9176 r
= add_complocator_entry(hdb
, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
9177 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9179 r
= add_complocator_entry(hdb
, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
9180 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9182 r
= add_complocator_entry(hdb
, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
9183 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9185 r
= add_complocator_entry(hdb
, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
9186 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9188 r
= add_complocator_entry(hdb
, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
9189 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9191 r
= add_complocator_entry(hdb
, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
9192 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9194 r
= add_complocator_entry(hdb
, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
9195 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9197 r
= add_complocator_entry(hdb
, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
9198 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9200 r
= add_complocator_entry(hdb
, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
9201 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9203 r
= add_complocator_entry(hdb
, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
9204 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9206 r
= add_complocator_entry(hdb
, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
9207 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9209 r
= add_complocator_entry(hdb
, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
9210 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9212 r
= add_complocator_entry(hdb
, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
9213 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9215 r
= add_complocator_entry(hdb
, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
9216 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9218 r
= add_complocator_entry(hdb
, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
9219 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9221 r
= create_signature_table(hdb
);
9222 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9224 r
= add_signature_entry(hdb
, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
9225 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9227 r
= add_signature_entry(hdb
, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
9228 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9230 r
= add_signature_entry(hdb
, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
9231 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9233 r
= add_signature_entry(hdb
, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
9234 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9236 r
= add_signature_entry(hdb
, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
9237 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9239 r
= add_signature_entry(hdb
, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
9240 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9242 r
= add_signature_entry(hdb
, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
9243 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9245 r
= add_signature_entry(hdb
, "'labocania', 'labocania', '', '', '', '', '', '', ''");
9246 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9248 hpkg
= package_from_db(hdb
);
9249 ok(hpkg
, "failed to create package\n");
9251 MsiCloseHandle(hdb
);
9253 create_test_file("abelisaurus");
9254 create_test_file("bactrosaurus");
9255 create_test_file("camelotia");
9256 create_test_file("diclonius");
9257 create_test_file("echinodon");
9258 create_test_file("falcarius");
9259 create_test_file("gallimimus");
9260 create_test_file("hagryphus");
9261 CreateDirectoryA("iguanodon", NULL
);
9262 CreateDirectoryA("jobaria", NULL
);
9263 CreateDirectoryA("kakuru", NULL
);
9264 CreateDirectoryA("labocania", NULL
);
9265 CreateDirectoryA("megaraptor", NULL
);
9266 CreateDirectoryA("neosodon", NULL
);
9267 CreateDirectoryA("olorotitan", NULL
);
9268 CreateDirectoryA("pantydraco", NULL
);
9270 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE
,
9271 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL
, FALSE
);
9272 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE
,
9273 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL
, FALSE
);
9274 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE
,
9275 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL
, FALSE
);
9276 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE
,
9277 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL
, FALSE
);
9278 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE
,
9279 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL
, FALSE
);
9280 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE
,
9281 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL
, FALSE
);
9282 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE
,
9283 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL
, FALSE
);
9284 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE
,
9285 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL
, FALSE
);
9287 r
= MsiDoAction(hpkg
, "AppSearch");
9288 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9291 r
= MsiGetPropertyA(hpkg
, "ABELISAURUS", prop
, &size
);
9292 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9294 lstrcpyA(expected
, CURR_DIR
);
9295 lstrcatA(expected
, "\\abelisaurus");
9296 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9297 "Expected %s or empty string, got %s\n", expected
, prop
);
9300 r
= MsiGetPropertyA(hpkg
, "BACTROSAURUS", prop
, &size
);
9301 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9302 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9305 r
= MsiGetPropertyA(hpkg
, "CAMELOTIA", prop
, &size
);
9306 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9307 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9310 r
= MsiGetPropertyA(hpkg
, "DICLONIUS", prop
, &size
);
9311 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9312 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9315 r
= MsiGetPropertyA(hpkg
, "ECHINODON", prop
, &size
);
9316 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9318 lstrcpyA(expected
, CURR_DIR
);
9319 lstrcatA(expected
, "\\");
9320 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9321 "Expected %s or empty string, got %s\n", expected
, prop
);
9324 r
= MsiGetPropertyA(hpkg
, "FALCARIUS", prop
, &size
);
9325 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9326 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9329 r
= MsiGetPropertyA(hpkg
, "GALLIMIMUS", prop
, &size
);
9330 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9331 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9334 r
= MsiGetPropertyA(hpkg
, "HAGRYPHUS", prop
, &size
);
9335 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9336 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9339 r
= MsiGetPropertyA(hpkg
, "IGUANODON", prop
, &size
);
9340 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9341 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9344 r
= MsiGetPropertyA(hpkg
, "JOBARIA", prop
, &size
);
9345 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9346 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9349 r
= MsiGetPropertyA(hpkg
, "KAKURU", prop
, &size
);
9350 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9351 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9354 r
= MsiGetPropertyA(hpkg
, "LABOCANIA", prop
, &size
);
9355 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9356 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9359 r
= MsiGetPropertyA(hpkg
, "MEGARAPTOR", prop
, &size
);
9360 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9362 lstrcpyA(expected
, CURR_DIR
);
9363 lstrcatA(expected
, "\\");
9364 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9365 "Expected %s or empty string, got %s\n", expected
, prop
);
9368 r
= MsiGetPropertyA(hpkg
, "NEOSODON", prop
, &size
);
9369 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9371 lstrcpyA(expected
, CURR_DIR
);
9372 lstrcatA(expected
, "\\neosodon\\");
9373 ok(!lstrcmpA(prop
, expected
) || !lstrcmpA(prop
, ""),
9374 "Expected %s or empty string, got %s\n", expected
, prop
);
9377 r
= MsiGetPropertyA(hpkg
, "OLOROTITAN", prop
, &size
);
9378 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9379 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9382 r
= MsiGetPropertyA(hpkg
, "PANTYDRACO", prop
, &size
);
9383 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9384 ok(!lstrcmpA(prop
, ""), "Expected , got %s\n", prop
);
9386 MsiCloseHandle(hpkg
);
9387 DeleteFileA("abelisaurus");
9388 DeleteFileA("bactrosaurus");
9389 DeleteFileA("camelotia");
9390 DeleteFileA("diclonius");
9391 DeleteFileA("echinodon");
9392 DeleteFileA("falcarius");
9393 DeleteFileA("gallimimus");
9394 DeleteFileA("hagryphus");
9395 RemoveDirectoryA("iguanodon");
9396 RemoveDirectoryA("jobaria");
9397 RemoveDirectoryA("kakuru");
9398 RemoveDirectoryA("labocania");
9399 RemoveDirectoryA("megaraptor");
9400 RemoveDirectoryA("neosodon");
9401 RemoveDirectoryA("olorotitan");
9402 RemoveDirectoryA("pantydraco");
9403 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
9404 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9405 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
9406 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9407 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
9408 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9409 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
9410 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9411 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
9412 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9413 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
9414 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9415 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
9416 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9417 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
9418 MSIINSTALLCONTEXT_MACHINE
, NULL
);
9419 DeleteFileA(msifile
);
9422 static void set_suminfo_prop(MSIHANDLE db
, DWORD prop
, DWORD val
)
9427 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
9428 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9430 r
= MsiSummaryInfoSetPropertyA(summary
, prop
, VT_I4
, val
, NULL
, NULL
);
9431 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9433 r
= MsiSummaryInfoPersist(summary
);
9434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
9436 MsiCloseHandle(summary
);
9439 static void test_MsiGetSourcePath(void)
9441 MSIHANDLE hdb
, hpkg
;
9442 CHAR path
[MAX_PATH
];
9444 CHAR subsrc
[MAX_PATH
];
9445 CHAR sub2
[MAX_PATH
];
9449 lstrcpyA(cwd
, CURR_DIR
);
9450 lstrcatA(cwd
, "\\");
9452 lstrcpyA(subsrc
, cwd
);
9453 lstrcatA(subsrc
, "subsource");
9454 lstrcatA(subsrc
, "\\");
9456 lstrcpyA(sub2
, subsrc
);
9457 lstrcatA(sub2
, "sub2");
9458 lstrcatA(sub2
, "\\");
9460 /* uncompressed source */
9462 hdb
= create_package_db();
9463 ok( hdb
, "failed to create database\n");
9465 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
9467 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
9468 ok(r
== S_OK
, "failed\n");
9470 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
9471 ok(r
== S_OK
, "failed\n");
9473 r
= add_directory_entry(hdb
, "'SubDir2', 'SubDir', 'sub2'");
9474 ok(r
== S_OK
, "failed\n");
9476 r
= MsiDatabaseCommit(hdb
);
9477 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
9479 hpkg
= package_from_db(hdb
);
9480 ok(hpkg
, "failed to create package\n");
9482 MsiCloseHandle(hdb
);
9484 /* invalid database handle */
9486 lstrcpyA(path
, "kiwi");
9487 r
= MsiGetSourcePath(-1, "TARGETDIR", path
, &size
);
9488 ok(r
== ERROR_INVALID_HANDLE
,
9489 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
9490 ok(!lstrcmpA(path
, "kiwi"),
9491 "Expected path to be unchanged, got \"%s\"\n", path
);
9492 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9496 lstrcpyA(path
, "kiwi");
9497 r
= MsiGetSourcePath(hpkg
, NULL
, path
, &size
);
9498 ok(r
== ERROR_INVALID_PARAMETER
,
9499 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
9500 ok(!lstrcmpA(path
, "kiwi"),
9501 "Expected path to be unchanged, got \"%s\"\n", path
);
9502 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9504 /* empty szFolder */
9506 lstrcpyA(path
, "kiwi");
9507 r
= MsiGetSourcePath(hpkg
, "", path
, &size
);
9508 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9509 ok(!lstrcmpA(path
, "kiwi"),
9510 "Expected path to be unchanged, got \"%s\"\n", path
);
9511 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9515 lstrcpyA(path
, "kiwi");
9516 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9517 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9518 ok(!lstrcmpA(path
, "kiwi"),
9519 "Expected path to be unchanged, got \"%s\"\n", path
);
9520 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9524 lstrcpyA(path
, "kiwi");
9525 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9526 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9527 ok(!lstrcmpA(path
, "kiwi"),
9528 "Expected path to be unchanged, got \"%s\"\n", path
);
9529 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9533 lstrcpyA(path
, "kiwi");
9534 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9535 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9536 ok(!lstrcmpA(path
, "kiwi"),
9537 "Expected path to be unchanged, got \"%s\"\n", path
);
9538 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9540 /* source path does not exist, but the property exists */
9542 lstrcpyA(path
, "kiwi");
9543 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9544 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9545 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
9546 ok(size
== 0, "Expected 0, got %d\n", size
);
9550 lstrcpyA(path
, "kiwi");
9551 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9552 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9553 ok(!lstrcmpA(path
, "kiwi"),
9554 "Expected path to be unchanged, got \"%s\"\n", path
);
9555 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9559 lstrcpyA(path
, "kiwi");
9560 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9561 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9562 ok(!lstrcmpA(path
, "kiwi"),
9563 "Expected path to be unchanged, got \"%s\"\n", path
);
9564 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9566 r
= MsiDoAction(hpkg
, "CostInitialize");
9567 ok(r
== ERROR_SUCCESS
, "cost init failed\n");
9569 /* try TARGETDIR after CostInitialize */
9571 lstrcpyA(path
, "kiwi");
9572 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9573 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9574 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9575 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9577 /* try SourceDir after CostInitialize */
9579 lstrcpyA(path
, "kiwi");
9580 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9581 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9582 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9583 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9585 /* try SOURCEDIR after CostInitialize */
9587 lstrcpyA(path
, "kiwi");
9588 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9589 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9590 ok(!lstrcmpA(path
, "kiwi"),
9591 "Expected path to be unchanged, got \"%s\"\n", path
);
9592 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9594 /* source path does not exist, but the property exists */
9596 lstrcpyA(path
, "kiwi");
9597 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9598 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9601 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9602 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9605 /* try SubDir after CostInitialize */
9607 lstrcpyA(path
, "kiwi");
9608 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9610 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9611 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9613 /* try SubDir2 after CostInitialize */
9615 lstrcpyA(path
, "kiwi");
9616 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9617 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9618 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
9619 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
9621 r
= MsiDoAction(hpkg
, "ResolveSource");
9622 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9624 /* try TARGETDIR after ResolveSource */
9626 lstrcpyA(path
, "kiwi");
9627 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9628 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9629 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9630 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9632 /* try SourceDir after ResolveSource */
9634 lstrcpyA(path
, "kiwi");
9635 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9636 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9637 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9638 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9640 /* try SOURCEDIR after ResolveSource */
9642 lstrcpyA(path
, "kiwi");
9643 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9644 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9645 ok(!lstrcmpA(path
, "kiwi"),
9646 "Expected path to be unchanged, got \"%s\"\n", path
);
9647 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9649 /* source path does not exist, but the property exists */
9651 lstrcpyA(path
, "kiwi");
9652 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
9653 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9654 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9655 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9657 /* try SubDir after ResolveSource */
9659 lstrcpyA(path
, "kiwi");
9660 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9661 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9662 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9663 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9665 /* try SubDir2 after ResolveSource */
9667 lstrcpyA(path
, "kiwi");
9668 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9669 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9670 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
9671 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
9673 r
= MsiDoAction(hpkg
, "FileCost");
9674 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9676 /* try TARGETDIR after FileCost */
9678 lstrcpyA(path
, "kiwi");
9679 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9680 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9681 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9682 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9684 /* try SourceDir after FileCost */
9686 lstrcpyA(path
, "kiwi");
9687 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9688 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9689 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9690 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9692 /* try SOURCEDIR after FileCost */
9694 lstrcpyA(path
, "kiwi");
9695 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9696 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9697 ok(!lstrcmpA(path
, "kiwi"),
9698 "Expected path to be unchanged, got \"%s\"\n", path
);
9699 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9701 /* try SubDir after FileCost */
9703 lstrcpyA(path
, "kiwi");
9704 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9705 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9706 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9707 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9709 /* try SubDir2 after FileCost */
9711 lstrcpyA(path
, "kiwi");
9712 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9713 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9714 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
9715 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
9717 r
= MsiDoAction(hpkg
, "CostFinalize");
9718 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9720 /* try TARGETDIR after CostFinalize */
9722 lstrcpyA(path
, "kiwi");
9723 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9725 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9726 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9728 /* try SourceDir after CostFinalize */
9730 lstrcpyA(path
, "kiwi");
9731 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9732 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9733 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9734 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9736 /* try SOURCEDIR after CostFinalize */
9738 lstrcpyA(path
, "kiwi");
9739 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9740 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9741 ok(!lstrcmpA(path
, "kiwi"),
9742 "Expected path to be unchanged, got \"%s\"\n", path
);
9743 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9745 /* try SubDir after CostFinalize */
9747 lstrcpyA(path
, "kiwi");
9748 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9749 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9750 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9751 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9753 /* try SubDir2 after CostFinalize */
9755 lstrcpyA(path
, "kiwi");
9756 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9757 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9758 ok(!lstrcmpA(path
, sub2
), "Expected \"%s\", got \"%s\"\n", sub2
, path
);
9759 ok(size
== lstrlenA(sub2
), "Expected %d, got %d\n", lstrlenA(sub2
), size
);
9761 /* nonexistent directory */
9763 lstrcpyA(path
, "kiwi");
9764 r
= MsiGetSourcePath(hpkg
, "IDontExist", path
, &size
);
9765 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
9766 ok(!lstrcmpA(path
, "kiwi"),
9767 "Expected path to be unchanged, got \"%s\"\n", path
);
9768 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
9770 /* NULL szPathBuf */
9772 r
= MsiGetSourcePath(hpkg
, "SourceDir", NULL
, &size
);
9773 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9774 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9776 /* NULL pcchPathBuf */
9777 lstrcpyA(path
, "kiwi");
9778 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, NULL
);
9779 ok(r
== ERROR_INVALID_PARAMETER
,
9780 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
9781 ok(!lstrcmpA(path
, "kiwi"),
9782 "Expected path to be unchanged, got \"%s\"\n", path
);
9784 /* pcchPathBuf is 0 */
9786 lstrcpyA(path
, "kiwi");
9787 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9788 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
9789 ok(!lstrcmpA(path
, "kiwi"),
9790 "Expected path to be unchanged, got \"%s\"\n", path
);
9791 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9793 /* pcchPathBuf does not have room for NULL terminator */
9794 size
= lstrlenA(cwd
);
9795 lstrcpyA(path
, "kiwi");
9796 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9797 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
9798 ok(!strncmp(path
, cwd
, lstrlenA(cwd
) - 1),
9799 "Expected path with no backslash, got \"%s\"\n", path
);
9800 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9802 /* pcchPathBuf has room for NULL terminator */
9803 size
= lstrlenA(cwd
) + 1;
9804 lstrcpyA(path
, "kiwi");
9805 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9806 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9807 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9808 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9810 MsiCloseHandle(hpkg
);
9812 /* compressed source */
9814 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
9815 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9817 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeCompressed
);
9819 hpkg
= package_from_db(hdb
);
9820 ok(hpkg
, "failed to create package\n");
9822 r
= MsiDoAction(hpkg
, "CostInitialize");
9823 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9824 r
= MsiDoAction(hpkg
, "FileCost");
9825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9826 r
= MsiDoAction(hpkg
, "CostFinalize");
9827 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9829 /* try TARGETDIR after CostFinalize */
9831 lstrcpyA(path
, "kiwi");
9832 r
= MsiGetSourcePath(hpkg
, "TARGETDIR", path
, &size
);
9833 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9834 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9835 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9837 /* try SourceDir after CostFinalize */
9839 lstrcpyA(path
, "kiwi");
9840 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
9841 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9842 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9843 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9845 /* try SOURCEDIR after CostFinalize */
9847 lstrcpyA(path
, "kiwi");
9848 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
9851 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9852 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9853 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9856 /* try SubDir after CostFinalize */
9858 lstrcpyA(path
, "kiwi");
9859 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9860 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9861 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9862 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9864 /* try SubDir2 after CostFinalize */
9866 lstrcpyA(path
, "kiwi");
9867 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9868 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9869 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
9870 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
9872 MsiCloseHandle(hpkg
);
9873 DeleteFile(msifile
);
9876 static void test_shortlongsource(void)
9878 MSIHANDLE hdb
, hpkg
;
9879 CHAR path
[MAX_PATH
];
9881 CHAR subsrc
[MAX_PATH
];
9885 lstrcpyA(cwd
, CURR_DIR
);
9886 lstrcatA(cwd
, "\\");
9888 lstrcpyA(subsrc
, cwd
);
9889 lstrcatA(subsrc
, "long");
9890 lstrcatA(subsrc
, "\\");
9892 /* long file names */
9894 hdb
= create_package_db();
9895 ok( hdb
, "failed to create database\n");
9897 set_suminfo_prop(hdb
, PID_WORDCOUNT
, 0);
9899 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
9900 ok(r
== S_OK
, "failed\n");
9902 r
= add_directory_entry(hdb
, "'SubDir', 'TARGETDIR', 'short|long'");
9903 ok(r
== S_OK
, "failed\n");
9905 /* CostInitialize:short */
9906 r
= add_directory_entry(hdb
, "'SubDir2', 'TARGETDIR', 'one|two'");
9907 ok(r
== S_OK
, "failed\n");
9909 /* CostInitialize:long */
9910 r
= add_directory_entry(hdb
, "'SubDir3', 'TARGETDIR', 'three|four'");
9911 ok(r
== S_OK
, "failed\n");
9913 /* FileCost:short */
9914 r
= add_directory_entry(hdb
, "'SubDir4', 'TARGETDIR', 'five|six'");
9915 ok(r
== S_OK
, "failed\n");
9918 r
= add_directory_entry(hdb
, "'SubDir5', 'TARGETDIR', 'seven|eight'");
9919 ok(r
== S_OK
, "failed\n");
9921 /* CostFinalize:short */
9922 r
= add_directory_entry(hdb
, "'SubDir6', 'TARGETDIR', 'nine|ten'");
9923 ok(r
== S_OK
, "failed\n");
9925 /* CostFinalize:long */
9926 r
= add_directory_entry(hdb
, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
9927 ok(r
== S_OK
, "failed\n");
9929 MsiDatabaseCommit(hdb
);
9931 hpkg
= package_from_db(hdb
);
9932 ok(hpkg
, "failed to create package\n");
9934 MsiCloseHandle(hdb
);
9936 CreateDirectoryA("one", NULL
);
9937 CreateDirectoryA("four", NULL
);
9939 r
= MsiDoAction(hpkg
, "CostInitialize");
9940 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9942 CreateDirectory("five", NULL
);
9943 CreateDirectory("eight", NULL
);
9945 r
= MsiDoAction(hpkg
, "FileCost");
9946 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9948 CreateDirectory("nine", NULL
);
9949 CreateDirectory("twelve", NULL
);
9951 r
= MsiDoAction(hpkg
, "CostFinalize");
9952 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
9954 /* neither short nor long source directories exist */
9956 lstrcpyA(path
, "kiwi");
9957 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9958 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9959 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9960 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9962 CreateDirectoryA("short", NULL
);
9964 /* short source directory exists */
9966 lstrcpyA(path
, "kiwi");
9967 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9968 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9969 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9970 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9972 CreateDirectoryA("long", NULL
);
9974 /* both short and long source directories exist */
9976 lstrcpyA(path
, "kiwi");
9977 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
9978 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9979 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9980 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9982 lstrcpyA(subsrc
, cwd
);
9983 lstrcatA(subsrc
, "two");
9984 lstrcatA(subsrc
, "\\");
9986 /* short dir exists before CostInitialize */
9988 lstrcpyA(path
, "kiwi");
9989 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
9990 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
9991 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
9992 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
9994 lstrcpyA(subsrc
, cwd
);
9995 lstrcatA(subsrc
, "four");
9996 lstrcatA(subsrc
, "\\");
9998 /* long dir exists before CostInitialize */
10000 lstrcpyA(path
, "kiwi");
10001 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
10002 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10003 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10004 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10006 lstrcpyA(subsrc
, cwd
);
10007 lstrcatA(subsrc
, "six");
10008 lstrcatA(subsrc
, "\\");
10010 /* short dir exists before FileCost */
10012 lstrcpyA(path
, "kiwi");
10013 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
10014 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10015 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10016 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10018 lstrcpyA(subsrc
, cwd
);
10019 lstrcatA(subsrc
, "eight");
10020 lstrcatA(subsrc
, "\\");
10022 /* long dir exists before FileCost */
10024 lstrcpyA(path
, "kiwi");
10025 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
10026 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10027 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10028 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10030 lstrcpyA(subsrc
, cwd
);
10031 lstrcatA(subsrc
, "ten");
10032 lstrcatA(subsrc
, "\\");
10034 /* short dir exists before CostFinalize */
10036 lstrcpyA(path
, "kiwi");
10037 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
10038 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10039 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10040 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10042 lstrcpyA(subsrc
, cwd
);
10043 lstrcatA(subsrc
, "twelve");
10044 lstrcatA(subsrc
, "\\");
10046 /* long dir exists before CostFinalize */
10048 lstrcpyA(path
, "kiwi");
10049 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
10050 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10051 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10052 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10054 MsiCloseHandle(hpkg
);
10055 RemoveDirectoryA("short");
10056 RemoveDirectoryA("long");
10057 RemoveDirectoryA("one");
10058 RemoveDirectoryA("four");
10059 RemoveDirectoryA("five");
10060 RemoveDirectoryA("eight");
10061 RemoveDirectoryA("nine");
10062 RemoveDirectoryA("twelve");
10064 /* short file names */
10066 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_DIRECT
, &hdb
);
10067 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10069 set_suminfo_prop(hdb
, PID_WORDCOUNT
, msidbSumInfoSourceTypeSFN
);
10071 hpkg
= package_from_db(hdb
);
10072 ok(hpkg
, "failed to create package\n");
10074 MsiCloseHandle(hdb
);
10076 CreateDirectoryA("one", NULL
);
10077 CreateDirectoryA("four", NULL
);
10079 r
= MsiDoAction(hpkg
, "CostInitialize");
10080 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10082 CreateDirectory("five", NULL
);
10083 CreateDirectory("eight", NULL
);
10085 r
= MsiDoAction(hpkg
, "FileCost");
10086 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10088 CreateDirectory("nine", NULL
);
10089 CreateDirectory("twelve", NULL
);
10091 r
= MsiDoAction(hpkg
, "CostFinalize");
10092 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10094 lstrcpyA(subsrc
, cwd
);
10095 lstrcatA(subsrc
, "short");
10096 lstrcatA(subsrc
, "\\");
10098 /* neither short nor long source directories exist */
10100 lstrcpyA(path
, "kiwi");
10101 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10102 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10103 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10104 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10106 CreateDirectoryA("short", NULL
);
10108 /* short source directory exists */
10110 lstrcpyA(path
, "kiwi");
10111 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10112 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10113 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10114 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10116 CreateDirectoryA("long", NULL
);
10118 /* both short and long source directories exist */
10120 lstrcpyA(path
, "kiwi");
10121 r
= MsiGetSourcePath(hpkg
, "SubDir", path
, &size
);
10122 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10123 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10124 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10126 lstrcpyA(subsrc
, cwd
);
10127 lstrcatA(subsrc
, "one");
10128 lstrcatA(subsrc
, "\\");
10130 /* short dir exists before CostInitialize */
10132 lstrcpyA(path
, "kiwi");
10133 r
= MsiGetSourcePath(hpkg
, "SubDir2", path
, &size
);
10134 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10135 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10136 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10138 lstrcpyA(subsrc
, cwd
);
10139 lstrcatA(subsrc
, "three");
10140 lstrcatA(subsrc
, "\\");
10142 /* long dir exists before CostInitialize */
10144 lstrcpyA(path
, "kiwi");
10145 r
= MsiGetSourcePath(hpkg
, "SubDir3", path
, &size
);
10146 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10147 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10148 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10150 lstrcpyA(subsrc
, cwd
);
10151 lstrcatA(subsrc
, "five");
10152 lstrcatA(subsrc
, "\\");
10154 /* short dir exists before FileCost */
10156 lstrcpyA(path
, "kiwi");
10157 r
= MsiGetSourcePath(hpkg
, "SubDir4", path
, &size
);
10158 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10159 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10160 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10162 lstrcpyA(subsrc
, cwd
);
10163 lstrcatA(subsrc
, "seven");
10164 lstrcatA(subsrc
, "\\");
10166 /* long dir exists before FileCost */
10168 lstrcpyA(path
, "kiwi");
10169 r
= MsiGetSourcePath(hpkg
, "SubDir5", path
, &size
);
10170 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10171 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10172 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10174 lstrcpyA(subsrc
, cwd
);
10175 lstrcatA(subsrc
, "nine");
10176 lstrcatA(subsrc
, "\\");
10178 /* short dir exists before CostFinalize */
10180 lstrcpyA(path
, "kiwi");
10181 r
= MsiGetSourcePath(hpkg
, "SubDir6", path
, &size
);
10182 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10183 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10184 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10186 lstrcpyA(subsrc
, cwd
);
10187 lstrcatA(subsrc
, "eleven");
10188 lstrcatA(subsrc
, "\\");
10190 /* long dir exists before CostFinalize */
10192 lstrcpyA(path
, "kiwi");
10193 r
= MsiGetSourcePath(hpkg
, "SubDir7", path
, &size
);
10194 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10195 ok(!lstrcmpA(path
, subsrc
), "Expected \"%s\", got \"%s\"\n", subsrc
, path
);
10196 ok(size
== lstrlenA(subsrc
), "Expected %d, got %d\n", lstrlenA(subsrc
), size
);
10198 MsiCloseHandle(hpkg
);
10199 RemoveDirectoryA("short");
10200 RemoveDirectoryA("long");
10201 RemoveDirectoryA("one");
10202 RemoveDirectoryA("four");
10203 RemoveDirectoryA("five");
10204 RemoveDirectoryA("eight");
10205 RemoveDirectoryA("nine");
10206 RemoveDirectoryA("twelve");
10207 DeleteFileA(msifile
);
10210 static void test_sourcedir(void)
10212 MSIHANDLE hdb
, hpkg
;
10214 CHAR path
[MAX_PATH
];
10215 CHAR cwd
[MAX_PATH
];
10216 CHAR subsrc
[MAX_PATH
];
10220 lstrcpyA(cwd
, CURR_DIR
);
10221 lstrcatA(cwd
, "\\");
10223 lstrcpyA(subsrc
, cwd
);
10224 lstrcatA(subsrc
, "long");
10225 lstrcatA(subsrc
, "\\");
10227 hdb
= create_package_db();
10228 ok( hdb
, "failed to create database\n");
10230 r
= add_directory_entry(hdb
, "'TARGETDIR', '', 'SourceDir'");
10231 ok(r
== S_OK
, "failed\n");
10233 sprintf(package
, "#%i", hdb
);
10234 r
= MsiOpenPackage(package
, &hpkg
);
10235 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10237 /* properties only */
10239 /* SourceDir prop */
10241 lstrcpyA(path
, "kiwi");
10242 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10243 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10244 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10245 ok(size
== 0, "Expected 0, got %d\n", size
);
10247 /* SOURCEDIR prop */
10249 lstrcpyA(path
, "kiwi");
10250 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10251 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10252 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10253 ok(size
== 0, "Expected 0, got %d\n", size
);
10255 r
= MsiDoAction(hpkg
, "CostInitialize");
10256 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10258 /* SourceDir after CostInitialize */
10260 lstrcpyA(path
, "kiwi");
10261 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10262 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10263 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10264 ok(size
== 0, "Expected 0, got %d\n", size
);
10266 /* SOURCEDIR after CostInitialize */
10268 lstrcpyA(path
, "kiwi");
10269 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10270 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10271 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10272 ok(size
== 0, "Expected 0, got %d\n", size
);
10274 r
= MsiDoAction(hpkg
, "FileCost");
10275 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10277 /* SourceDir after FileCost */
10279 lstrcpyA(path
, "kiwi");
10280 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10281 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10282 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10283 ok(size
== 0, "Expected 0, got %d\n", size
);
10285 /* SOURCEDIR after FileCost */
10287 lstrcpyA(path
, "kiwi");
10288 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10289 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10290 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10291 ok(size
== 0, "Expected 0, got %d\n", size
);
10293 r
= MsiDoAction(hpkg
, "CostFinalize");
10294 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10296 /* SourceDir after CostFinalize */
10298 lstrcpyA(path
, "kiwi");
10299 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10300 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10301 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10302 ok(size
== 0, "Expected 0, got %d\n", size
);
10304 /* SOURCEDIR after CostFinalize */
10306 lstrcpyA(path
, "kiwi");
10307 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10308 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10309 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10310 ok(size
== 0, "Expected 0, got %d\n", size
);
10312 r
= MsiDoAction(hpkg
, "ResolveSource");
10313 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10315 /* SourceDir after ResolveSource */
10317 lstrcpyA(path
, "kiwi");
10318 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10319 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10320 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10321 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10323 /* SOURCEDIR after ResolveSource */
10325 lstrcpyA(path
, "kiwi");
10326 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10327 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10328 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10329 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10331 /* random casing */
10333 lstrcpyA(path
, "kiwi");
10334 r
= MsiGetProperty(hpkg
, "SoUrCeDiR", path
, &size
);
10335 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10336 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10337 ok(size
== 0, "Expected 0, got %d\n", size
);
10339 MsiCloseHandle(hpkg
);
10341 /* reset the package state */
10342 sprintf(package
, "#%i", hdb
);
10343 r
= MsiOpenPackage(package
, &hpkg
);
10344 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10346 /* test how MsiGetSourcePath affects the properties */
10348 /* SourceDir prop */
10350 lstrcpyA(path
, "kiwi");
10351 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10352 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10355 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10356 ok(size
== 0, "Expected 0, got %d\n", size
);
10360 lstrcpyA(path
, "kiwi");
10361 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10362 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10363 ok(!lstrcmpA(path
, "kiwi"),
10364 "Expected path to be unchanged, got \"%s\"\n", path
);
10365 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10367 /* SourceDir after MsiGetSourcePath */
10369 lstrcpyA(path
, "kiwi");
10370 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10371 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10374 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10375 ok(size
== 0, "Expected 0, got %d\n", size
);
10378 /* SOURCEDIR prop */
10380 lstrcpyA(path
, "kiwi");
10381 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10382 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10385 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10386 ok(size
== 0, "Expected 0, got %d\n", size
);
10390 lstrcpyA(path
, "kiwi");
10391 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10392 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10393 ok(!lstrcmpA(path
, "kiwi"),
10394 "Expected path to be unchanged, got \"%s\"\n", path
);
10395 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10397 /* SOURCEDIR prop after MsiGetSourcePath */
10399 lstrcpyA(path
, "kiwi");
10400 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10401 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10404 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10405 ok(size
== 0, "Expected 0, got %d\n", size
);
10408 r
= MsiDoAction(hpkg
, "CostInitialize");
10409 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10411 /* SourceDir after CostInitialize */
10413 lstrcpyA(path
, "kiwi");
10414 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10415 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10418 ok(!lstrcmpA(path
, ""), "Expected \"\", got \"%s\"\n", path
);
10419 ok(size
== 0, "Expected 0, got %d\n", size
);
10423 lstrcpyA(path
, "kiwi");
10424 r
= MsiGetSourcePath(hpkg
, "SourceDir", path
, &size
);
10425 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10426 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10427 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10429 /* SourceDir after MsiGetSourcePath */
10431 lstrcpyA(path
, "kiwi");
10432 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10433 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10434 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10435 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10437 /* SOURCEDIR after CostInitialize */
10439 lstrcpyA(path
, "kiwi");
10440 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10441 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10442 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10443 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10445 /* SOURCEDIR source path still does not exist */
10447 lstrcpyA(path
, "kiwi");
10448 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10449 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10450 ok(!lstrcmpA(path
, "kiwi"),
10451 "Expected path to be unchanged, got \"%s\"\n", path
);
10452 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10454 r
= MsiDoAction(hpkg
, "FileCost");
10455 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10457 /* SourceDir after FileCost */
10459 lstrcpyA(path
, "kiwi");
10460 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10461 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10462 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10463 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10465 /* SOURCEDIR after FileCost */
10467 lstrcpyA(path
, "kiwi");
10468 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10469 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10470 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10471 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10473 /* SOURCEDIR source path still does not exist */
10475 lstrcpyA(path
, "kiwi");
10476 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10477 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10478 ok(!lstrcmpA(path
, "kiwi"),
10479 "Expected path to be unchanged, got \"%s\"\n", path
);
10480 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10482 r
= MsiDoAction(hpkg
, "CostFinalize");
10483 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10485 /* SourceDir after CostFinalize */
10487 lstrcpyA(path
, "kiwi");
10488 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10489 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10490 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10491 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10493 /* SOURCEDIR after CostFinalize */
10495 lstrcpyA(path
, "kiwi");
10496 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10497 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10498 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10499 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10501 /* SOURCEDIR source path still does not exist */
10503 lstrcpyA(path
, "kiwi");
10504 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10505 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10506 ok(!lstrcmpA(path
, "kiwi"),
10507 "Expected path to be unchanged, got \"%s\"\n", path
);
10508 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10510 r
= MsiDoAction(hpkg
, "ResolveSource");
10511 ok(r
== ERROR_SUCCESS
, "file cost failed\n");
10513 /* SourceDir after ResolveSource */
10515 lstrcpyA(path
, "kiwi");
10516 r
= MsiGetProperty(hpkg
, "SourceDir", path
, &size
);
10517 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10518 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10519 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10521 /* SOURCEDIR after ResolveSource */
10523 lstrcpyA(path
, "kiwi");
10524 r
= MsiGetProperty(hpkg
, "SOURCEDIR", path
, &size
);
10525 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10526 ok(!lstrcmpA(path
, cwd
), "Expected \"%s\", got \"%s\"\n", cwd
, path
);
10527 ok(size
== lstrlenA(cwd
), "Expected %d, got %d\n", lstrlenA(cwd
), size
);
10529 /* SOURCEDIR source path still does not exist */
10531 lstrcpyA(path
, "kiwi");
10532 r
= MsiGetSourcePath(hpkg
, "SOURCEDIR", path
, &size
);
10533 ok(r
== ERROR_DIRECTORY
, "Expected ERROR_DIRECTORY, got %d\n", r
);
10534 ok(!lstrcmpA(path
, "kiwi"),
10535 "Expected path to be unchanged, got \"%s\"\n", path
);
10536 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10538 MsiCloseHandle(hdb
);
10539 MsiCloseHandle(hpkg
);
10540 DeleteFileA(msifile
);
10550 static const struct access_res create
[16] =
10552 { TRUE
, ERROR_SUCCESS
, TRUE
},
10553 { TRUE
, ERROR_SUCCESS
, TRUE
},
10554 { TRUE
, ERROR_SUCCESS
, FALSE
},
10555 { TRUE
, ERROR_SUCCESS
, FALSE
},
10556 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10557 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10558 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10559 { TRUE
, ERROR_SUCCESS
, FALSE
},
10560 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10561 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10562 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10563 { TRUE
, ERROR_SUCCESS
, TRUE
},
10564 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10565 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10566 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10567 { TRUE
, ERROR_SUCCESS
, TRUE
}
10570 static const struct access_res create_commit
[16] =
10572 { TRUE
, ERROR_SUCCESS
, TRUE
},
10573 { TRUE
, ERROR_SUCCESS
, TRUE
},
10574 { TRUE
, ERROR_SUCCESS
, FALSE
},
10575 { TRUE
, ERROR_SUCCESS
, FALSE
},
10576 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10577 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10578 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10579 { TRUE
, ERROR_SUCCESS
, FALSE
},
10580 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10581 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10582 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10583 { TRUE
, ERROR_SUCCESS
, TRUE
},
10584 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10585 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10586 { FALSE
, ERROR_SHARING_VIOLATION
, FALSE
},
10587 { TRUE
, ERROR_SUCCESS
, TRUE
}
10590 static const struct access_res create_close
[16] =
10592 { TRUE
, ERROR_SUCCESS
, FALSE
},
10593 { TRUE
, ERROR_SUCCESS
, FALSE
},
10594 { TRUE
, ERROR_SUCCESS
, FALSE
},
10595 { TRUE
, ERROR_SUCCESS
, FALSE
},
10596 { TRUE
, ERROR_SUCCESS
, FALSE
},
10597 { TRUE
, ERROR_SUCCESS
, FALSE
},
10598 { TRUE
, ERROR_SUCCESS
, FALSE
},
10599 { TRUE
, ERROR_SUCCESS
, FALSE
},
10600 { TRUE
, ERROR_SUCCESS
, FALSE
},
10601 { TRUE
, ERROR_SUCCESS
, FALSE
},
10602 { TRUE
, ERROR_SUCCESS
, FALSE
},
10603 { TRUE
, ERROR_SUCCESS
, FALSE
},
10604 { TRUE
, ERROR_SUCCESS
, FALSE
},
10605 { TRUE
, ERROR_SUCCESS
, FALSE
},
10606 { TRUE
, ERROR_SUCCESS
, FALSE
},
10607 { TRUE
, ERROR_SUCCESS
}
10610 static void _test_file_access(LPCSTR file
, const struct access_res
*ares
, DWORD line
)
10612 DWORD access
= 0, share
= 0;
10617 for (i
= 0; i
< 4; i
++)
10619 if (i
== 0) access
= 0;
10620 if (i
== 1) access
= GENERIC_READ
;
10621 if (i
== 2) access
= GENERIC_WRITE
;
10622 if (i
== 3) access
= GENERIC_READ
| GENERIC_WRITE
;
10624 for (j
= 0; j
< 4; j
++)
10626 if (ares
[idx
].ignore
)
10629 if (j
== 0) share
= 0;
10630 if (j
== 1) share
= FILE_SHARE_READ
;
10631 if (j
== 2) share
= FILE_SHARE_WRITE
;
10632 if (j
== 3) share
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
10634 SetLastError(0xdeadbeef);
10635 hfile
= CreateFileA(file
, access
, share
, NULL
, OPEN_EXISTING
,
10636 FILE_ATTRIBUTE_NORMAL
, 0);
10637 lasterr
= GetLastError();
10639 ok((hfile
!= INVALID_HANDLE_VALUE
) == ares
[idx
].gothandle
,
10640 "(%d, handle, %d): Expected %d, got %d\n",
10641 line
, idx
, ares
[idx
].gothandle
,
10642 (hfile
!= INVALID_HANDLE_VALUE
));
10644 ok(lasterr
== ares
[idx
].lasterr
||
10645 lasterr
== 0xdeadbeef, /* win9x */
10646 "(%d, lasterr, %d): Expected %d, got %d\n",
10647 line
, idx
, ares
[idx
].lasterr
, lasterr
);
10649 CloseHandle(hfile
);
10655 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
10657 static void test_access(void)
10662 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATE
, &hdb
);
10663 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10665 test_file_access(msifile
, create
);
10667 r
= MsiDatabaseCommit(hdb
);
10668 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10670 test_file_access(msifile
, create_commit
);
10672 MsiCloseHandle(hdb
);
10674 test_file_access(msifile
, create_close
);
10676 DeleteFileA(msifile
);
10678 r
= MsiOpenDatabaseA(msifile
, MSIDBOPEN_CREATEDIRECT
, &hdb
);
10679 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10681 test_file_access(msifile
, create
);
10683 r
= MsiDatabaseCommit(hdb
);
10684 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10686 test_file_access(msifile
, create_commit
);
10688 MsiCloseHandle(hdb
);
10690 test_file_access(msifile
, create_close
);
10692 DeleteFileA(msifile
);
10695 static void test_emptypackage(void)
10697 MSIHANDLE hpkg
, hdb
, hsuminfo
;
10698 MSIHANDLE hview
, hrec
;
10699 MSICONDITION condition
;
10700 CHAR buffer
[MAX_PATH
];
10704 r
= MsiOpenPackageA("", &hpkg
);
10707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10710 hdb
= MsiGetActiveDatabase(hpkg
);
10713 ok(hdb
!= 0, "Expected a valid database handle\n");
10716 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Tables`", &hview
);
10719 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10721 r
= MsiViewExecute(hview
, 0);
10724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10727 r
= MsiViewFetch(hview
, &hrec
);
10730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10734 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
10737 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10738 ok(!lstrcmpA(buffer
, "_Property"),
10739 "Expected \"_Property\", got \"%s\"\n", buffer
);
10742 MsiCloseHandle(hrec
);
10744 r
= MsiViewFetch(hview
, &hrec
);
10747 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10751 r
= MsiRecordGetString(hrec
, 1, buffer
, &size
);
10754 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10755 ok(!lstrcmpA(buffer
, "#_FolderCache"),
10756 "Expected \"_Property\", got \"%s\"\n", buffer
);
10759 MsiCloseHandle(hrec
);
10760 MsiViewClose(hview
);
10761 MsiCloseHandle(hview
);
10763 condition
= MsiDatabaseIsTablePersistentA(hdb
, "_Property");
10766 ok(condition
== MSICONDITION_FALSE
,
10767 "Expected MSICONDITION_FALSE, got %d\n", condition
);
10770 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Property`", &hview
);
10773 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10775 r
= MsiViewExecute(hview
, 0);
10778 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10781 /* _Property table is not empty */
10782 r
= MsiViewFetch(hview
, &hrec
);
10785 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10788 MsiCloseHandle(hrec
);
10789 MsiViewClose(hview
);
10790 MsiCloseHandle(hview
);
10792 condition
= MsiDatabaseIsTablePersistentA(hdb
, "#_FolderCache");
10795 ok(condition
== MSICONDITION_FALSE
,
10796 "Expected MSICONDITION_FALSE, got %d\n", condition
);
10799 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `#_FolderCache`", &hview
);
10802 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10804 r
= MsiViewExecute(hview
, 0);
10807 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10810 /* #_FolderCache is not empty */
10811 r
= MsiViewFetch(hview
, &hrec
);
10814 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10817 MsiCloseHandle(hrec
);
10818 MsiViewClose(hview
);
10819 MsiCloseHandle(hview
);
10821 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Streams`", &hview
);
10824 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
10825 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
10828 r
= MsiDatabaseOpenView(hdb
, "SELECT * FROM `_Storages`", &hview
);
10831 ok(r
== ERROR_BAD_QUERY_SYNTAX
,
10832 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r
);
10835 r
= MsiGetSummaryInformationA(hdb
, NULL
, 0, &hsuminfo
);
10838 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
,
10839 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r
);
10842 MsiCloseHandle(hsuminfo
);
10844 r
= MsiDatabaseCommit(hdb
);
10847 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10850 MsiCloseHandle(hdb
);
10851 MsiCloseHandle(hpkg
);
10854 static void test_MsiGetProductProperty(void)
10856 MSIHANDLE hprod
, hdb
;
10857 CHAR val
[MAX_PATH
];
10858 CHAR path
[MAX_PATH
];
10859 CHAR query
[MAX_PATH
];
10860 CHAR keypath
[MAX_PATH
*2];
10861 CHAR prodcode
[MAX_PATH
];
10862 CHAR prod_squashed
[MAX_PATH
];
10863 HKEY prodkey
, userkey
, props
;
10870 scm
= OpenSCManager(NULL
, NULL
, SC_MANAGER_CONNECT
);
10871 if (!scm
&& (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED
))
10873 win_skip("Different registry keys on Win9x and WinMe\n");
10876 CloseServiceHandle(scm
);
10878 GetCurrentDirectoryA(MAX_PATH
, path
);
10879 lstrcatA(path
, "\\");
10881 create_test_guid(prodcode
, prod_squashed
);
10882 get_user_sid(&usersid
);
10884 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_CREATE
, &hdb
);
10885 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10887 r
= MsiDatabaseCommit(hdb
);
10888 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10890 r
= set_summary_info(hdb
);
10891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10894 "CREATE TABLE `Directory` ( "
10895 "`Directory` CHAR(255) NOT NULL, "
10896 "`Directory_Parent` CHAR(255), "
10897 "`DefaultDir` CHAR(255) NOT NULL "
10898 "PRIMARY KEY `Directory`)");
10899 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10902 "CREATE TABLE `Property` ( "
10903 "`Property` CHAR(72) NOT NULL, "
10904 "`Value` CHAR(255) "
10905 "PRIMARY KEY `Property`)");
10906 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10908 sprintf(query
, "INSERT INTO `Property` "
10909 "(`Property`, `Value`) "
10910 "VALUES( 'ProductCode', '%s' )", prodcode
);
10911 r
= run_query(hdb
, query
);
10912 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10914 r
= MsiDatabaseCommit(hdb
);
10915 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10917 MsiCloseHandle(hdb
);
10919 lstrcpyA(keypath
, "Software\\Classes\\Installer\\Products\\");
10920 lstrcatA(keypath
, prod_squashed
);
10922 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, keypath
, &prodkey
);
10923 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
10925 lstrcpyA(keypath
, "Software\\Microsoft\\Windows\\CurrentVersion\\");
10926 lstrcatA(keypath
, "Installer\\UserData\\S-1-5-18\\Products\\");
10927 lstrcatA(keypath
, prod_squashed
);
10929 res
= RegCreateKeyA(HKEY_LOCAL_MACHINE
, keypath
, &userkey
);
10930 if (res
== ERROR_ACCESS_DENIED
)
10932 skip("Not enough rights to perform tests\n");
10933 RegDeleteKeyA(prodkey
, "");
10934 RegCloseKey(prodkey
);
10937 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
10939 res
= RegCreateKeyA(userkey
, "InstallProperties", &props
);
10940 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
10942 lstrcpyA(val
, path
);
10943 lstrcatA(val
, "\\winetest.msi");
10944 res
= RegSetValueExA(props
, "LocalPackage", 0, REG_SZ
,
10945 (const BYTE
*)val
, lstrlenA(val
) + 1);
10946 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
10948 hprod
= 0xdeadbeef;
10949 r
= MsiOpenProductA(prodcode
, &hprod
);
10950 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10951 ok(hprod
!= 0 && hprod
!= 0xdeadbeef, "Expected a valid product handle\n");
10953 /* hProduct is invalid */
10955 lstrcpyA(val
, "apple");
10956 r
= MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val
, &size
);
10957 ok(r
== ERROR_INVALID_HANDLE
,
10958 "Expected ERROR_INVALID_HANDLE, got %d\n", r
);
10959 ok(!lstrcmpA(val
, "apple"),
10960 "Expected val to be unchanged, got \"%s\"\n", val
);
10961 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10963 /* szProperty is NULL */
10965 lstrcpyA(val
, "apple");
10966 r
= MsiGetProductPropertyA(hprod
, NULL
, val
, &size
);
10967 ok(r
== ERROR_INVALID_PARAMETER
,
10968 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
10969 ok(!lstrcmpA(val
, "apple"),
10970 "Expected val to be unchanged, got \"%s\"\n", val
);
10971 ok(size
== MAX_PATH
, "Expected size to be unchanged, got %d\n", size
);
10973 /* szProperty is empty */
10975 lstrcpyA(val
, "apple");
10976 r
= MsiGetProductPropertyA(hprod
, "", val
, &size
);
10977 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10978 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
10979 ok(size
== 0, "Expected 0, got %d\n", size
);
10981 /* get the property */
10983 lstrcpyA(val
, "apple");
10984 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
10985 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10986 ok(!lstrcmpA(val
, prodcode
),
10987 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
10988 ok(size
== lstrlenA(prodcode
),
10989 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
10991 /* lpValueBuf is NULL */
10993 r
= MsiGetProductPropertyA(hprod
, "ProductCode", NULL
, &size
);
10994 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
10995 ok(size
== lstrlenA(prodcode
),
10996 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
10998 /* pcchValueBuf is NULL */
10999 lstrcpyA(val
, "apple");
11000 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, NULL
);
11001 ok(r
== ERROR_INVALID_PARAMETER
,
11002 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
11003 ok(!lstrcmpA(val
, "apple"),
11004 "Expected val to be unchanged, got \"%s\"\n", val
);
11005 ok(size
== lstrlenA(prodcode
),
11006 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11008 /* pcchValueBuf is too small */
11010 lstrcpyA(val
, "apple");
11011 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11012 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11013 ok(!strncmp(val
, prodcode
, 3),
11014 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
11015 ok(size
== lstrlenA(prodcode
),
11016 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11018 /* pcchValueBuf does not leave room for NULL terminator */
11019 size
= lstrlenA(prodcode
);
11020 lstrcpyA(val
, "apple");
11021 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11022 ok(r
== ERROR_MORE_DATA
, "Expected ERROR_MORE_DATA, got %d\n", r
);
11023 ok(!strncmp(val
, prodcode
, lstrlenA(prodcode
) - 1),
11024 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode
, val
);
11025 ok(size
== lstrlenA(prodcode
),
11026 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11028 /* pcchValueBuf has enough room for NULL terminator */
11029 size
= lstrlenA(prodcode
) + 1;
11030 lstrcpyA(val
, "apple");
11031 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11032 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11033 ok(!lstrcmpA(val
, prodcode
),
11034 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
11035 ok(size
== lstrlenA(prodcode
),
11036 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11038 /* nonexistent property */
11040 lstrcpyA(val
, "apple");
11041 r
= MsiGetProductPropertyA(hprod
, "IDontExist", val
, &size
);
11042 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11043 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
11044 ok(size
== 0, "Expected 0, got %d\n", size
);
11046 r
= MsiSetPropertyA(hprod
, "NewProperty", "value");
11047 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11049 /* non-product property set */
11051 lstrcpyA(val
, "apple");
11052 r
= MsiGetProductPropertyA(hprod
, "NewProperty", val
, &size
);
11053 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11054 ok(!lstrcmpA(val
, ""), "Expected \"\", got \"%s\"\n", val
);
11055 ok(size
== 0, "Expected 0, got %d\n", size
);
11057 r
= MsiSetPropertyA(hprod
, "ProductCode", "value");
11058 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11060 /* non-product property that is also a product property set */
11062 lstrcpyA(val
, "apple");
11063 r
= MsiGetProductPropertyA(hprod
, "ProductCode", val
, &size
);
11064 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
11065 ok(!lstrcmpA(val
, prodcode
),
11066 "Expected \"%s\", got \"%s\"\n", prodcode
, val
);
11067 ok(size
== lstrlenA(prodcode
),
11068 "Expected %d, got %d\n", lstrlenA(prodcode
), size
);
11070 MsiCloseHandle(hprod
);
11072 RegDeleteValueA(props
, "LocalPackage");
11073 RegDeleteKeyA(props
, "");
11074 RegCloseKey(props
);
11075 RegDeleteKeyA(userkey
, "");
11076 RegCloseKey(userkey
);
11077 RegDeleteKeyA(prodkey
, "");
11078 RegCloseKey(prodkey
);
11079 DeleteFileA(msifile
);
11082 START_TEST(package
)
11084 GetCurrentDirectoryA(MAX_PATH
, CURR_DIR
);
11086 test_createpackage();
11088 test_gettargetpath_bad();
11089 test_settargetpath();
11091 test_property_table();
11094 test_formatrecord2();
11096 test_getproperty();
11097 test_removefiles();
11099 test_appsearch_complocator();
11100 test_appsearch_reglocator();
11101 test_appsearch_inilocator();
11102 test_appsearch_drlocator();
11103 test_featureparents();
11104 test_installprops();
11105 test_launchconditions();
11107 test_complocator();
11108 test_MsiGetSourcePath();
11109 test_shortlongsource();
11112 test_emptypackage();
11113 test_MsiGetProductProperty();