msi/tests: Don't create a nested restore point on recent versions of MSI.
[wine.git] / dlls / msi / tests / package.c
blob07ab4eb7a4e6c1a5dddc4f33659fa07863827fff
1 /*
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
22 #define COBJMACROS
24 #include <stdio.h>
25 #include <windows.h>
26 #include <msidefs.h>
27 #include <msi.h>
28 #include <msiquery.h>
29 #include <srrestoreptapi.h>
30 #include <shlobj.h>
32 #include "wine/test.h"
34 static BOOL is_wow64;
35 static const char msifile[] = "winetest-package.msi";
36 static char CURR_DIR[MAX_PATH];
38 static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
39 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
40 static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
42 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
43 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
44 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
45 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
46 static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
47 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
48 static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
49 static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
51 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
52 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
54 static void init_functionpointers(void)
56 HMODULE hmsi = GetModuleHandleA("msi.dll");
57 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
58 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
59 HMODULE hshell32 = GetModuleHandleA("shell32.dll");
60 HMODULE hsrclient;
62 #define GET_PROC(mod, func) \
63 p ## func = (void*)GetProcAddress(mod, #func);
65 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
66 GET_PROC(hmsi, MsiGetComponentPathExA);
67 GET_PROC(hshell32, SHGetFolderPathA);
69 GET_PROC(hadvapi32, ConvertSidToStringSidA);
70 GET_PROC(hadvapi32, GetTokenInformation);
71 GET_PROC(hadvapi32, OpenProcessToken);
72 GET_PROC(hadvapi32, RegDeleteKeyExA)
73 GET_PROC(hadvapi32, RegDeleteKeyExW)
74 GET_PROC(hkernel32, IsWow64Process)
75 GET_PROC(hkernel32, GetSystemInfo)
76 GET_PROC(hkernel32, GetSystemWow64DirectoryA)
78 hsrclient = LoadLibraryA("srclient.dll");
79 GET_PROC(hsrclient, SRRemoveRestorePoint);
80 GET_PROC(hsrclient, SRSetRestorePointA);
81 #undef GET_PROC
84 static BOOL is_process_limited(void)
86 HANDLE token;
88 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
90 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
92 BOOL ret;
93 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
94 DWORD size;
96 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
97 CloseHandle(token);
98 return (ret && type == TokenElevationTypeLimited);
100 return FALSE;
103 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
105 if (pRegDeleteKeyExA)
106 return pRegDeleteKeyExA( key, subkey, access, 0 );
107 return RegDeleteKeyA( key, subkey );
110 static LPSTR get_user_sid(LPSTR *usersid)
112 HANDLE token;
113 BYTE buf[1024];
114 DWORD size;
115 PTOKEN_USER user;
117 if (!pConvertSidToStringSidA)
119 win_skip("ConvertSidToStringSidA is not available\n");
120 return NULL;
123 *usersid = NULL;
124 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
125 size = sizeof(buf);
126 GetTokenInformation(token, TokenUser, buf, size, &size);
127 user = (PTOKEN_USER)buf;
128 pConvertSidToStringSidA(user->User.Sid, usersid);
129 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
130 CloseHandle(token);
131 return *usersid;
134 /* RegDeleteTreeW from dlls/advapi32/registry.c */
135 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM access)
137 LONG ret;
138 DWORD dwMaxSubkeyLen, dwMaxValueLen;
139 DWORD dwMaxLen, dwSize;
140 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
141 HKEY hSubKey = hKey;
143 if(lpszSubKey)
145 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, access, &hSubKey);
146 if (ret) return ret;
149 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
150 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
151 if (ret) goto cleanup;
153 dwMaxSubkeyLen++;
154 dwMaxValueLen++;
155 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
156 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
158 /* Name too big: alloc a buffer for it */
159 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
161 ret = ERROR_NOT_ENOUGH_MEMORY;
162 goto cleanup;
166 /* Recursively delete all the subkeys */
167 while (TRUE)
169 dwSize = dwMaxLen;
170 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
171 NULL, NULL, NULL)) break;
173 ret = package_RegDeleteTreeW(hSubKey, lpszName, access);
174 if (ret) goto cleanup;
177 if (lpszSubKey)
179 if (pRegDeleteKeyExW)
180 ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
181 else
182 ret = RegDeleteKeyW(hKey, lpszSubKey);
184 else
185 while (TRUE)
187 dwSize = dwMaxLen;
188 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
189 NULL, NULL, NULL, NULL)) break;
191 ret = RegDeleteValueW(hKey, lpszName);
192 if (ret) goto cleanup;
195 cleanup:
196 if (lpszName != szNameBuf)
197 HeapFree(GetProcessHeap(), 0, lpszName);
198 if(lpszSubKey)
199 RegCloseKey(hSubKey);
200 return ret;
203 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
205 DWORD i,n=1;
206 GUID guid;
208 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
209 return FALSE;
211 for(i=0; i<8; i++)
212 out[7-i] = in[n++];
213 n++;
214 for(i=0; i<4; i++)
215 out[11-i] = in[n++];
216 n++;
217 for(i=0; i<4; i++)
218 out[15-i] = in[n++];
219 n++;
220 for(i=0; i<2; i++)
222 out[17+i*2] = in[n++];
223 out[16+i*2] = in[n++];
225 n++;
226 for( ; i<8; i++)
228 out[17+i*2] = in[n++];
229 out[16+i*2] = in[n++];
231 out[32]=0;
232 return TRUE;
235 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
237 WCHAR guidW[MAX_PATH];
238 WCHAR squashedW[MAX_PATH];
239 GUID guid;
240 HRESULT hr;
241 int size;
243 hr = CoCreateGuid(&guid);
244 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
246 size = StringFromGUID2(&guid, guidW, MAX_PATH);
247 ok(size == 39, "Expected 39, got %d\n", hr);
249 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
250 squash_guid(guidW, squashedW);
251 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
254 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
255 LPCSTR guid, LPSTR usersid, BOOL dir)
257 WCHAR guidW[MAX_PATH];
258 WCHAR squashedW[MAX_PATH];
259 CHAR squashed[MAX_PATH];
260 CHAR comppath[MAX_PATH];
261 CHAR prodpath[MAX_PATH];
262 CHAR path[MAX_PATH];
263 LPCSTR prod = NULL;
264 HKEY hkey;
265 REGSAM access = KEY_ALL_ACCESS;
267 if (is_wow64)
268 access |= KEY_WOW64_64KEY;
270 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
271 squash_guid(guidW, squashedW);
272 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
274 if (context == MSIINSTALLCONTEXT_MACHINE)
276 prod = "3D0DAE300FACA1300AD792060BCDAA92";
277 sprintf(comppath,
278 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
279 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
280 lstrcpyA(prodpath,
281 "SOFTWARE\\Classes\\Installer\\"
282 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
284 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
286 prod = "7D2F387510109040002000060BECB6AB";
287 sprintf(comppath,
288 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
289 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
290 sprintf(prodpath,
291 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
292 "Installer\\%s\\Installer\\Products\\"
293 "7D2F387510109040002000060BECB6AB", usersid);
295 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
297 prod = "7D2F387510109040002000060BECB6AB";
298 sprintf(comppath,
299 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
300 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
301 sprintf(prodpath,
302 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
303 "Installer\\Managed\\%s\\Installer\\Products\\"
304 "7D2F387510109040002000060BECB6AB", usersid);
307 RegCreateKeyExA(HKEY_LOCAL_MACHINE, comppath, 0, NULL, 0, access, NULL, &hkey, NULL);
309 lstrcpyA(path, CURR_DIR);
310 lstrcatA(path, "\\");
311 if (!dir) lstrcatA(path, filename);
313 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
314 RegCloseKey(hkey);
316 RegCreateKeyExA(HKEY_LOCAL_MACHINE, prodpath, 0, NULL, 0, access, NULL, &hkey, NULL);
317 RegCloseKey(hkey);
320 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
322 WCHAR guidW[MAX_PATH];
323 WCHAR squashedW[MAX_PATH];
324 WCHAR substrW[MAX_PATH];
325 CHAR squashed[MAX_PATH];
326 CHAR comppath[MAX_PATH];
327 CHAR prodpath[MAX_PATH];
328 REGSAM access = KEY_ALL_ACCESS;
330 if (is_wow64)
331 access |= KEY_WOW64_64KEY;
333 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
334 squash_guid(guidW, squashedW);
335 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
337 if (context == MSIINSTALLCONTEXT_MACHINE)
339 sprintf(comppath,
340 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
341 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
342 lstrcpyA(prodpath,
343 "SOFTWARE\\Classes\\Installer\\"
344 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
346 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
348 sprintf(comppath,
349 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
350 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
351 sprintf(prodpath,
352 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
353 "Installer\\%s\\Installer\\Products\\"
354 "7D2F387510109040002000060BECB6AB", usersid);
356 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
358 sprintf(comppath,
359 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
360 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
361 sprintf(prodpath,
362 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
363 "Installer\\Managed\\%s\\Installer\\Products\\"
364 "7D2F387510109040002000060BECB6AB", usersid);
367 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
368 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
370 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
371 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
374 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
376 MSIHANDLE hview = 0;
377 UINT r, ret;
379 /* open a select query */
380 r = MsiDatabaseOpenView(hdb, query, &hview);
381 if (r != ERROR_SUCCESS)
382 return r;
383 r = MsiViewExecute(hview, 0);
384 if (r != ERROR_SUCCESS)
385 return r;
386 ret = MsiViewFetch(hview, phrec);
387 r = MsiViewClose(hview);
388 if (r != ERROR_SUCCESS)
389 return r;
390 r = MsiCloseHandle(hview);
391 if (r != ERROR_SUCCESS)
392 return r;
393 return ret;
396 static UINT run_query( MSIHANDLE hdb, const char *query )
398 MSIHANDLE hview = 0;
399 UINT r;
401 r = MsiDatabaseOpenView(hdb, query, &hview);
402 if( r != ERROR_SUCCESS )
403 return r;
405 r = MsiViewExecute(hview, 0);
406 if( r == ERROR_SUCCESS )
407 r = MsiViewClose(hview);
408 MsiCloseHandle(hview);
409 return r;
412 static UINT create_component_table( MSIHANDLE hdb )
414 return run_query( hdb,
415 "CREATE TABLE `Component` ( "
416 "`Component` CHAR(72) NOT NULL, "
417 "`ComponentId` CHAR(38), "
418 "`Directory_` CHAR(72) NOT NULL, "
419 "`Attributes` SHORT NOT NULL, "
420 "`Condition` CHAR(255), "
421 "`KeyPath` CHAR(72) "
422 "PRIMARY KEY `Component`)" );
425 static UINT create_feature_table( MSIHANDLE hdb )
427 return run_query( hdb,
428 "CREATE TABLE `Feature` ( "
429 "`Feature` CHAR(38) NOT NULL, "
430 "`Feature_Parent` CHAR(38), "
431 "`Title` CHAR(64), "
432 "`Description` CHAR(255), "
433 "`Display` SHORT NOT NULL, "
434 "`Level` SHORT NOT NULL, "
435 "`Directory_` CHAR(72), "
436 "`Attributes` SHORT NOT NULL "
437 "PRIMARY KEY `Feature`)" );
440 static UINT create_feature_components_table( MSIHANDLE hdb )
442 return run_query( hdb,
443 "CREATE TABLE `FeatureComponents` ( "
444 "`Feature_` CHAR(38) NOT NULL, "
445 "`Component_` CHAR(72) NOT NULL "
446 "PRIMARY KEY `Feature_`, `Component_` )" );
449 static UINT create_file_table( MSIHANDLE hdb )
451 return run_query( hdb,
452 "CREATE TABLE `File` ("
453 "`File` CHAR(72) NOT NULL, "
454 "`Component_` CHAR(72) NOT NULL, "
455 "`FileName` CHAR(255) NOT NULL, "
456 "`FileSize` LONG NOT NULL, "
457 "`Version` CHAR(72), "
458 "`Language` CHAR(20), "
459 "`Attributes` SHORT, "
460 "`Sequence` SHORT NOT NULL "
461 "PRIMARY KEY `File`)" );
464 static UINT create_remove_file_table( MSIHANDLE hdb )
466 return run_query( hdb,
467 "CREATE TABLE `RemoveFile` ("
468 "`FileKey` CHAR(72) NOT NULL, "
469 "`Component_` CHAR(72) NOT NULL, "
470 "`FileName` CHAR(255) LOCALIZABLE, "
471 "`DirProperty` CHAR(72) NOT NULL, "
472 "`InstallMode` SHORT NOT NULL "
473 "PRIMARY KEY `FileKey`)" );
476 static UINT create_appsearch_table( MSIHANDLE hdb )
478 return run_query( hdb,
479 "CREATE TABLE `AppSearch` ("
480 "`Property` CHAR(72) NOT NULL, "
481 "`Signature_` CHAR(72) NOT NULL "
482 "PRIMARY KEY `Property`, `Signature_`)" );
485 static UINT create_reglocator_table( MSIHANDLE hdb )
487 return run_query( hdb,
488 "CREATE TABLE `RegLocator` ("
489 "`Signature_` CHAR(72) NOT NULL, "
490 "`Root` SHORT NOT NULL, "
491 "`Key` CHAR(255) NOT NULL, "
492 "`Name` CHAR(255), "
493 "`Type` SHORT "
494 "PRIMARY KEY `Signature_`)" );
497 static UINT create_signature_table( MSIHANDLE hdb )
499 return run_query( hdb,
500 "CREATE TABLE `Signature` ("
501 "`Signature` CHAR(72) NOT NULL, "
502 "`FileName` CHAR(255) NOT NULL, "
503 "`MinVersion` CHAR(20), "
504 "`MaxVersion` CHAR(20), "
505 "`MinSize` LONG, "
506 "`MaxSize` LONG, "
507 "`MinDate` LONG, "
508 "`MaxDate` LONG, "
509 "`Languages` CHAR(255) "
510 "PRIMARY KEY `Signature`)" );
513 static UINT create_launchcondition_table( MSIHANDLE hdb )
515 return run_query( hdb,
516 "CREATE TABLE `LaunchCondition` ("
517 "`Condition` CHAR(255) NOT NULL, "
518 "`Description` CHAR(255) NOT NULL "
519 "PRIMARY KEY `Condition`)" );
522 static UINT create_property_table( MSIHANDLE hdb )
524 return run_query( hdb,
525 "CREATE TABLE `Property` ("
526 "`Property` CHAR(72) NOT NULL, "
527 "`Value` CHAR(0) "
528 "PRIMARY KEY `Property`)" );
531 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
533 return run_query( hdb,
534 "CREATE TABLE `InstallExecuteSequence` ("
535 "`Action` CHAR(72) NOT NULL, "
536 "`Condition` CHAR(255), "
537 "`Sequence` SHORT "
538 "PRIMARY KEY `Action`)" );
541 static UINT create_media_table( MSIHANDLE hdb )
543 return run_query( hdb,
544 "CREATE TABLE `Media` ("
545 "`DiskId` SHORT NOT NULL, "
546 "`LastSequence` SHORT NOT NULL, "
547 "`DiskPrompt` CHAR(64), "
548 "`Cabinet` CHAR(255), "
549 "`VolumeLabel` CHAR(32), "
550 "`Source` CHAR(72) "
551 "PRIMARY KEY `DiskId`)" );
554 static UINT create_ccpsearch_table( MSIHANDLE hdb )
556 return run_query( hdb,
557 "CREATE TABLE `CCPSearch` ("
558 "`Signature_` CHAR(72) NOT NULL "
559 "PRIMARY KEY `Signature_`)" );
562 static UINT create_drlocator_table( MSIHANDLE hdb )
564 return run_query( hdb,
565 "CREATE TABLE `DrLocator` ("
566 "`Signature_` CHAR(72) NOT NULL, "
567 "`Parent` CHAR(72), "
568 "`Path` CHAR(255), "
569 "`Depth` SHORT "
570 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
573 static UINT create_complocator_table( MSIHANDLE hdb )
575 return run_query( hdb,
576 "CREATE TABLE `CompLocator` ("
577 "`Signature_` CHAR(72) NOT NULL, "
578 "`ComponentId` CHAR(38) NOT NULL, "
579 "`Type` SHORT "
580 "PRIMARY KEY `Signature_`)" );
583 static UINT create_inilocator_table( MSIHANDLE hdb )
585 return run_query( hdb,
586 "CREATE TABLE `IniLocator` ("
587 "`Signature_` CHAR(72) NOT NULL, "
588 "`FileName` CHAR(255) NOT NULL, "
589 "`Section` CHAR(96)NOT NULL, "
590 "`Key` CHAR(128)NOT NULL, "
591 "`Field` SHORT, "
592 "`Type` SHORT "
593 "PRIMARY KEY `Signature_`)" );
596 #define make_add_entry(type, qtext) \
597 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
599 char insert[] = qtext; \
600 char *query; \
601 UINT sz, r; \
602 sz = strlen(values) + sizeof insert; \
603 query = HeapAlloc(GetProcessHeap(),0,sz); \
604 sprintf(query,insert,values); \
605 r = run_query( hdb, query ); \
606 HeapFree(GetProcessHeap(), 0, query); \
607 return r; \
610 make_add_entry(component,
611 "INSERT INTO `Component` "
612 "(`Component`, `ComponentId`, `Directory_`, "
613 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
615 make_add_entry(directory,
616 "INSERT INTO `Directory` "
617 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
619 make_add_entry(feature,
620 "INSERT INTO `Feature` "
621 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
622 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
624 make_add_entry(feature_components,
625 "INSERT INTO `FeatureComponents` "
626 "(`Feature_`, `Component_`) VALUES( %s )")
628 make_add_entry(file,
629 "INSERT INTO `File` "
630 "(`File`, `Component_`, `FileName`, `FileSize`, "
631 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
633 make_add_entry(appsearch,
634 "INSERT INTO `AppSearch` "
635 "(`Property`, `Signature_`) VALUES( %s )")
637 make_add_entry(signature,
638 "INSERT INTO `Signature` "
639 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
640 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
641 "VALUES( %s )")
643 make_add_entry(launchcondition,
644 "INSERT INTO `LaunchCondition` "
645 "(`Condition`, `Description`) VALUES( %s )")
647 make_add_entry(property,
648 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
650 make_add_entry(install_execute_sequence,
651 "INSERT INTO `InstallExecuteSequence` "
652 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
654 make_add_entry(media,
655 "INSERT INTO `Media` "
656 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
657 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
659 make_add_entry(ccpsearch,
660 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
662 make_add_entry(drlocator,
663 "INSERT INTO `DrLocator` "
664 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
666 make_add_entry(complocator,
667 "INSERT INTO `CompLocator` "
668 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
670 make_add_entry(inilocator,
671 "INSERT INTO `IniLocator` "
672 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
673 "VALUES( %s )")
675 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
676 const char *name, UINT type )
678 const char insert[] =
679 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
680 "VALUES( '%s', %u, '%s', '%s', %u )";
681 char *query;
682 UINT sz, r;
684 sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
685 query = HeapAlloc( GetProcessHeap(), 0, sz );
686 sprintf( query, insert, sig, root, path, name, type );
687 r = run_query( hdb, query );
688 HeapFree( GetProcessHeap(), 0, query );
689 return r;
692 static UINT set_summary_info(MSIHANDLE hdb)
694 UINT res;
695 MSIHANDLE suminfo;
697 /* build summary info */
698 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
699 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
701 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
702 "Installation Database");
703 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
705 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
706 "Installation Database");
707 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
709 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
710 "Wine Hackers");
711 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
713 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
714 ";1033");
715 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
717 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
718 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
719 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
721 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
722 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
724 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
725 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
727 res = MsiSummaryInfoPersist(suminfo);
728 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
730 res = MsiCloseHandle( suminfo);
731 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
733 return res;
737 static MSIHANDLE create_package_db(void)
739 MSIHANDLE hdb = 0;
740 UINT res;
742 DeleteFile(msifile);
744 /* create an empty database */
745 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
746 ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
747 if( res != ERROR_SUCCESS )
748 return hdb;
750 res = MsiDatabaseCommit( hdb );
751 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
753 res = set_summary_info(hdb);
755 res = run_query( hdb,
756 "CREATE TABLE `Directory` ( "
757 "`Directory` CHAR(255) NOT NULL, "
758 "`Directory_Parent` CHAR(255), "
759 "`DefaultDir` CHAR(255) NOT NULL "
760 "PRIMARY KEY `Directory`)" );
761 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
763 return hdb;
766 static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
768 UINT res;
769 CHAR szPackage[12];
770 MSIHANDLE hPackage;
772 sprintf(szPackage, "#%u", hdb);
773 res = MsiOpenPackage(szPackage, &hPackage);
774 if (res != ERROR_SUCCESS)
776 MsiCloseHandle(hdb);
777 return res;
780 res = MsiCloseHandle(hdb);
781 if (res != ERROR_SUCCESS)
783 MsiCloseHandle(hPackage);
784 return res;
787 *handle = hPackage;
788 return ERROR_SUCCESS;
791 static void create_test_file(const CHAR *name)
793 HANDLE file;
794 DWORD written;
796 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
797 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
798 WriteFile(file, name, strlen(name), &written, NULL);
799 WriteFile(file, "\n", strlen("\n"), &written, NULL);
800 CloseHandle(file);
803 typedef struct _tagVS_VERSIONINFO
805 WORD wLength;
806 WORD wValueLength;
807 WORD wType;
808 WCHAR szKey[1];
809 WORD wPadding1[1];
810 VS_FIXEDFILEINFO Value;
811 WORD wPadding2[1];
812 WORD wChildren[1];
813 } VS_VERSIONINFO;
815 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
816 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
818 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
820 VS_VERSIONINFO *pVerInfo;
821 VS_FIXEDFILEINFO *pFixedInfo;
822 LPBYTE buffer, ofs;
823 CHAR path[MAX_PATH];
824 DWORD handle, size;
825 HANDLE resource;
826 BOOL ret = FALSE;
828 GetSystemDirectory(path, MAX_PATH);
829 /* Some dlls can't be updated on Vista/W2K8 */
830 lstrcatA(path, "\\version.dll");
832 CopyFileA(path, name, FALSE);
834 size = GetFileVersionInfoSize(path, &handle);
835 buffer = HeapAlloc(GetProcessHeap(), 0, size);
837 GetFileVersionInfoA(path, 0, size, buffer);
839 pVerInfo = (VS_VERSIONINFO *)buffer;
840 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
841 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
843 pFixedInfo->dwFileVersionMS = ms;
844 pFixedInfo->dwFileVersionLS = ls;
845 pFixedInfo->dwProductVersionMS = ms;
846 pFixedInfo->dwProductVersionLS = ls;
848 resource = BeginUpdateResource(name, FALSE);
849 if (!resource)
850 goto done;
852 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
853 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
854 goto done;
856 if (!EndUpdateResource(resource, FALSE))
857 goto done;
859 ret = TRUE;
861 done:
862 HeapFree(GetProcessHeap(), 0, buffer);
863 return ret;
866 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
868 RESTOREPOINTINFOA spec;
870 spec.dwEventType = event_type;
871 spec.dwRestorePtType = APPLICATION_INSTALL;
872 spec.llSequenceNumber = status->llSequenceNumber;
873 lstrcpyA(spec.szDescription, "msitest restore point");
875 return pSRSetRestorePointA(&spec, status);
878 static void remove_restore_point(DWORD seq_number)
880 DWORD res;
882 res = pSRRemoveRestorePoint(seq_number);
883 if (res != ERROR_SUCCESS)
884 trace("Failed to remove the restore point : %08x\n", res);
887 static void test_createpackage(void)
889 MSIHANDLE hPackage = 0;
890 UINT res;
892 res = package_from_db(create_package_db(), &hPackage);
893 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
895 skip("Not enough rights to perform tests\n");
896 DeleteFile(msifile);
897 return;
899 ok( res == ERROR_SUCCESS, " Failed to create package %u\n", res );
901 res = MsiCloseHandle( hPackage);
902 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
903 DeleteFile(msifile);
906 static void test_doaction( void )
908 MSIHANDLE hpkg;
909 UINT r;
911 r = MsiDoAction( -1, NULL );
912 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
914 r = package_from_db(create_package_db(), &hpkg);
915 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
917 skip("Not enough rights to perform tests\n");
918 DeleteFile(msifile);
919 return;
921 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
923 r = MsiDoAction(hpkg, NULL);
924 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
926 r = MsiDoAction(0, "boo");
927 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
929 r = MsiDoAction(hpkg, "boo");
930 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
932 MsiCloseHandle( hpkg );
933 DeleteFile(msifile);
936 static void test_gettargetpath_bad(void)
938 static const WCHAR boo[] = {'b','o','o',0};
939 static const WCHAR empty[] = {0};
940 char buffer[0x80];
941 WCHAR bufferW[0x80];
942 MSIHANDLE hpkg;
943 DWORD sz;
944 UINT r;
946 r = package_from_db(create_package_db(), &hpkg);
947 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
949 skip("Not enough rights to perform tests\n");
950 DeleteFile(msifile);
951 return;
953 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
955 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
956 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
958 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
959 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
961 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
962 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
964 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
965 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
967 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
968 ok( r == ERROR_DIRECTORY, "wrong return val\n");
970 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
971 ok( r == ERROR_DIRECTORY, "wrong return val\n");
973 sz = 0;
974 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
975 ok( r == ERROR_DIRECTORY, "wrong return val\n");
977 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
978 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
980 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
981 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
983 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
984 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
986 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
987 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
989 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
990 ok( r == ERROR_DIRECTORY, "wrong return val\n");
992 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
993 ok( r == ERROR_DIRECTORY, "wrong return val\n");
995 sz = 0;
996 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
997 ok( r == ERROR_DIRECTORY, "wrong return val\n");
999 MsiCloseHandle( hpkg );
1000 DeleteFile(msifile);
1003 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
1005 UINT r;
1006 DWORD size;
1007 MSIHANDLE rec;
1009 rec = MsiCreateRecord( 1 );
1010 ok(rec, "MsiCreate record failed\n");
1012 r = MsiRecordSetString( rec, 0, file );
1013 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1015 size = MAX_PATH;
1016 r = MsiFormatRecord( hpkg, rec, buff, &size );
1017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1019 MsiCloseHandle( rec );
1022 static void test_settargetpath(void)
1024 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
1025 DWORD sz;
1026 MSIHANDLE hpkg;
1027 UINT r;
1028 MSIHANDLE hdb;
1030 hdb = create_package_db();
1031 ok ( hdb, "failed to create package database\n" );
1033 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
1034 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
1036 r = create_component_table( hdb );
1037 ok( r == S_OK, "cannot create Component table: %d\n", r );
1039 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1040 ok( r == S_OK, "cannot add dummy component: %d\n", r );
1042 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1043 ok( r == S_OK, "cannot add test component: %d\n", r );
1045 r = create_feature_table( hdb );
1046 ok( r == S_OK, "cannot create Feature table: %d\n", r );
1048 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
1049 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
1051 r = create_feature_components_table( hdb );
1052 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
1054 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
1055 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1057 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
1058 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1060 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
1061 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
1063 r = create_file_table( hdb );
1064 ok( r == S_OK, "cannot create File table: %d\n", r );
1066 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1067 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1069 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1070 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1072 r = package_from_db( hdb, &hpkg );
1073 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1075 skip("Not enough rights to perform tests\n");
1076 DeleteFile(msifile);
1077 return;
1079 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1081 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
1083 r = MsiDoAction( hpkg, "CostInitialize");
1084 ok( r == ERROR_SUCCESS, "cost init failed\n");
1086 r = MsiDoAction( hpkg, "FileCost");
1087 ok( r == ERROR_SUCCESS, "file cost failed\n");
1089 r = MsiDoAction( hpkg, "CostFinalize");
1090 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
1092 r = MsiSetTargetPath( 0, NULL, NULL );
1093 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1095 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1096 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1098 r = MsiSetTargetPath( hpkg, "boo", NULL );
1099 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1101 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
1102 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1104 sz = sizeof tempdir - 1;
1105 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1106 sprintf( file, "%srootfile.txt", tempdir );
1107 buffer[0] = 0;
1108 query_file_path( hpkg, "[#RootFile]", buffer );
1109 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1110 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1112 GetTempFileName( tempdir, "_wt", 0, buffer );
1113 sprintf( tempdir, "%s\\subdir", buffer );
1115 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1116 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1117 "MsiSetTargetPath on file returned %d\n", r );
1119 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1120 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1121 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1123 DeleteFile( buffer );
1125 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1126 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1128 r = GetFileAttributes( buffer );
1129 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1131 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1132 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1134 sz = sizeof buffer - 1;
1135 lstrcat( tempdir, "\\" );
1136 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1137 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1138 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1140 sprintf( file, "%srootfile.txt", tempdir );
1141 query_file_path( hpkg, "[#RootFile]", buffer );
1142 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1144 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1145 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1147 query_file_path( hpkg, "[#TestFile]", buffer );
1148 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1149 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1151 sz = sizeof buffer - 1;
1152 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1153 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1154 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1156 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1157 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1159 sz = sizeof buffer - 1;
1160 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1161 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1162 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1164 MsiCloseHandle( hpkg );
1167 static void test_condition(void)
1169 MSICONDITION r;
1170 MSIHANDLE hpkg;
1172 r = package_from_db(create_package_db(), &hpkg);
1173 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1175 skip("Not enough rights to perform tests\n");
1176 DeleteFile(msifile);
1177 return;
1179 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1181 r = MsiEvaluateCondition(0, NULL);
1182 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1184 r = MsiEvaluateCondition(hpkg, NULL);
1185 ok( r == MSICONDITION_NONE, "wrong return val\n");
1187 r = MsiEvaluateCondition(hpkg, "");
1188 ok( r == MSICONDITION_NONE, "wrong return val\n");
1190 r = MsiEvaluateCondition(hpkg, "1");
1191 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1193 r = MsiEvaluateCondition(hpkg, "0");
1194 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1196 r = MsiEvaluateCondition(hpkg, "-1");
1197 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1199 r = MsiEvaluateCondition(hpkg, "0 = 0");
1200 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1202 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1203 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1205 r = MsiEvaluateCondition(hpkg, "0 = 1");
1206 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1208 r = MsiEvaluateCondition(hpkg, "0 > 1");
1209 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1211 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1212 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1214 r = MsiEvaluateCondition(hpkg, "1 > 1");
1215 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1217 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1218 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1220 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1221 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1223 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1224 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1226 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1227 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1229 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1230 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1232 r = MsiEvaluateCondition(hpkg, "0 < 1");
1233 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1235 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1236 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1238 r = MsiEvaluateCondition(hpkg, "1 < 1");
1239 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1241 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1242 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1244 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1245 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1247 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1248 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1250 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1251 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1253 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1254 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1256 r = MsiEvaluateCondition(hpkg, "0 >=");
1257 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1259 r = MsiEvaluateCondition(hpkg, " ");
1260 ok( r == MSICONDITION_NONE, "wrong return val\n");
1262 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1263 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1265 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1266 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1268 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1269 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1271 r = MsiEvaluateCondition(hpkg, "not 0");
1272 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1274 r = MsiEvaluateCondition(hpkg, "not LicView");
1275 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1277 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1278 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1280 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1281 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1283 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1284 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1286 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1287 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1289 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1290 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1292 r = MsiEvaluateCondition(hpkg, "\"0\"");
1293 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1295 r = MsiEvaluateCondition(hpkg, "1 and 2");
1296 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1298 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1299 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1301 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1302 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1304 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1305 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1307 r = MsiEvaluateCondition(hpkg, "(0)");
1308 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1310 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1311 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1313 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1314 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1316 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1317 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1319 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1320 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1322 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1323 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1325 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1326 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1328 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1329 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1331 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1332 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1334 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1335 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1337 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1338 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1340 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1341 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1343 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1344 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1346 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1347 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1349 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1350 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1352 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1353 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1355 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1356 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1358 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1359 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1361 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1362 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1364 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1365 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1367 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1368 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1370 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1371 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1373 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1374 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1376 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1377 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1379 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1380 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1382 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1383 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1385 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1386 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1388 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1389 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1391 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1392 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1394 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1395 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1397 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1398 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1400 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1401 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1403 MsiSetProperty(hpkg, "mm", "5" );
1405 r = MsiEvaluateCondition(hpkg, "mm = 5");
1406 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1408 r = MsiEvaluateCondition(hpkg, "mm < 6");
1409 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1411 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1412 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1414 r = MsiEvaluateCondition(hpkg, "mm > 4");
1415 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1417 r = MsiEvaluateCondition(hpkg, "mm < 12");
1418 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1420 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1421 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1423 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1424 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1426 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1427 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1429 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1430 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1432 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1433 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1435 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1436 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1438 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1439 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1441 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1442 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1444 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1445 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1447 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1448 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1450 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1451 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1453 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1454 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1456 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1457 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1459 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1460 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1462 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1463 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1465 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1466 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1468 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1469 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1471 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1472 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1474 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1475 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1477 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1478 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1480 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1481 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1483 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1484 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1486 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1487 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1489 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1490 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1492 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1493 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1495 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1496 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1498 MsiSetProperty(hpkg, "bandalmael", "0" );
1499 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1500 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1502 MsiSetProperty(hpkg, "bandalmael", "" );
1503 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1504 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1506 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1507 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1508 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1510 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1511 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1512 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1514 MsiSetProperty(hpkg, "bandalmael", "0 " );
1515 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1516 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1518 MsiSetProperty(hpkg, "bandalmael", "-0" );
1519 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1520 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1522 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1523 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1524 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1526 MsiSetProperty(hpkg, "bandalmael", "--0" );
1527 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1528 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1530 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1531 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1532 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1534 MsiSetProperty(hpkg, "bandalmael", "-" );
1535 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1536 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1538 MsiSetProperty(hpkg, "bandalmael", "+0" );
1539 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1540 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1542 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1543 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1544 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1545 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1546 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1548 MsiSetProperty(hpkg, "one", "hi");
1549 MsiSetProperty(hpkg, "two", "hithere");
1550 r = MsiEvaluateCondition(hpkg, "one >< two");
1551 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1553 MsiSetProperty(hpkg, "one", "hithere");
1554 MsiSetProperty(hpkg, "two", "hi");
1555 r = MsiEvaluateCondition(hpkg, "one >< two");
1556 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1558 MsiSetProperty(hpkg, "one", "hello");
1559 MsiSetProperty(hpkg, "two", "hi");
1560 r = MsiEvaluateCondition(hpkg, "one >< two");
1561 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1563 MsiSetProperty(hpkg, "one", "hellohithere");
1564 MsiSetProperty(hpkg, "two", "hi");
1565 r = MsiEvaluateCondition(hpkg, "one >< two");
1566 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1568 MsiSetProperty(hpkg, "one", "");
1569 MsiSetProperty(hpkg, "two", "hi");
1570 r = MsiEvaluateCondition(hpkg, "one >< two");
1571 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1573 MsiSetProperty(hpkg, "one", "hi");
1574 MsiSetProperty(hpkg, "two", "");
1575 r = MsiEvaluateCondition(hpkg, "one >< two");
1576 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1578 MsiSetProperty(hpkg, "one", "");
1579 MsiSetProperty(hpkg, "two", "");
1580 r = MsiEvaluateCondition(hpkg, "one >< two");
1581 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1583 MsiSetProperty(hpkg, "one", "1234");
1584 MsiSetProperty(hpkg, "two", "1");
1585 r = MsiEvaluateCondition(hpkg, "one >< two");
1586 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1588 MsiSetProperty(hpkg, "one", "one 1234");
1589 MsiSetProperty(hpkg, "two", "1");
1590 r = MsiEvaluateCondition(hpkg, "one >< two");
1591 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1593 MsiSetProperty(hpkg, "one", "hithere");
1594 MsiSetProperty(hpkg, "two", "hi");
1595 r = MsiEvaluateCondition(hpkg, "one << two");
1596 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1598 MsiSetProperty(hpkg, "one", "hi");
1599 MsiSetProperty(hpkg, "two", "hithere");
1600 r = MsiEvaluateCondition(hpkg, "one << two");
1601 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1603 MsiSetProperty(hpkg, "one", "hi");
1604 MsiSetProperty(hpkg, "two", "hi");
1605 r = MsiEvaluateCondition(hpkg, "one << two");
1606 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1608 MsiSetProperty(hpkg, "one", "abcdhithere");
1609 MsiSetProperty(hpkg, "two", "hi");
1610 r = MsiEvaluateCondition(hpkg, "one << two");
1611 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1613 MsiSetProperty(hpkg, "one", "");
1614 MsiSetProperty(hpkg, "two", "hi");
1615 r = MsiEvaluateCondition(hpkg, "one << two");
1616 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1618 MsiSetProperty(hpkg, "one", "hithere");
1619 MsiSetProperty(hpkg, "two", "");
1620 r = MsiEvaluateCondition(hpkg, "one << two");
1621 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1623 MsiSetProperty(hpkg, "one", "");
1624 MsiSetProperty(hpkg, "two", "");
1625 r = MsiEvaluateCondition(hpkg, "one << two");
1626 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1628 MsiSetProperty(hpkg, "one", "1234");
1629 MsiSetProperty(hpkg, "two", "1");
1630 r = MsiEvaluateCondition(hpkg, "one << two");
1631 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1633 MsiSetProperty(hpkg, "one", "1234 one");
1634 MsiSetProperty(hpkg, "two", "1");
1635 r = MsiEvaluateCondition(hpkg, "one << two");
1636 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1638 MsiSetProperty(hpkg, "one", "hithere");
1639 MsiSetProperty(hpkg, "two", "there");
1640 r = MsiEvaluateCondition(hpkg, "one >> two");
1641 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1643 MsiSetProperty(hpkg, "one", "hithere");
1644 MsiSetProperty(hpkg, "two", "hi");
1645 r = MsiEvaluateCondition(hpkg, "one >> two");
1646 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1648 MsiSetProperty(hpkg, "one", "there");
1649 MsiSetProperty(hpkg, "two", "hithere");
1650 r = MsiEvaluateCondition(hpkg, "one >> two");
1651 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1653 MsiSetProperty(hpkg, "one", "there");
1654 MsiSetProperty(hpkg, "two", "there");
1655 r = MsiEvaluateCondition(hpkg, "one >> two");
1656 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1658 MsiSetProperty(hpkg, "one", "abcdhithere");
1659 MsiSetProperty(hpkg, "two", "hi");
1660 r = MsiEvaluateCondition(hpkg, "one >> two");
1661 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1663 MsiSetProperty(hpkg, "one", "");
1664 MsiSetProperty(hpkg, "two", "there");
1665 r = MsiEvaluateCondition(hpkg, "one >> two");
1666 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1668 MsiSetProperty(hpkg, "one", "there");
1669 MsiSetProperty(hpkg, "two", "");
1670 r = MsiEvaluateCondition(hpkg, "one >> two");
1671 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1673 MsiSetProperty(hpkg, "one", "");
1674 MsiSetProperty(hpkg, "two", "");
1675 r = MsiEvaluateCondition(hpkg, "one >> two");
1676 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1678 MsiSetProperty(hpkg, "one", "1234");
1679 MsiSetProperty(hpkg, "two", "4");
1680 r = MsiEvaluateCondition(hpkg, "one >> two");
1681 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1683 MsiSetProperty(hpkg, "one", "one 1234");
1684 MsiSetProperty(hpkg, "two", "4");
1685 r = MsiEvaluateCondition(hpkg, "one >> two");
1686 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1688 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1690 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1691 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1693 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1694 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1696 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1697 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1699 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1700 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1702 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1703 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1705 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1706 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1708 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1709 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1711 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1712 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1714 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1715 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1717 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1718 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1720 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1721 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1723 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1724 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1726 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1727 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1729 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1730 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1732 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1733 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1735 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1736 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1738 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1739 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1741 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1742 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1744 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1745 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1747 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1748 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1750 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1751 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1753 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1754 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1756 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1757 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1759 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1760 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1762 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1763 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1765 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1766 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1768 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1769 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1771 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1772 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1774 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1775 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1777 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1778 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1780 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1781 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1783 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1784 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1786 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1787 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1789 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1790 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1792 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1793 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1795 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1796 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1798 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1799 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1801 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1802 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1803 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1805 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1806 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1808 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1809 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1811 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1812 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1814 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1815 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1817 MsiSetProperty(hpkg, "one", "1");
1818 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1819 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1821 MsiSetProperty(hpkg, "X", "5.0");
1823 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1824 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1826 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1827 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1829 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1830 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1832 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1833 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1835 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1836 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1838 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1839 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1841 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1842 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1844 /* feature doesn't exist */
1845 r = MsiEvaluateCondition(hpkg, "&nofeature");
1846 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1848 MsiSetProperty(hpkg, "A", "2");
1849 MsiSetProperty(hpkg, "X", "50");
1851 r = MsiEvaluateCondition(hpkg, "2 <= X");
1852 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1854 r = MsiEvaluateCondition(hpkg, "A <= X");
1855 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1857 r = MsiEvaluateCondition(hpkg, "A <= 50");
1858 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1860 MsiSetProperty(hpkg, "X", "50val");
1862 r = MsiEvaluateCondition(hpkg, "2 <= X");
1863 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1865 r = MsiEvaluateCondition(hpkg, "A <= X");
1866 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1868 MsiSetProperty(hpkg, "A", "7");
1869 MsiSetProperty(hpkg, "X", "50");
1871 r = MsiEvaluateCondition(hpkg, "7 <= X");
1872 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1874 r = MsiEvaluateCondition(hpkg, "A <= X");
1875 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1877 r = MsiEvaluateCondition(hpkg, "A <= 50");
1878 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1880 MsiSetProperty(hpkg, "X", "50val");
1882 r = MsiEvaluateCondition(hpkg, "2 <= X");
1883 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1885 r = MsiEvaluateCondition(hpkg, "A <= X");
1886 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1888 MsiCloseHandle( hpkg );
1889 DeleteFile(msifile);
1892 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1894 UINT r;
1895 DWORD sz;
1896 char buffer[2];
1898 sz = sizeof buffer;
1899 strcpy(buffer,"x");
1900 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1901 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1904 static void test_props(void)
1906 MSIHANDLE hpkg, hdb;
1907 UINT r;
1908 DWORD sz;
1909 char buffer[0x100];
1911 hdb = create_package_db();
1912 r = run_query( hdb,
1913 "CREATE TABLE `Property` ( "
1914 "`Property` CHAR(255) NOT NULL, "
1915 "`Value` CHAR(255) "
1916 "PRIMARY KEY `Property`)" );
1917 ok( r == ERROR_SUCCESS , "Failed\n" );
1919 r = run_query(hdb,
1920 "INSERT INTO `Property` "
1921 "(`Property`, `Value`) "
1922 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1923 ok( r == ERROR_SUCCESS , "Failed\n" );
1925 r = package_from_db( hdb, &hpkg );
1926 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1928 skip("Not enough rights to perform tests\n");
1929 DeleteFile(msifile);
1930 return;
1932 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1934 /* test invalid values */
1935 r = MsiGetProperty( 0, NULL, NULL, NULL );
1936 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1938 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1939 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1941 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1942 ok( r == ERROR_SUCCESS, "wrong return val\n");
1944 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1945 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1947 /* test retrieving an empty/nonexistent property */
1948 sz = sizeof buffer;
1949 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1950 ok( r == ERROR_SUCCESS, "wrong return val\n");
1951 ok( sz == 0, "wrong size returned\n");
1953 check_prop_empty( hpkg, "boo");
1954 sz = 0;
1955 strcpy(buffer,"x");
1956 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1957 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1958 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1959 ok( sz == 0, "wrong size returned\n");
1961 sz = 1;
1962 strcpy(buffer,"x");
1963 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1964 ok( r == ERROR_SUCCESS, "wrong return val\n");
1965 ok( buffer[0] == 0, "buffer was not changed\n");
1966 ok( sz == 0, "wrong size returned\n");
1968 /* set the property to something */
1969 r = MsiSetProperty( 0, NULL, NULL );
1970 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1972 r = MsiSetProperty( hpkg, NULL, NULL );
1973 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1975 r = MsiSetProperty( hpkg, "", NULL );
1976 ok( r == ERROR_SUCCESS, "wrong return val\n");
1978 /* try set and get some illegal property identifiers */
1979 r = MsiSetProperty( hpkg, "", "asdf" );
1980 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1982 r = MsiSetProperty( hpkg, "=", "asdf" );
1983 ok( r == ERROR_SUCCESS, "wrong return val\n");
1985 r = MsiSetProperty( hpkg, " ", "asdf" );
1986 ok( r == ERROR_SUCCESS, "wrong return val\n");
1988 r = MsiSetProperty( hpkg, "'", "asdf" );
1989 ok( r == ERROR_SUCCESS, "wrong return val\n");
1991 sz = sizeof buffer;
1992 buffer[0]=0;
1993 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1994 ok( r == ERROR_SUCCESS, "wrong return val\n");
1995 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1997 /* set empty values */
1998 r = MsiSetProperty( hpkg, "boo", NULL );
1999 ok( r == ERROR_SUCCESS, "wrong return val\n");
2000 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2002 r = MsiSetProperty( hpkg, "boo", "" );
2003 ok( r == ERROR_SUCCESS, "wrong return val\n");
2004 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2006 /* set a non-empty value */
2007 r = MsiSetProperty( hpkg, "boo", "xyz" );
2008 ok( r == ERROR_SUCCESS, "wrong return val\n");
2010 sz = 1;
2011 strcpy(buffer,"x");
2012 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2013 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2014 ok( buffer[0] == 0, "buffer was not changed\n");
2015 ok( sz == 3, "wrong size returned\n");
2017 sz = 4;
2018 strcpy(buffer,"x");
2019 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2020 ok( r == ERROR_SUCCESS, "wrong return val\n");
2021 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
2022 ok( sz == 3, "wrong size returned\n");
2024 sz = 3;
2025 strcpy(buffer,"x");
2026 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2027 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2028 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
2029 ok( sz == 3, "wrong size returned\n");
2031 r = MsiSetProperty(hpkg, "SourceDir", "foo");
2032 ok( r == ERROR_SUCCESS, "wrong return val\n");
2034 sz = 4;
2035 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
2036 ok( r == ERROR_SUCCESS, "wrong return val\n");
2037 ok( !strcmp(buffer,""), "buffer wrong\n");
2038 ok( sz == 0, "wrong size returned\n");
2040 sz = 4;
2041 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
2042 ok( r == ERROR_SUCCESS, "wrong return val\n");
2043 ok( !strcmp(buffer,""), "buffer wrong\n");
2044 ok( sz == 0, "wrong size returned\n");
2046 sz = 4;
2047 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
2048 ok( r == ERROR_SUCCESS, "wrong return val\n");
2049 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
2050 ok( sz == 3, "wrong size returned\n");
2052 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
2053 ok( r == ERROR_SUCCESS, "wrong return val\n");
2055 sz = 0;
2056 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
2057 ok( r == ERROR_SUCCESS, "return wrong\n");
2058 ok( sz == 13, "size wrong (%d)\n", sz);
2060 sz = 13;
2061 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
2062 ok( r == ERROR_MORE_DATA, "return wrong\n");
2063 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
2065 r = MsiSetProperty(hpkg, "property", "value");
2066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2068 sz = 6;
2069 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2070 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2071 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
2073 r = MsiSetProperty(hpkg, "property", NULL);
2074 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2076 sz = 6;
2077 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2079 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
2081 MsiCloseHandle( hpkg );
2082 DeleteFile(msifile);
2085 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
2087 MSIHANDLE hview, hrec;
2088 BOOL found;
2089 CHAR buffer[MAX_PATH];
2090 DWORD sz;
2091 UINT r;
2093 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
2094 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2095 r = MsiViewExecute(hview, 0);
2096 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
2098 found = FALSE;
2099 while (r == ERROR_SUCCESS && !found)
2101 r = MsiViewFetch(hview, &hrec);
2102 if (r != ERROR_SUCCESS) break;
2104 sz = MAX_PATH;
2105 r = MsiRecordGetString(hrec, 1, buffer, &sz);
2106 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
2108 sz = MAX_PATH;
2109 r = MsiRecordGetString(hrec, 2, buffer, &sz);
2110 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
2111 found = TRUE;
2114 MsiCloseHandle(hrec);
2117 MsiViewClose(hview);
2118 MsiCloseHandle(hview);
2120 return found;
2123 static void test_property_table(void)
2125 const char *query;
2126 UINT r;
2127 MSIHANDLE hpkg, hdb, hrec;
2128 char buffer[MAX_PATH], package[10];
2129 DWORD sz;
2130 BOOL found;
2132 hdb = create_package_db();
2133 ok( hdb, "failed to create package\n");
2135 r = package_from_db(hdb, &hpkg);
2136 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2138 skip("Not enough rights to perform tests\n");
2139 DeleteFile(msifile);
2140 return;
2142 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2144 MsiCloseHandle(hdb);
2146 hdb = MsiGetActiveDatabase(hpkg);
2148 query = "CREATE TABLE `_Property` ( "
2149 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2150 r = run_query(hdb, query);
2151 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2153 MsiCloseHandle(hdb);
2154 MsiCloseHandle(hpkg);
2155 DeleteFile(msifile);
2157 hdb = create_package_db();
2158 ok( hdb, "failed to create package\n");
2160 query = "CREATE TABLE `_Property` ( "
2161 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2162 r = run_query(hdb, query);
2163 ok(r == ERROR_SUCCESS, "failed to create table\n");
2165 query = "ALTER `_Property` ADD `foo` INTEGER";
2166 r = run_query(hdb, query);
2167 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2169 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2170 r = run_query(hdb, query);
2171 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2173 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2174 r = run_query(hdb, query);
2175 ok(r == ERROR_SUCCESS, "failed to add column\n");
2177 sprintf(package, "#%i", hdb);
2178 r = MsiOpenPackage(package, &hpkg);
2179 todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n");
2180 if (r == ERROR_SUCCESS)
2181 MsiCloseHandle(hpkg);
2183 r = MsiCloseHandle(hdb);
2184 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
2186 hdb = create_package_db();
2187 ok (hdb, "failed to create package database\n");
2189 r = create_property_table(hdb);
2190 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2192 r = add_property_entry(hdb, "'prop', 'val'");
2193 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2195 r = package_from_db(hdb, &hpkg);
2196 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
2198 MsiCloseHandle(hdb);
2200 sz = MAX_PATH;
2201 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2203 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2205 hdb = MsiGetActiveDatabase(hpkg);
2207 found = find_prop_in_property(hdb, "prop", "val");
2208 ok(found, "prop should be in the _Property table\n");
2210 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2211 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2213 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2214 r = do_query(hdb, query, &hrec);
2215 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2217 found = find_prop_in_property(hdb, "dantes", "mercedes");
2218 ok(found == FALSE, "dantes should not be in the _Property table\n");
2220 sz = MAX_PATH;
2221 lstrcpy(buffer, "aaa");
2222 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2223 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2224 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2226 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2227 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2229 found = find_prop_in_property(hdb, "dantes", "mercedes");
2230 ok(found == TRUE, "dantes should be in the _Property table\n");
2232 MsiCloseHandle(hdb);
2233 MsiCloseHandle(hpkg);
2234 DeleteFile(msifile);
2237 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2239 MSIHANDLE htab = 0;
2240 UINT res;
2242 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2243 if( res == ERROR_SUCCESS )
2245 UINT r;
2247 r = MsiViewExecute( htab, hrec );
2248 if( r != ERROR_SUCCESS )
2250 res = r;
2251 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2254 r = MsiViewClose( htab );
2255 if( r != ERROR_SUCCESS )
2256 res = r;
2258 r = MsiCloseHandle( htab );
2259 if( r != ERROR_SUCCESS )
2260 res = r;
2262 return res;
2265 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2267 return try_query_param( hdb, szQuery, 0 );
2270 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2272 MSIHANDLE summary;
2273 UINT r;
2275 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2278 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2281 r = MsiSummaryInfoPersist(summary);
2282 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2284 MsiCloseHandle(summary);
2287 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2289 MSIHANDLE summary;
2290 UINT r;
2292 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2293 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2295 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2296 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2298 r = MsiSummaryInfoPersist(summary);
2299 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2301 MsiCloseHandle(summary);
2304 static void test_msipackage(void)
2306 MSIHANDLE hdb = 0, hpack = 100;
2307 UINT r;
2308 const char *query;
2309 char name[10];
2311 /* NULL szPackagePath */
2312 r = MsiOpenPackage(NULL, &hpack);
2313 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2315 /* empty szPackagePath */
2316 r = MsiOpenPackage("", &hpack);
2317 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2319 skip("Not enough rights to perform tests\n");
2320 return;
2322 todo_wine
2324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2327 if (r == ERROR_SUCCESS)
2328 MsiCloseHandle(hpack);
2330 /* nonexistent szPackagePath */
2331 r = MsiOpenPackage("nonexistent", &hpack);
2332 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2334 /* NULL hProduct */
2335 r = MsiOpenPackage(msifile, NULL);
2336 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2338 name[0]='#';
2339 name[1]=0;
2340 r = MsiOpenPackage(name, &hpack);
2341 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2343 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2346 /* database exists, but is emtpy */
2347 sprintf(name, "#%d", hdb);
2348 r = MsiOpenPackage(name, &hpack);
2349 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2350 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2352 query = "CREATE TABLE `Property` ( "
2353 "`Property` CHAR(72), `Value` CHAR(0) "
2354 "PRIMARY KEY `Property`)";
2355 r = try_query(hdb, query);
2356 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2358 query = "CREATE TABLE `InstallExecuteSequence` ("
2359 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2360 "PRIMARY KEY `Action`)";
2361 r = try_query(hdb, query);
2362 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2364 /* a few key tables exist */
2365 sprintf(name, "#%d", hdb);
2366 r = MsiOpenPackage(name, &hpack);
2367 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2368 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2370 MsiCloseHandle(hdb);
2371 DeleteFile(msifile);
2373 /* start with a clean database to show what constitutes a valid package */
2374 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2377 sprintf(name, "#%d", hdb);
2379 /* The following summary information props must exist:
2380 * - PID_REVNUMBER
2381 * - PID_PAGECOUNT
2384 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2385 r = MsiOpenPackage(name, &hpack);
2386 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2387 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2389 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2390 r = MsiOpenPackage(name, &hpack);
2391 ok(r == ERROR_SUCCESS,
2392 "Expected ERROR_SUCCESS, got %d\n", r);
2394 MsiCloseHandle(hpack);
2395 MsiCloseHandle(hdb);
2396 DeleteFile(msifile);
2399 static void test_formatrecord2(void)
2401 MSIHANDLE hpkg, hrec ;
2402 char buffer[0x100];
2403 DWORD sz;
2404 UINT r;
2406 r = package_from_db(create_package_db(), &hpkg);
2407 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2409 skip("Not enough rights to perform tests\n");
2410 DeleteFile(msifile);
2411 return;
2413 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2415 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2416 ok( r == ERROR_SUCCESS, "set property failed\n");
2418 hrec = MsiCreateRecord(2);
2419 ok(hrec, "create record failed\n");
2421 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2422 ok( r == ERROR_SUCCESS, "format record failed\n");
2424 buffer[0] = 0;
2425 sz = sizeof buffer;
2426 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2428 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2429 r = MsiRecordSetString(hrec, 1, "hoo");
2430 sz = sizeof buffer;
2431 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2432 ok( sz == 3, "size wrong\n");
2433 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2434 ok( r == ERROR_SUCCESS, "format failed\n");
2436 r = MsiRecordSetString(hrec, 0, "x[~]x");
2437 sz = sizeof buffer;
2438 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2439 ok( sz == 3, "size wrong\n");
2440 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2441 ok( r == ERROR_SUCCESS, "format failed\n");
2443 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2444 r = MsiRecordSetString(hrec, 1, "hoo");
2445 sz = sizeof buffer;
2446 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2447 ok( sz == 3, "size wrong\n");
2448 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2449 ok( r == ERROR_SUCCESS, "format failed\n");
2451 r = MsiRecordSetString(hrec, 0, "[\\[]");
2452 sz = sizeof buffer;
2453 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2454 ok( sz == 1, "size wrong\n");
2455 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2456 ok( r == ERROR_SUCCESS, "format failed\n");
2458 SetEnvironmentVariable("FOO", "BAR");
2459 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2460 sz = sizeof buffer;
2461 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2462 ok( sz == 3, "size wrong\n");
2463 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2464 ok( r == ERROR_SUCCESS, "format failed\n");
2466 r = MsiRecordSetString(hrec, 0, "[[1]]");
2467 r = MsiRecordSetString(hrec, 1, "%FOO");
2468 sz = sizeof buffer;
2469 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2470 ok( sz == 3, "size wrong\n");
2471 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2472 ok( r == ERROR_SUCCESS, "format failed\n");
2474 MsiCloseHandle( hrec );
2475 MsiCloseHandle( hpkg );
2476 DeleteFile(msifile);
2479 static void test_states(void)
2481 MSIHANDLE hpkg;
2482 UINT r;
2483 MSIHANDLE hdb;
2484 INSTALLSTATE state, action;
2486 static const CHAR msifile2[] = "winetest2-package.msi";
2487 static const CHAR msifile3[] = "winetest3-package.msi";
2488 static const CHAR msifile4[] = "winetest4-package.msi";
2490 if (is_process_limited())
2492 skip("process is limited\n");
2493 return;
2496 hdb = create_package_db();
2497 ok ( hdb, "failed to create package database\n" );
2499 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2500 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2502 r = create_property_table( hdb );
2503 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2505 r = add_property_entry( hdb, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2506 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2508 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2509 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2511 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2512 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2514 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2515 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2517 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
2518 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2520 r = create_install_execute_sequence_table( hdb );
2521 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2523 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2524 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2526 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2527 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2529 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2530 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2532 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2533 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2535 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2536 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2538 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2539 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2541 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2542 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2544 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2545 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2547 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2548 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2550 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2551 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2553 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2554 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2556 r = create_media_table( hdb );
2557 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2559 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2560 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2562 r = create_feature_table( hdb );
2563 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2565 r = create_component_table( hdb );
2566 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2568 /* msidbFeatureAttributesFavorLocal */
2569 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2570 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2572 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2573 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2574 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2576 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2577 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2578 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2580 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2581 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2582 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2584 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2585 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2586 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2588 /* msidbFeatureAttributesFavorSource */
2589 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2590 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2592 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2593 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2594 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2596 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2597 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2598 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2600 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2601 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2602 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2604 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2605 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2606 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2608 /* msidbFeatureAttributesFavorSource */
2609 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2610 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2612 /* msidbFeatureAttributesFavorLocal */
2613 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2614 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2616 /* disabled */
2617 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2618 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2620 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2621 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2622 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2624 /* no feature parent:msidbComponentAttributesLocalOnly */
2625 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2626 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2628 /* msidbFeatureAttributesFavorLocal:removed */
2629 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2630 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2632 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2633 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2634 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2636 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2637 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2638 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2640 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2641 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2642 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2644 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2645 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2646 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2648 /* msidbFeatureAttributesFavorSource:removed */
2649 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2650 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2652 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2653 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2654 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2656 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2657 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2658 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2660 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2661 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2662 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2664 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2665 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2666 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2668 /* msidbFeatureAttributesFavorLocal */
2669 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2670 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2672 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2673 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2675 /* msidbFeatureAttributesFavorSource */
2676 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2677 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2679 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2680 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2682 /* msidbFeatureAttributesFavorAdvertise */
2683 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2684 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2686 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2687 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2689 /* msidbFeatureAttributesUIDisallowAbsent */
2690 r = add_feature_entry( hdb, "'eleven', '', '', '', 2, 1, '', 16" );
2691 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2693 r = add_component_entry( hdb, "'psi', '{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '', 'psi_file'" );
2694 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2696 r = create_feature_components_table( hdb );
2697 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2699 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2700 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2702 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2703 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2705 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2706 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2708 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2709 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2711 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2712 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2714 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2715 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2717 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2718 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2720 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2721 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2723 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2724 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2726 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2727 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2729 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2730 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2732 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2733 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2735 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2736 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2738 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2739 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2741 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2742 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2744 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2745 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2747 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2748 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2750 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2751 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2753 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2754 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2756 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2757 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2759 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2760 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2762 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2763 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2765 r = add_feature_components_entry( hdb, "'eleven', 'psi'" );
2766 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2768 r = create_file_table( hdb );
2769 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2771 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2772 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2774 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2775 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2777 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2778 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2780 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2781 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2783 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2784 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2786 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2787 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2789 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2790 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2792 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2793 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2795 /* compressed file */
2796 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2797 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2799 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2800 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2802 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2803 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2805 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2806 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2808 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2809 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2811 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2812 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2814 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2815 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2817 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2818 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2820 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2821 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2823 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2824 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2826 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2827 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2829 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2830 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2832 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2833 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2835 r = add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
2836 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2838 MsiDatabaseCommit(hdb);
2840 /* these properties must not be in the saved msi file */
2841 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2842 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2844 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2845 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2847 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2848 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2850 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2851 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2853 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2854 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2856 r = package_from_db( hdb, &hpkg );
2857 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2859 skip("Not enough rights to perform tests\n");
2860 DeleteFile(msifile);
2861 return;
2863 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
2865 MsiCloseHandle(hdb);
2867 CopyFileA(msifile, msifile2, FALSE);
2868 CopyFileA(msifile, msifile3, FALSE);
2869 CopyFileA(msifile, msifile4, FALSE);
2871 state = 0xdeadbee;
2872 action = 0xdeadbee;
2873 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2874 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2875 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2876 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2878 state = 0xdeadbee;
2879 action = 0xdeadbee;
2880 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2881 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2882 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2883 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2885 state = 0xdeadbee;
2886 action = 0xdeadbee;
2887 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2888 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2889 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2890 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2892 state = 0xdeadbee;
2893 action = 0xdeadbee;
2894 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2895 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2896 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2897 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2899 state = 0xdeadbee;
2900 action = 0xdeadbee;
2901 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2902 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2903 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2904 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2906 state = 0xdeadbee;
2907 action = 0xdeadbee;
2908 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2909 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2910 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2911 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2913 state = 0xdeadbee;
2914 action = 0xdeadbee;
2915 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2916 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2917 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2918 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2920 state = 0xdeadbee;
2921 action = 0xdeadbee;
2922 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2923 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2924 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2925 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2927 state = 0xdeadbee;
2928 action = 0xdeadbee;
2929 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2930 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2931 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2932 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2934 state = 0xdeadbee;
2935 action = 0xdeadbee;
2936 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2937 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2938 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2939 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2941 state = 0xdeadbee;
2942 action = 0xdeadbee;
2943 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
2944 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2945 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2946 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2948 state = 0xdeadbee;
2949 action = 0xdeadbee;
2950 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2951 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2952 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2953 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2955 state = 0xdeadbee;
2956 action = 0xdeadbee;
2957 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2958 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2959 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2960 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2962 state = 0xdeadbee;
2963 action = 0xdeadbee;
2964 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2965 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2966 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2967 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2969 state = 0xdeadbee;
2970 action = 0xdeadbee;
2971 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2972 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2973 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2974 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2976 state = 0xdeadbee;
2977 action = 0xdeadbee;
2978 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2979 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2980 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2981 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2983 state = 0xdeadbee;
2984 action = 0xdeadbee;
2985 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2986 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2987 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2988 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2990 state = 0xdeadbee;
2991 action = 0xdeadbee;
2992 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2993 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2994 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2995 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2997 state = 0xdeadbee;
2998 action = 0xdeadbee;
2999 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3000 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3001 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3002 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3004 state = 0xdeadbee;
3005 action = 0xdeadbee;
3006 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3007 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3008 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3009 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3011 state = 0xdeadbee;
3012 action = 0xdeadbee;
3013 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3014 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3015 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3016 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3018 state = 0xdeadbee;
3019 action = 0xdeadbee;
3020 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3021 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3022 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3023 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3025 state = 0xdeadbee;
3026 action = 0xdeadbee;
3027 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3028 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3029 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3030 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3032 state = 0xdeadbee;
3033 action = 0xdeadbee;
3034 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3035 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3036 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3037 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3039 state = 0xdeadbee;
3040 action = 0xdeadbee;
3041 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3042 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3043 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3044 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3046 state = 0xdeadbee;
3047 action = 0xdeadbee;
3048 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3049 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3050 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3051 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3053 state = 0xdeadbee;
3054 action = 0xdeadbee;
3055 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3056 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3057 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3058 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3060 state = 0xdeadbee;
3061 action = 0xdeadbee;
3062 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3063 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3064 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3065 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3067 state = 0xdeadbee;
3068 action = 0xdeadbee;
3069 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3070 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3071 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3072 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3074 state = 0xdeadbee;
3075 action = 0xdeadbee;
3076 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3077 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3078 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3079 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3081 state = 0xdeadbee;
3082 action = 0xdeadbee;
3083 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3084 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3085 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3086 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3088 state = 0xdeadbee;
3089 action = 0xdeadbee;
3090 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3091 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3092 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3093 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3095 state = 0xdeadbee;
3096 action = 0xdeadbee;
3097 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3098 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3099 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3100 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3102 r = MsiDoAction( hpkg, "CostInitialize");
3103 ok( r == ERROR_SUCCESS, "cost init failed\n");
3105 state = 0xdeadbee;
3106 action = 0xdeadbee;
3107 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3109 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3112 state = 0xdeadbee;
3113 action = 0xdeadbee;
3114 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3116 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3119 state = 0xdeadbee;
3120 action = 0xdeadbee;
3121 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3123 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3126 state = 0xdeadbee;
3127 action = 0xdeadbee;
3128 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3130 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3131 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3133 state = 0xdeadbee;
3134 action = 0xdeadbee;
3135 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3137 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3140 state = 0xdeadbee;
3141 action = 0xdeadbee;
3142 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3144 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3145 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3147 state = 0xdeadbee;
3148 action = 0xdeadbee;
3149 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3151 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3154 state = 0xdeadbee;
3155 action = 0xdeadbee;
3156 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3158 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3159 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3161 state = 0xdeadbee;
3162 action = 0xdeadbee;
3163 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3165 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3166 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3168 state = 0xdeadbee;
3169 action = 0xdeadbee;
3170 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3172 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3173 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3175 state = 0xdeadbee;
3176 action = 0xdeadbee;
3177 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3179 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3180 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3182 state = 0xdeadbee;
3183 action = 0xdeadbee;
3184 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3186 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3187 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3189 state = 0xdeadbee;
3190 action = 0xdeadbee;
3191 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3193 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3196 state = 0xdeadbee;
3197 action = 0xdeadbee;
3198 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3200 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3203 state = 0xdeadbee;
3204 action = 0xdeadbee;
3205 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3207 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3210 state = 0xdeadbee;
3211 action = 0xdeadbee;
3212 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3214 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3217 state = 0xdeadbee;
3218 action = 0xdeadbee;
3219 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3221 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3222 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3224 state = 0xdeadbee;
3225 action = 0xdeadbee;
3226 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3228 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3229 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3231 state = 0xdeadbee;
3232 action = 0xdeadbee;
3233 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3235 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3236 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3238 state = 0xdeadbee;
3239 action = 0xdeadbee;
3240 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3242 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3243 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3245 state = 0xdeadbee;
3246 action = 0xdeadbee;
3247 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3249 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3250 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3252 state = 0xdeadbee;
3253 action = 0xdeadbee;
3254 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3255 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3256 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3257 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3259 state = 0xdeadbee;
3260 action = 0xdeadbee;
3261 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3262 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3263 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3264 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3266 state = 0xdeadbee;
3267 action = 0xdeadbee;
3268 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3269 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3270 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3271 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3273 state = 0xdeadbee;
3274 action = 0xdeadbee;
3275 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3276 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3277 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3278 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3280 state = 0xdeadbee;
3281 action = 0xdeadbee;
3282 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3283 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3284 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3285 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3287 state = 0xdeadbee;
3288 action = 0xdeadbee;
3289 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3290 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3291 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3292 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3294 state = 0xdeadbee;
3295 action = 0xdeadbee;
3296 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3297 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3298 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3299 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3301 state = 0xdeadbee;
3302 action = 0xdeadbee;
3303 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3304 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3305 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3306 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3308 state = 0xdeadbee;
3309 action = 0xdeadbee;
3310 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3311 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3312 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3313 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3315 state = 0xdeadbee;
3316 action = 0xdeadbee;
3317 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3318 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3319 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3320 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3322 state = 0xdeadbee;
3323 action = 0xdeadbee;
3324 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3325 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3326 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3327 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3329 state = 0xdeadbee;
3330 action = 0xdeadbee;
3331 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3332 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3333 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3334 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3336 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3338 r = MsiDoAction( hpkg, "FileCost");
3339 ok( r == ERROR_SUCCESS, "file cost failed\n");
3341 r = MsiGetFeatureState(hpkg, "one", NULL, NULL);
3342 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3344 action = 0xdeadbee;
3345 r = MsiGetFeatureState(hpkg, "one", NULL, &action);
3346 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3347 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3349 state = 0xdeadbee;
3350 r = MsiGetFeatureState( hpkg, "one", &state, NULL);
3351 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3352 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3354 state = 0xdeadbee;
3355 action = 0xdeadbee;
3356 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3357 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3358 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3359 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3361 state = 0xdeadbee;
3362 action = 0xdeadbee;
3363 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3364 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3365 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3366 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3368 state = 0xdeadbee;
3369 action = 0xdeadbee;
3370 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3371 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3372 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3373 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3375 state = 0xdeadbee;
3376 action = 0xdeadbee;
3377 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3378 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3379 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3380 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3382 state = 0xdeadbee;
3383 action = 0xdeadbee;
3384 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3385 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3386 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3387 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3389 state = 0xdeadbee;
3390 action = 0xdeadbee;
3391 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3393 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3394 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3396 state = 0xdeadbee;
3397 action = 0xdeadbee;
3398 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3400 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3401 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3403 state = 0xdeadbee;
3404 action = 0xdeadbee;
3405 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3407 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3408 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3410 state = 0xdeadbee;
3411 action = 0xdeadbee;
3412 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3414 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3415 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3417 state = 0xdeadbee;
3418 action = 0xdeadbee;
3419 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3421 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3424 state = 0xdeadbee;
3425 action = 0xdeadbee;
3426 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3428 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3429 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3431 state = 0xdeadbee;
3432 action = 0xdeadbee;
3433 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3435 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3436 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3438 state = 0xdeadbee;
3439 action = 0xdeadbee;
3440 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3442 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3443 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3445 state = 0xdeadbee;
3446 action = 0xdeadbee;
3447 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3449 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3450 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3452 state = 0xdeadbee;
3453 action = 0xdeadbee;
3454 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3456 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3457 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3459 state = 0xdeadbee;
3460 action = 0xdeadbee;
3461 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3463 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3466 state = 0xdeadbee;
3467 action = 0xdeadbee;
3468 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3470 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3471 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3473 state = 0xdeadbee;
3474 action = 0xdeadbee;
3475 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3477 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3478 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3480 state = 0xdeadbee;
3481 action = 0xdeadbee;
3482 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3484 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3485 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3487 state = 0xdeadbee;
3488 action = 0xdeadbee;
3489 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3491 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3492 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3494 state = 0xdeadbee;
3495 action = 0xdeadbee;
3496 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3498 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3499 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3501 state = 0xdeadbee;
3502 action = 0xdeadbee;
3503 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3505 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3506 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3508 state = 0xdeadbee;
3509 action = 0xdeadbee;
3510 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3512 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3515 state = 0xdeadbee;
3516 action = 0xdeadbee;
3517 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3519 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3522 state = 0xdeadbee;
3523 action = 0xdeadbee;
3524 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3526 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3527 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3529 state = 0xdeadbee;
3530 action = 0xdeadbee;
3531 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3533 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3534 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3536 state = 0xdeadbee;
3537 action = 0xdeadbee;
3538 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3540 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3541 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3543 state = 0xdeadbee;
3544 action = 0xdeadbee;
3545 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3547 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3548 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3550 state = 0xdeadbee;
3551 action = 0xdeadbee;
3552 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3554 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3555 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3557 state = 0xdeadbee;
3558 action = 0xdeadbee;
3559 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3561 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3562 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3564 state = 0xdeadbee;
3565 action = 0xdeadbee;
3566 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3568 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3569 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3571 state = 0xdeadbee;
3572 action = 0xdeadbee;
3573 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3575 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3576 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3578 state = 0xdeadbee;
3579 action = 0xdeadbee;
3580 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3582 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3583 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3585 r = MsiDoAction( hpkg, "CostFinalize");
3586 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3588 state = 0xdeadbee;
3589 action = 0xdeadbee;
3590 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3591 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3592 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3593 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3595 state = 0xdeadbee;
3596 action = 0xdeadbee;
3597 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3598 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3599 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3600 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3602 state = 0xdeadbee;
3603 action = 0xdeadbee;
3604 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3605 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3606 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3607 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3609 state = 0xdeadbee;
3610 action = 0xdeadbee;
3611 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3612 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3613 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3614 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3616 state = 0xdeadbee;
3617 action = 0xdeadbee;
3618 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3619 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3620 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3621 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3623 state = 0xdeadbee;
3624 action = 0xdeadbee;
3625 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3626 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3627 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3628 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3630 state = 0xdeadbee;
3631 action = 0xdeadbee;
3632 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3633 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3634 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3635 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3637 state = 0xdeadbee;
3638 action = 0xdeadbee;
3639 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3640 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3641 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3642 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3644 state = 0xdeadbee;
3645 action = 0xdeadbee;
3646 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3647 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3648 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3649 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3651 state = 0xdeadbee;
3652 action = 0xdeadbee;
3653 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3654 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3655 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3656 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3658 state = 0xdeadbee;
3659 action = 0xdeadbee;
3660 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3661 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3662 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3663 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3665 state = 0xdeadbee;
3666 action = 0xdeadbee;
3667 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3668 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3669 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3670 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3672 state = 0xdeadbee;
3673 action = 0xdeadbee;
3674 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3675 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3676 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3677 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3679 state = 0xdeadbee;
3680 action = 0xdeadbee;
3681 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3682 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3683 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3684 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3686 state = 0xdeadbee;
3687 action = 0xdeadbee;
3688 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3689 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3690 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3691 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3693 state = 0xdeadbee;
3694 action = 0xdeadbee;
3695 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3696 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3697 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3698 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3700 state = 0xdeadbee;
3701 action = 0xdeadbee;
3702 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3703 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3704 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3705 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3707 state = 0xdeadbee;
3708 action = 0xdeadbee;
3709 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3710 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3711 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3712 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3714 state = 0xdeadbee;
3715 action = 0xdeadbee;
3716 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3717 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3718 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3719 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3721 state = 0xdeadbee;
3722 action = 0xdeadbee;
3723 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3724 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3725 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3726 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3728 state = 0xdeadbee;
3729 action = 0xdeadbee;
3730 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3731 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3732 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3733 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3735 state = 0xdeadbee;
3736 action = 0xdeadbee;
3737 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3738 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3739 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3740 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3742 state = 0xdeadbee;
3743 action = 0xdeadbee;
3744 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3745 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3746 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3747 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3749 state = 0xdeadbee;
3750 action = 0xdeadbee;
3751 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3752 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3753 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3754 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3756 state = 0xdeadbee;
3757 action = 0xdeadbee;
3758 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3759 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3760 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3761 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3763 state = 0xdeadbee;
3764 action = 0xdeadbee;
3765 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3766 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3767 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3768 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3770 state = 0xdeadbee;
3771 action = 0xdeadbee;
3772 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3773 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3774 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3775 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3777 state = 0xdeadbee;
3778 action = 0xdeadbee;
3779 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3780 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3781 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3782 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3784 state = 0xdeadbee;
3785 action = 0xdeadbee;
3786 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3787 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3788 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3789 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3791 state = 0xdeadbee;
3792 action = 0xdeadbee;
3793 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3794 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3795 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3796 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3798 state = 0xdeadbee;
3799 action = 0xdeadbee;
3800 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3801 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3802 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3803 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3805 state = 0xdeadbee;
3806 action = 0xdeadbee;
3807 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3808 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3809 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3810 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3812 state = 0xdeadbee;
3813 action = 0xdeadbee;
3814 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3815 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3816 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3817 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3819 MsiCloseHandle( hpkg );
3821 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3823 /* publish the features and components */
3824 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3827 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3828 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3830 /* these properties must not be in the saved msi file */
3831 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3832 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3834 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3835 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3837 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3838 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3840 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3841 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3843 r = package_from_db( hdb, &hpkg );
3844 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
3846 MsiCloseHandle(hdb);
3848 state = 0xdeadbee;
3849 action = 0xdeadbee;
3850 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3851 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3855 state = 0xdeadbee;
3856 action = 0xdeadbee;
3857 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3858 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3862 state = 0xdeadbee;
3863 action = 0xdeadbee;
3864 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3865 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3869 state = 0xdeadbee;
3870 action = 0xdeadbee;
3871 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3872 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3876 state = 0xdeadbee;
3877 action = 0xdeadbee;
3878 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3879 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3883 state = 0xdeadbee;
3884 action = 0xdeadbee;
3885 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3886 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3890 state = 0xdeadbee;
3891 action = 0xdeadbee;
3892 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3893 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3897 state = 0xdeadbee;
3898 action = 0xdeadbee;
3899 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3900 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3904 state = 0xdeadbee;
3905 action = 0xdeadbee;
3906 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3907 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3911 state = 0xdeadbee;
3912 action = 0xdeadbee;
3913 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3914 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3918 state = 0xdeadbee;
3919 action = 0xdeadbee;
3920 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3921 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3925 state = 0xdeadbee;
3926 action = 0xdeadbee;
3927 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3928 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3932 state = 0xdeadbee;
3933 action = 0xdeadbee;
3934 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3935 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3939 state = 0xdeadbee;
3940 action = 0xdeadbee;
3941 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3942 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3946 state = 0xdeadbee;
3947 action = 0xdeadbee;
3948 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3949 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3953 state = 0xdeadbee;
3954 action = 0xdeadbee;
3955 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3956 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3960 state = 0xdeadbee;
3961 action = 0xdeadbee;
3962 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3963 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3967 state = 0xdeadbee;
3968 action = 0xdeadbee;
3969 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3970 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3971 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3972 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3974 state = 0xdeadbee;
3975 action = 0xdeadbee;
3976 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3977 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3978 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3979 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3981 state = 0xdeadbee;
3982 action = 0xdeadbee;
3983 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3984 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3985 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3986 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3988 state = 0xdeadbee;
3989 action = 0xdeadbee;
3990 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3991 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3992 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3993 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3995 state = 0xdeadbee;
3996 action = 0xdeadbee;
3997 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3998 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3999 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4000 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4002 state = 0xdeadbee;
4003 action = 0xdeadbee;
4004 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4005 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4006 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4007 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4009 state = 0xdeadbee;
4010 action = 0xdeadbee;
4011 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4012 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4013 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4014 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4016 state = 0xdeadbee;
4017 action = 0xdeadbee;
4018 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4019 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4020 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4021 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4023 state = 0xdeadbee;
4024 action = 0xdeadbee;
4025 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4026 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4027 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4028 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4030 state = 0xdeadbee;
4031 action = 0xdeadbee;
4032 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4033 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4034 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4035 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4037 state = 0xdeadbee;
4038 action = 0xdeadbee;
4039 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4040 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4041 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4042 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4044 state = 0xdeadbee;
4045 action = 0xdeadbee;
4046 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4047 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4048 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4049 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4051 state = 0xdeadbee;
4052 action = 0xdeadbee;
4053 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4054 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4055 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4056 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4058 state = 0xdeadbee;
4059 action = 0xdeadbee;
4060 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4061 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4062 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4063 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4065 state = 0xdeadbee;
4066 action = 0xdeadbee;
4067 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4068 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4069 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4070 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4072 state = 0xdeadbee;
4073 action = 0xdeadbee;
4074 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4075 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4076 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4077 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4079 r = MsiDoAction( hpkg, "CostInitialize");
4080 ok( r == ERROR_SUCCESS, "cost init failed\n");
4082 state = 0xdeadbee;
4083 action = 0xdeadbee;
4084 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4089 state = 0xdeadbee;
4090 action = 0xdeadbee;
4091 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4096 state = 0xdeadbee;
4097 action = 0xdeadbee;
4098 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4103 state = 0xdeadbee;
4104 action = 0xdeadbee;
4105 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4110 state = 0xdeadbee;
4111 action = 0xdeadbee;
4112 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4117 state = 0xdeadbee;
4118 action = 0xdeadbee;
4119 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4124 state = 0xdeadbee;
4125 action = 0xdeadbee;
4126 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4131 state = 0xdeadbee;
4132 action = 0xdeadbee;
4133 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4138 state = 0xdeadbee;
4139 action = 0xdeadbee;
4140 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4145 state = 0xdeadbee;
4146 action = 0xdeadbee;
4147 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4152 state = 0xdeadbee;
4153 action = 0xdeadbee;
4154 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4159 state = 0xdeadbee;
4160 action = 0xdeadbee;
4161 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4166 state = 0xdeadbee;
4167 action = 0xdeadbee;
4168 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4173 state = 0xdeadbee;
4174 action = 0xdeadbee;
4175 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4180 state = 0xdeadbee;
4181 action = 0xdeadbee;
4182 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4187 state = 0xdeadbee;
4188 action = 0xdeadbee;
4189 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4190 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4191 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4194 state = 0xdeadbee;
4195 action = 0xdeadbee;
4196 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4197 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4198 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4199 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4201 state = 0xdeadbee;
4202 action = 0xdeadbee;
4203 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4204 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4205 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4206 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4208 state = 0xdeadbee;
4209 action = 0xdeadbee;
4210 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4211 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4212 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4213 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4215 state = 0xdeadbee;
4216 action = 0xdeadbee;
4217 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4219 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4220 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4222 state = 0xdeadbee;
4223 action = 0xdeadbee;
4224 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4226 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4227 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4229 state = 0xdeadbee;
4230 action = 0xdeadbee;
4231 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4233 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4234 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4236 state = 0xdeadbee;
4237 action = 0xdeadbee;
4238 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4240 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4241 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4243 state = 0xdeadbee;
4244 action = 0xdeadbee;
4245 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4247 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4250 state = 0xdeadbee;
4251 action = 0xdeadbee;
4252 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4254 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4255 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4257 state = 0xdeadbee;
4258 action = 0xdeadbee;
4259 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4261 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4264 state = 0xdeadbee;
4265 action = 0xdeadbee;
4266 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4268 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4269 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4271 state = 0xdeadbee;
4272 action = 0xdeadbee;
4273 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4275 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4276 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4278 state = 0xdeadbee;
4279 action = 0xdeadbee;
4280 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4282 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4283 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4285 state = 0xdeadbee;
4286 action = 0xdeadbee;
4287 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4288 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4289 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4290 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4292 state = 0xdeadbee;
4293 action = 0xdeadbee;
4294 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4295 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4296 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4297 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4299 state = 0xdeadbee;
4300 action = 0xdeadbee;
4301 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4302 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4303 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4304 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4306 state = 0xdeadbee;
4307 action = 0xdeadbee;
4308 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4309 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4310 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4311 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4313 r = MsiDoAction( hpkg, "FileCost");
4314 ok( r == ERROR_SUCCESS, "file cost failed\n");
4316 state = 0xdeadbee;
4317 action = 0xdeadbee;
4318 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4323 state = 0xdeadbee;
4324 action = 0xdeadbee;
4325 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4330 state = 0xdeadbee;
4331 action = 0xdeadbee;
4332 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4337 state = 0xdeadbee;
4338 action = 0xdeadbee;
4339 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4344 state = 0xdeadbee;
4345 action = 0xdeadbee;
4346 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4351 state = 0xdeadbee;
4352 action = 0xdeadbee;
4353 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4358 state = 0xdeadbee;
4359 action = 0xdeadbee;
4360 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4362 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4365 state = 0xdeadbee;
4366 action = 0xdeadbee;
4367 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4372 state = 0xdeadbee;
4373 action = 0xdeadbee;
4374 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4376 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4379 state = 0xdeadbee;
4380 action = 0xdeadbee;
4381 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4383 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4386 state = 0xdeadbee;
4387 action = 0xdeadbee;
4388 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4390 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4391 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4393 state = 0xdeadbee;
4394 action = 0xdeadbee;
4395 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4397 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4398 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4400 state = 0xdeadbee;
4401 action = 0xdeadbee;
4402 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4404 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4405 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4407 state = 0xdeadbee;
4408 action = 0xdeadbee;
4409 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4411 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4412 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4414 state = 0xdeadbee;
4415 action = 0xdeadbee;
4416 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4418 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4419 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4421 state = 0xdeadbee;
4422 action = 0xdeadbee;
4423 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4424 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4425 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4426 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4428 state = 0xdeadbee;
4429 action = 0xdeadbee;
4430 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4431 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4432 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4433 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4435 state = 0xdeadbee;
4436 action = 0xdeadbee;
4437 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4438 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4439 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4440 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4442 state = 0xdeadbee;
4443 action = 0xdeadbee;
4444 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4445 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4446 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4447 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4449 state = 0xdeadbee;
4450 action = 0xdeadbee;
4451 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4452 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4453 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4454 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4456 state = 0xdeadbee;
4457 action = 0xdeadbee;
4458 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4459 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4460 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4461 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4463 state = 0xdeadbee;
4464 action = 0xdeadbee;
4465 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4466 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4467 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4468 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4470 state = 0xdeadbee;
4471 action = 0xdeadbee;
4472 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4473 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4474 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4475 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4477 state = 0xdeadbee;
4478 action = 0xdeadbee;
4479 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4480 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4481 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4482 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4484 state = 0xdeadbee;
4485 action = 0xdeadbee;
4486 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4487 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4488 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4489 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4491 state = 0xdeadbee;
4492 action = 0xdeadbee;
4493 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4494 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4495 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4496 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4498 state = 0xdeadbee;
4499 action = 0xdeadbee;
4500 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4501 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4502 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4503 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4505 state = 0xdeadbee;
4506 action = 0xdeadbee;
4507 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4508 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4509 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4510 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4512 state = 0xdeadbee;
4513 action = 0xdeadbee;
4514 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4515 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4516 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4517 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4519 state = 0xdeadbee;
4520 action = 0xdeadbee;
4521 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4522 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4523 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4524 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4526 state = 0xdeadbee;
4527 action = 0xdeadbee;
4528 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4529 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4530 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4531 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4533 r = MsiDoAction( hpkg, "CostFinalize");
4534 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4536 state = 0xdeadbee;
4537 action = 0xdeadbee;
4538 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4540 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4541 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4543 state = 0xdeadbee;
4544 action = 0xdeadbee;
4545 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4547 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4548 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4550 state = 0xdeadbee;
4551 action = 0xdeadbee;
4552 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4554 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4555 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4557 state = 0xdeadbee;
4558 action = 0xdeadbee;
4559 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4561 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4562 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4564 state = 0xdeadbee;
4565 action = 0xdeadbee;
4566 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4568 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4569 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4571 state = 0xdeadbee;
4572 action = 0xdeadbee;
4573 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4575 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4576 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4578 state = 0xdeadbee;
4579 action = 0xdeadbee;
4580 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4582 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4583 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4585 state = 0xdeadbee;
4586 action = 0xdeadbee;
4587 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4589 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4590 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4592 state = 0xdeadbee;
4593 action = 0xdeadbee;
4594 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4596 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4597 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4599 state = 0xdeadbee;
4600 action = 0xdeadbee;
4601 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4603 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4604 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4606 state = 0xdeadbee;
4607 action = 0xdeadbee;
4608 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4610 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4611 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4613 state = 0xdeadbee;
4614 action = 0xdeadbee;
4615 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4617 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4618 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4620 state = 0xdeadbee;
4621 action = 0xdeadbee;
4622 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4624 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4625 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4627 state = 0xdeadbee;
4628 action = 0xdeadbee;
4629 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4630 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4631 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4632 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4634 state = 0xdeadbee;
4635 action = 0xdeadbee;
4636 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4638 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4639 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4641 state = 0xdeadbee;
4642 action = 0xdeadbee;
4643 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4645 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4646 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4648 state = 0xdeadbee;
4649 action = 0xdeadbee;
4650 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4652 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4653 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4655 state = 0xdeadbee;
4656 action = 0xdeadbee;
4657 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4659 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4660 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4662 state = 0xdeadbee;
4663 action = 0xdeadbee;
4664 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4666 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4667 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4669 state = 0xdeadbee;
4670 action = 0xdeadbee;
4671 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4673 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4674 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4676 state = 0xdeadbee;
4677 action = 0xdeadbee;
4678 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4680 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4681 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4683 state = 0xdeadbee;
4684 action = 0xdeadbee;
4685 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4687 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4688 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4690 state = 0xdeadbee;
4691 action = 0xdeadbee;
4692 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4694 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4695 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4697 state = 0xdeadbee;
4698 action = 0xdeadbee;
4699 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4701 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4702 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4704 state = 0xdeadbee;
4705 action = 0xdeadbee;
4706 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4708 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4709 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4711 state = 0xdeadbee;
4712 action = 0xdeadbee;
4713 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4715 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4716 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4718 state = 0xdeadbee;
4719 action = 0xdeadbee;
4720 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4722 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4723 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4725 state = 0xdeadbee;
4726 action = 0xdeadbee;
4727 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4729 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4730 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4732 state = 0xdeadbee;
4733 action = 0xdeadbee;
4734 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4736 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4737 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4739 state = 0xdeadbee;
4740 action = 0xdeadbee;
4741 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4743 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4744 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4746 state = 0xdeadbee;
4747 action = 0xdeadbee;
4748 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4750 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4751 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4753 state = 0xdeadbee;
4754 action = 0xdeadbee;
4755 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4757 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4758 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4760 state = 0xdeadbee;
4761 action = 0xdeadbee;
4762 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4764 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4765 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4767 MsiCloseHandle(hpkg);
4769 /* uninstall the product */
4770 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4773 /* all features installed locally */
4774 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4775 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4777 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4778 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4780 /* these properties must not be in the saved msi file */
4781 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4782 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4784 r = package_from_db( hdb, &hpkg );
4785 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
4787 state = 0xdeadbee;
4788 action = 0xdeadbee;
4789 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4790 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4794 state = 0xdeadbee;
4795 action = 0xdeadbee;
4796 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4797 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4801 state = 0xdeadbee;
4802 action = 0xdeadbee;
4803 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4804 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4808 state = 0xdeadbee;
4809 action = 0xdeadbee;
4810 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4811 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4815 state = 0xdeadbee;
4816 action = 0xdeadbee;
4817 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4818 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4822 state = 0xdeadbee;
4823 action = 0xdeadbee;
4824 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4825 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4826 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4827 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4829 state = 0xdeadbee;
4830 action = 0xdeadbee;
4831 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4832 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4833 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4834 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4836 state = 0xdeadbee;
4837 action = 0xdeadbee;
4838 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4839 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4840 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4841 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4843 state = 0xdeadbee;
4844 action = 0xdeadbee;
4845 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4846 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4847 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4848 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4850 state = 0xdeadbee;
4851 action = 0xdeadbee;
4852 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4853 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4854 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4855 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4857 state = 0xdeadbee;
4858 action = 0xdeadbee;
4859 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4860 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4861 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4862 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4864 state = 0xdeadbee;
4865 action = 0xdeadbee;
4866 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4867 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4868 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4869 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4871 state = 0xdeadbee;
4872 action = 0xdeadbee;
4873 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4874 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4875 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4876 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4878 state = 0xdeadbee;
4879 action = 0xdeadbee;
4880 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4881 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4882 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4883 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4885 state = 0xdeadbee;
4886 action = 0xdeadbee;
4887 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4888 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4889 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4890 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4892 state = 0xdeadbee;
4893 action = 0xdeadbee;
4894 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4895 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4896 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4897 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4899 state = 0xdeadbee;
4900 action = 0xdeadbee;
4901 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4902 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4903 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4904 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4906 state = 0xdeadbee;
4907 action = 0xdeadbee;
4908 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4909 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4910 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4911 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4913 state = 0xdeadbee;
4914 action = 0xdeadbee;
4915 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4916 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4917 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4918 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4920 state = 0xdeadbee;
4921 action = 0xdeadbee;
4922 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4923 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4924 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4925 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4927 state = 0xdeadbee;
4928 action = 0xdeadbee;
4929 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4930 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4931 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4932 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4934 state = 0xdeadbee;
4935 action = 0xdeadbee;
4936 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4937 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4938 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4939 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4941 state = 0xdeadbee;
4942 action = 0xdeadbee;
4943 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4944 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4945 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4946 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4948 state = 0xdeadbee;
4949 action = 0xdeadbee;
4950 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4951 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4952 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4953 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4955 state = 0xdeadbee;
4956 action = 0xdeadbee;
4957 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4958 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4959 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4960 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4962 state = 0xdeadbee;
4963 action = 0xdeadbee;
4964 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4965 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4966 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4967 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4969 state = 0xdeadbee;
4970 action = 0xdeadbee;
4971 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4972 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4973 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4974 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4976 state = 0xdeadbee;
4977 action = 0xdeadbee;
4978 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4979 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4980 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4981 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4983 state = 0xdeadbee;
4984 action = 0xdeadbee;
4985 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4986 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4987 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4988 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4990 state = 0xdeadbee;
4991 action = 0xdeadbee;
4992 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4993 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4994 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4995 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4997 state = 0xdeadbee;
4998 action = 0xdeadbee;
4999 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5000 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5001 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5002 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5004 state = 0xdeadbee;
5005 action = 0xdeadbee;
5006 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5007 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5008 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5009 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5011 state = 0xdeadbee;
5012 action = 0xdeadbee;
5013 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5014 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5015 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5016 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5018 r = MsiDoAction( hpkg, "CostInitialize");
5019 ok( r == ERROR_SUCCESS, "cost init failed\n");
5021 state = 0xdeadbee;
5022 action = 0xdeadbee;
5023 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5028 state = 0xdeadbee;
5029 action = 0xdeadbee;
5030 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5035 state = 0xdeadbee;
5036 action = 0xdeadbee;
5037 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5042 state = 0xdeadbee;
5043 action = 0xdeadbee;
5044 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5049 state = 0xdeadbee;
5050 action = 0xdeadbee;
5051 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5056 state = 0xdeadbee;
5057 action = 0xdeadbee;
5058 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5060 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5061 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5063 state = 0xdeadbee;
5064 action = 0xdeadbee;
5065 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5067 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5068 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5070 state = 0xdeadbee;
5071 action = 0xdeadbee;
5072 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5074 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5075 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5077 state = 0xdeadbee;
5078 action = 0xdeadbee;
5079 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5081 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5082 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5084 state = 0xdeadbee;
5085 action = 0xdeadbee;
5086 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5088 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5089 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5091 state = 0xdeadbee;
5092 action = 0xdeadbee;
5093 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5095 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5096 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5098 state = 0xdeadbee;
5099 action = 0xdeadbee;
5100 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5102 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5103 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5105 state = 0xdeadbee;
5106 action = 0xdeadbee;
5107 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5109 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5112 state = 0xdeadbee;
5113 action = 0xdeadbee;
5114 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5116 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5119 state = 0xdeadbee;
5120 action = 0xdeadbee;
5121 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5123 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5126 state = 0xdeadbee;
5127 action = 0xdeadbee;
5128 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5130 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5131 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5133 state = 0xdeadbee;
5134 action = 0xdeadbee;
5135 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5137 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5140 state = 0xdeadbee;
5141 action = 0xdeadbee;
5142 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5144 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5145 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5147 state = 0xdeadbee;
5148 action = 0xdeadbee;
5149 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5151 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5154 state = 0xdeadbee;
5155 action = 0xdeadbee;
5156 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5158 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5159 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5161 state = 0xdeadbee;
5162 action = 0xdeadbee;
5163 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5165 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5166 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5168 state = 0xdeadbee;
5169 action = 0xdeadbee;
5170 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5172 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5173 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5175 state = 0xdeadbee;
5176 action = 0xdeadbee;
5177 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5179 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5180 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5182 state = 0xdeadbee;
5183 action = 0xdeadbee;
5184 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5186 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5187 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5189 state = 0xdeadbee;
5190 action = 0xdeadbee;
5191 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5193 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5196 state = 0xdeadbee;
5197 action = 0xdeadbee;
5198 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5200 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5203 state = 0xdeadbee;
5204 action = 0xdeadbee;
5205 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5206 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5207 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5208 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5210 state = 0xdeadbee;
5211 action = 0xdeadbee;
5212 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5213 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5214 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5215 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5217 state = 0xdeadbee;
5218 action = 0xdeadbee;
5219 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5220 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5221 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5222 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5224 state = 0xdeadbee;
5225 action = 0xdeadbee;
5226 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5227 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5228 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5229 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5231 state = 0xdeadbee;
5232 action = 0xdeadbee;
5233 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5234 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5235 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5236 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5238 state = 0xdeadbee;
5239 action = 0xdeadbee;
5240 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5241 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5242 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5243 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5245 state = 0xdeadbee;
5246 action = 0xdeadbee;
5247 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5248 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5249 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5250 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5252 r = MsiDoAction( hpkg, "FileCost");
5253 ok( r == ERROR_SUCCESS, "file cost failed\n");
5255 state = 0xdeadbee;
5256 action = 0xdeadbee;
5257 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5262 state = 0xdeadbee;
5263 action = 0xdeadbee;
5264 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5269 state = 0xdeadbee;
5270 action = 0xdeadbee;
5271 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5276 state = 0xdeadbee;
5277 action = 0xdeadbee;
5278 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5283 state = 0xdeadbee;
5284 action = 0xdeadbee;
5285 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5287 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5288 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5290 state = 0xdeadbee;
5291 action = 0xdeadbee;
5292 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5293 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5294 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5295 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5297 state = 0xdeadbee;
5298 action = 0xdeadbee;
5299 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5300 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5301 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5302 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5304 state = 0xdeadbee;
5305 action = 0xdeadbee;
5306 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5307 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5308 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5309 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5311 state = 0xdeadbee;
5312 action = 0xdeadbee;
5313 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5314 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5315 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5316 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5318 state = 0xdeadbee;
5319 action = 0xdeadbee;
5320 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5321 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5322 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5323 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5325 state = 0xdeadbee;
5326 action = 0xdeadbee;
5327 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5328 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5329 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5330 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5332 state = 0xdeadbee;
5333 action = 0xdeadbee;
5334 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5335 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5336 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5337 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5339 state = 0xdeadbee;
5340 action = 0xdeadbee;
5341 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5342 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5343 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5344 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5346 state = 0xdeadbee;
5347 action = 0xdeadbee;
5348 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5349 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5350 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5351 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5353 state = 0xdeadbee;
5354 action = 0xdeadbee;
5355 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5356 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5357 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5358 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5360 state = 0xdeadbee;
5361 action = 0xdeadbee;
5362 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5363 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5364 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5365 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5367 state = 0xdeadbee;
5368 action = 0xdeadbee;
5369 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5371 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5372 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5374 state = 0xdeadbee;
5375 action = 0xdeadbee;
5376 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5378 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5381 state = 0xdeadbee;
5382 action = 0xdeadbee;
5383 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5388 state = 0xdeadbee;
5389 action = 0xdeadbee;
5390 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5391 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5392 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5393 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5395 state = 0xdeadbee;
5396 action = 0xdeadbee;
5397 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5399 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5402 state = 0xdeadbee;
5403 action = 0xdeadbee;
5404 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5406 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5407 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5409 state = 0xdeadbee;
5410 action = 0xdeadbee;
5411 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5413 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5416 state = 0xdeadbee;
5417 action = 0xdeadbee;
5418 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5420 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5423 state = 0xdeadbee;
5424 action = 0xdeadbee;
5425 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5430 state = 0xdeadbee;
5431 action = 0xdeadbee;
5432 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5437 state = 0xdeadbee;
5438 action = 0xdeadbee;
5439 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5440 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5441 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5442 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5444 state = 0xdeadbee;
5445 action = 0xdeadbee;
5446 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5447 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5448 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5449 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5451 state = 0xdeadbee;
5452 action = 0xdeadbee;
5453 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5454 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5455 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5456 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5458 state = 0xdeadbee;
5459 action = 0xdeadbee;
5460 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5461 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5462 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5463 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5465 state = 0xdeadbee;
5466 action = 0xdeadbee;
5467 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5468 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5469 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5470 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5472 state = 0xdeadbee;
5473 action = 0xdeadbee;
5474 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5475 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5476 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5477 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5479 state = 0xdeadbee;
5480 action = 0xdeadbee;
5481 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5482 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5483 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5484 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5486 r = MsiDoAction( hpkg, "CostFinalize");
5487 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5489 state = 0xdeadbee;
5490 action = 0xdeadbee;
5491 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5493 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5494 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5496 state = 0xdeadbee;
5497 action = 0xdeadbee;
5498 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5500 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5501 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5503 state = 0xdeadbee;
5504 action = 0xdeadbee;
5505 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5507 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5508 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5510 state = 0xdeadbee;
5511 action = 0xdeadbee;
5512 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5514 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5515 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5517 state = 0xdeadbee;
5518 action = 0xdeadbee;
5519 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5520 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5521 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5522 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5524 state = 0xdeadbee;
5525 action = 0xdeadbee;
5526 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5527 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5528 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5529 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5531 state = 0xdeadbee;
5532 action = 0xdeadbee;
5533 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5534 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5535 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5536 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5538 state = 0xdeadbee;
5539 action = 0xdeadbee;
5540 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5541 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5542 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5543 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5545 state = 0xdeadbee;
5546 action = 0xdeadbee;
5547 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5549 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5550 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5552 state = 0xdeadbee;
5553 action = 0xdeadbee;
5554 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5556 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5557 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5559 state = 0xdeadbee;
5560 action = 0xdeadbee;
5561 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5563 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5564 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5566 state = 0xdeadbee;
5567 action = 0xdeadbee;
5568 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5569 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5570 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5571 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5573 state = 0xdeadbee;
5574 action = 0xdeadbee;
5575 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5576 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5577 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5578 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5580 state = 0xdeadbee;
5581 action = 0xdeadbee;
5582 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5583 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5584 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5585 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5587 state = 0xdeadbee;
5588 action = 0xdeadbee;
5589 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5590 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5591 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5592 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5594 state = 0xdeadbee;
5595 action = 0xdeadbee;
5596 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5597 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5598 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5599 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5601 state = 0xdeadbee;
5602 action = 0xdeadbee;
5603 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5604 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5605 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5606 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5608 state = 0xdeadbee;
5609 action = 0xdeadbee;
5610 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5612 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5613 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5615 state = 0xdeadbee;
5616 action = 0xdeadbee;
5617 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5619 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5620 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5622 state = 0xdeadbee;
5623 action = 0xdeadbee;
5624 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5625 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5626 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5627 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5629 state = 0xdeadbee;
5630 action = 0xdeadbee;
5631 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5633 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5634 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5636 state = 0xdeadbee;
5637 action = 0xdeadbee;
5638 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5639 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5640 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5641 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5643 state = 0xdeadbee;
5644 action = 0xdeadbee;
5645 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5647 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5648 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5650 state = 0xdeadbee;
5651 action = 0xdeadbee;
5652 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5654 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5655 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5657 state = 0xdeadbee;
5658 action = 0xdeadbee;
5659 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5661 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5662 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5664 state = 0xdeadbee;
5665 action = 0xdeadbee;
5666 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5668 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5669 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5671 state = 0xdeadbee;
5672 action = 0xdeadbee;
5673 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5675 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5676 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5678 state = 0xdeadbee;
5679 action = 0xdeadbee;
5680 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5682 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5683 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5685 state = 0xdeadbee;
5686 action = 0xdeadbee;
5687 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5689 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5690 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5692 state = 0xdeadbee;
5693 action = 0xdeadbee;
5694 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5696 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5697 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5699 state = 0xdeadbee;
5700 action = 0xdeadbee;
5701 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5703 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5704 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5706 state = 0xdeadbee;
5707 action = 0xdeadbee;
5708 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5710 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5711 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5713 state = 0xdeadbee;
5714 action = 0xdeadbee;
5715 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5717 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5718 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5720 MsiCloseHandle(hpkg);
5722 /* uninstall the product */
5723 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5724 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5726 /* all features installed from source */
5727 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5730 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5731 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5733 /* this property must not be in the saved msi file */
5734 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5735 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5737 r = package_from_db( hdb, &hpkg );
5738 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
5740 state = 0xdeadbee;
5741 action = 0xdeadbee;
5742 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5743 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5744 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5745 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5747 state = 0xdeadbee;
5748 action = 0xdeadbee;
5749 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5750 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5751 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5752 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5754 state = 0xdeadbee;
5755 action = 0xdeadbee;
5756 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5757 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5758 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5759 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5761 state = 0xdeadbee;
5762 action = 0xdeadbee;
5763 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5764 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5765 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5766 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5768 state = 0xdeadbee;
5769 action = 0xdeadbee;
5770 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5771 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5772 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5773 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5775 state = 0xdeadbee;
5776 action = 0xdeadbee;
5777 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5778 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5779 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5780 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5782 state = 0xdeadbee;
5783 action = 0xdeadbee;
5784 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5785 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5786 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5787 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5789 state = 0xdeadbee;
5790 action = 0xdeadbee;
5791 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5792 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5793 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5794 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5796 state = 0xdeadbee;
5797 action = 0xdeadbee;
5798 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5799 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5800 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5801 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5803 state = 0xdeadbee;
5804 action = 0xdeadbee;
5805 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5806 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5807 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5808 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5810 state = 0xdeadbee;
5811 action = 0xdeadbee;
5812 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5813 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5814 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5815 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5817 state = 0xdeadbee;
5818 action = 0xdeadbee;
5819 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5820 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5821 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5822 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5824 state = 0xdeadbee;
5825 action = 0xdeadbee;
5826 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5827 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5828 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5829 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5831 state = 0xdeadbee;
5832 action = 0xdeadbee;
5833 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5834 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5835 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5836 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5838 state = 0xdeadbee;
5839 action = 0xdeadbee;
5840 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5841 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5842 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5843 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5845 state = 0xdeadbee;
5846 action = 0xdeadbee;
5847 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5848 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5849 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5850 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5852 state = 0xdeadbee;
5853 action = 0xdeadbee;
5854 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5855 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5856 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5857 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5859 state = 0xdeadbee;
5860 action = 0xdeadbee;
5861 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5862 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5863 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5864 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5866 state = 0xdeadbee;
5867 action = 0xdeadbee;
5868 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5869 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5870 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5871 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5873 state = 0xdeadbee;
5874 action = 0xdeadbee;
5875 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5876 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5877 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5878 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5880 state = 0xdeadbee;
5881 action = 0xdeadbee;
5882 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5883 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5884 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5885 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5887 state = 0xdeadbee;
5888 action = 0xdeadbee;
5889 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5890 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5891 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5892 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5894 state = 0xdeadbee;
5895 action = 0xdeadbee;
5896 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5897 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5898 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5899 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5901 state = 0xdeadbee;
5902 action = 0xdeadbee;
5903 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5904 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5905 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5906 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5908 state = 0xdeadbee;
5909 action = 0xdeadbee;
5910 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5911 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5912 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5913 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5915 state = 0xdeadbee;
5916 action = 0xdeadbee;
5917 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5918 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5919 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5920 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5922 state = 0xdeadbee;
5923 action = 0xdeadbee;
5924 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5925 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5926 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5927 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5929 state = 0xdeadbee;
5930 action = 0xdeadbee;
5931 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5932 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5933 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5934 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5936 state = 0xdeadbee;
5937 action = 0xdeadbee;
5938 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5939 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5940 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5941 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5943 state = 0xdeadbee;
5944 action = 0xdeadbee;
5945 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5946 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5947 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5948 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5950 state = 0xdeadbee;
5951 action = 0xdeadbee;
5952 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5953 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5954 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5955 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5957 state = 0xdeadbee;
5958 action = 0xdeadbee;
5959 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5960 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5961 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5962 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5964 state = 0xdeadbee;
5965 action = 0xdeadbee;
5966 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5967 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5968 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5969 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5971 r = MsiDoAction( hpkg, "CostInitialize");
5972 ok( r == ERROR_SUCCESS, "cost init failed\n");
5974 state = 0xdeadbee;
5975 action = 0xdeadbee;
5976 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5977 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5978 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5979 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5981 state = 0xdeadbee;
5982 action = 0xdeadbee;
5983 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5984 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5985 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5986 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5988 state = 0xdeadbee;
5989 action = 0xdeadbee;
5990 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5991 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5992 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5993 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5995 state = 0xdeadbee;
5996 action = 0xdeadbee;
5997 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5998 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5999 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6000 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6002 state = 0xdeadbee;
6003 action = 0xdeadbee;
6004 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6005 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6006 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6007 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6009 state = 0xdeadbee;
6010 action = 0xdeadbee;
6011 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6012 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6013 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6014 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6016 state = 0xdeadbee;
6017 action = 0xdeadbee;
6018 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6019 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6020 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6021 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6023 state = 0xdeadbee;
6024 action = 0xdeadbee;
6025 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6026 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6027 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6028 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6030 state = 0xdeadbee;
6031 action = 0xdeadbee;
6032 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6033 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6034 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6035 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6037 state = 0xdeadbee;
6038 action = 0xdeadbee;
6039 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6040 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6041 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6042 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6044 state = 0xdeadbee;
6045 action = 0xdeadbee;
6046 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6047 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6048 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6049 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6051 state = 0xdeadbee;
6052 action = 0xdeadbee;
6053 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6054 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6055 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6056 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6058 state = 0xdeadbee;
6059 action = 0xdeadbee;
6060 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6061 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6062 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6063 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6065 state = 0xdeadbee;
6066 action = 0xdeadbee;
6067 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6068 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6069 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6070 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6072 state = 0xdeadbee;
6073 action = 0xdeadbee;
6074 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6075 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6076 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6077 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6079 state = 0xdeadbee;
6080 action = 0xdeadbee;
6081 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6082 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6083 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6084 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6086 state = 0xdeadbee;
6087 action = 0xdeadbee;
6088 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6089 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6090 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6091 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6093 state = 0xdeadbee;
6094 action = 0xdeadbee;
6095 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6096 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6097 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6098 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6100 state = 0xdeadbee;
6101 action = 0xdeadbee;
6102 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6103 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6104 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6105 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6107 state = 0xdeadbee;
6108 action = 0xdeadbee;
6109 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6110 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6111 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6112 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6114 state = 0xdeadbee;
6115 action = 0xdeadbee;
6116 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6117 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6118 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6119 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6121 state = 0xdeadbee;
6122 action = 0xdeadbee;
6123 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6124 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6125 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6126 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6128 state = 0xdeadbee;
6129 action = 0xdeadbee;
6130 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6131 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6132 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6133 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6135 state = 0xdeadbee;
6136 action = 0xdeadbee;
6137 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6138 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6139 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6140 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6142 state = 0xdeadbee;
6143 action = 0xdeadbee;
6144 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6145 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6146 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6147 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6149 state = 0xdeadbee;
6150 action = 0xdeadbee;
6151 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6152 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6153 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6154 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6156 state = 0xdeadbee;
6157 action = 0xdeadbee;
6158 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6159 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6160 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6161 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6163 state = 0xdeadbee;
6164 action = 0xdeadbee;
6165 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6166 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6167 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6168 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6170 state = 0xdeadbee;
6171 action = 0xdeadbee;
6172 r = MsiGetComponentState(hpkg, "sigma", &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);
6177 state = 0xdeadbee;
6178 action = 0xdeadbee;
6179 r = MsiGetComponentState(hpkg, "tau", &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);
6184 state = 0xdeadbee;
6185 action = 0xdeadbee;
6186 r = MsiGetComponentState(hpkg, "phi", &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);
6191 state = 0xdeadbee;
6192 action = 0xdeadbee;
6193 r = MsiGetComponentState(hpkg, "chi", &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);
6198 state = 0xdeadbee;
6199 action = 0xdeadbee;
6200 r = MsiGetComponentState(hpkg, "psi", &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);
6205 r = MsiDoAction( hpkg, "FileCost");
6206 ok( r == ERROR_SUCCESS, "file cost failed\n");
6208 state = 0xdeadbee;
6209 action = 0xdeadbee;
6210 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6211 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6212 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6213 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6215 state = 0xdeadbee;
6216 action = 0xdeadbee;
6217 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6219 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6220 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6222 state = 0xdeadbee;
6223 action = 0xdeadbee;
6224 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6226 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6227 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6229 state = 0xdeadbee;
6230 action = 0xdeadbee;
6231 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6233 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6234 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6236 state = 0xdeadbee;
6237 action = 0xdeadbee;
6238 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6240 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6241 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6243 state = 0xdeadbee;
6244 action = 0xdeadbee;
6245 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6247 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6250 state = 0xdeadbee;
6251 action = 0xdeadbee;
6252 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6254 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6255 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6257 state = 0xdeadbee;
6258 action = 0xdeadbee;
6259 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6261 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6264 state = 0xdeadbee;
6265 action = 0xdeadbee;
6266 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6268 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6269 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6271 state = 0xdeadbee;
6272 action = 0xdeadbee;
6273 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6275 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6276 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6278 state = 0xdeadbee;
6279 action = 0xdeadbee;
6280 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6282 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6283 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6285 state = 0xdeadbee;
6286 action = 0xdeadbee;
6287 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6288 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6289 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6290 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6292 state = 0xdeadbee;
6293 action = 0xdeadbee;
6294 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6295 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6296 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6297 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6299 state = 0xdeadbee;
6300 action = 0xdeadbee;
6301 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6302 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6303 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6304 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6306 state = 0xdeadbee;
6307 action = 0xdeadbee;
6308 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6309 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6310 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6311 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6313 state = 0xdeadbee;
6314 action = 0xdeadbee;
6315 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6316 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6317 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6318 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6320 state = 0xdeadbee;
6321 action = 0xdeadbee;
6322 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6323 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6324 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6325 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6327 state = 0xdeadbee;
6328 action = 0xdeadbee;
6329 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6330 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6331 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6332 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6334 state = 0xdeadbee;
6335 action = 0xdeadbee;
6336 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6337 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6338 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6339 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6341 state = 0xdeadbee;
6342 action = 0xdeadbee;
6343 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6344 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6345 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6346 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6348 state = 0xdeadbee;
6349 action = 0xdeadbee;
6350 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6351 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6352 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6353 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6355 state = 0xdeadbee;
6356 action = 0xdeadbee;
6357 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6358 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6359 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6360 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6362 state = 0xdeadbee;
6363 action = 0xdeadbee;
6364 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6365 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6366 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6367 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6369 state = 0xdeadbee;
6370 action = 0xdeadbee;
6371 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6372 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6373 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6374 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6376 state = 0xdeadbee;
6377 action = 0xdeadbee;
6378 r = MsiGetComponentState(hpkg, "xi", &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);
6383 state = 0xdeadbee;
6384 action = 0xdeadbee;
6385 r = MsiGetComponentState(hpkg, "omicron", &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);
6390 state = 0xdeadbee;
6391 action = 0xdeadbee;
6392 r = MsiGetComponentState(hpkg, "pi", &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);
6397 state = 0xdeadbee;
6398 action = 0xdeadbee;
6399 r = MsiGetComponentState(hpkg, "rho", &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);
6404 state = 0xdeadbee;
6405 action = 0xdeadbee;
6406 r = MsiGetComponentState(hpkg, "sigma", &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);
6411 state = 0xdeadbee;
6412 action = 0xdeadbee;
6413 r = MsiGetComponentState(hpkg, "tau", &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);
6418 state = 0xdeadbee;
6419 action = 0xdeadbee;
6420 r = MsiGetComponentState(hpkg, "phi", &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);
6425 state = 0xdeadbee;
6426 action = 0xdeadbee;
6427 r = MsiGetComponentState(hpkg, "chi", &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);
6432 state = 0xdeadbee;
6433 action = 0xdeadbee;
6434 r = MsiGetComponentState(hpkg, "psi", &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);
6439 r = MsiDoAction( hpkg, "CostFinalize");
6440 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6442 state = 0xdeadbee;
6443 action = 0xdeadbee;
6444 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6445 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6446 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6447 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6449 state = 0xdeadbee;
6450 action = 0xdeadbee;
6451 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6452 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6453 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6454 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6456 state = 0xdeadbee;
6457 action = 0xdeadbee;
6458 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6459 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6460 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6461 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6463 state = 0xdeadbee;
6464 action = 0xdeadbee;
6465 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6466 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6467 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6468 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6470 state = 0xdeadbee;
6471 action = 0xdeadbee;
6472 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6473 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6474 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6475 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6477 state = 0xdeadbee;
6478 action = 0xdeadbee;
6479 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6480 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6481 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6482 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6484 state = 0xdeadbee;
6485 action = 0xdeadbee;
6486 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6487 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6488 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6489 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6491 state = 0xdeadbee;
6492 action = 0xdeadbee;
6493 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6494 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6495 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6496 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6498 state = 0xdeadbee;
6499 action = 0xdeadbee;
6500 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6501 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6502 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6503 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6505 state = 0xdeadbee;
6506 action = 0xdeadbee;
6507 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6508 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6509 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6510 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6512 state = 0xdeadbee;
6513 action = 0xdeadbee;
6514 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6515 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6516 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6517 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6519 state = 0xdeadbee;
6520 action = 0xdeadbee;
6521 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6522 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6523 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6524 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6526 state = 0xdeadbee;
6527 action = 0xdeadbee;
6528 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6529 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6530 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6531 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6533 state = 0xdeadbee;
6534 action = 0xdeadbee;
6535 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6536 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6537 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6538 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6540 state = 0xdeadbee;
6541 action = 0xdeadbee;
6542 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6543 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6544 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6545 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6547 state = 0xdeadbee;
6548 action = 0xdeadbee;
6549 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6550 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6551 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6552 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6554 state = 0xdeadbee;
6555 action = 0xdeadbee;
6556 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6557 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6558 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6559 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6561 state = 0xdeadbee;
6562 action = 0xdeadbee;
6563 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6564 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6565 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6566 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6568 state = 0xdeadbee;
6569 action = 0xdeadbee;
6570 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6571 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6572 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6573 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6575 state = 0xdeadbee;
6576 action = 0xdeadbee;
6577 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6578 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6579 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6580 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6582 state = 0xdeadbee;
6583 action = 0xdeadbee;
6584 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6585 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6586 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6587 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6589 state = 0xdeadbee;
6590 action = 0xdeadbee;
6591 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6592 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6593 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6594 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6596 state = 0xdeadbee;
6597 action = 0xdeadbee;
6598 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6599 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6600 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6601 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6603 state = 0xdeadbee;
6604 action = 0xdeadbee;
6605 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6606 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6607 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6608 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6610 state = 0xdeadbee;
6611 action = 0xdeadbee;
6612 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6613 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6614 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6615 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6617 state = 0xdeadbee;
6618 action = 0xdeadbee;
6619 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6620 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6621 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6622 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6624 state = 0xdeadbee;
6625 action = 0xdeadbee;
6626 r = MsiGetComponentState(hpkg, "pi", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6631 state = 0xdeadbee;
6632 action = 0xdeadbee;
6633 r = MsiGetComponentState(hpkg, "rho", &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_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6638 state = 0xdeadbee;
6639 action = 0xdeadbee;
6640 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6641 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6642 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6643 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6645 state = 0xdeadbee;
6646 action = 0xdeadbee;
6647 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6648 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6649 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6650 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6652 state = 0xdeadbee;
6653 action = 0xdeadbee;
6654 r = MsiGetComponentState(hpkg, "phi", &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( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6659 state = 0xdeadbee;
6660 action = 0xdeadbee;
6661 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6662 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6663 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6664 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6666 state = 0xdeadbee;
6667 action = 0xdeadbee;
6668 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6669 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6670 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6671 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6673 MsiCloseHandle(hpkg);
6675 /* reinstall the product */
6676 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6679 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6680 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6682 /* this property must not be in the saved msi file */
6683 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6684 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6686 r = package_from_db( hdb, &hpkg );
6687 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
6689 state = 0xdeadbee;
6690 action = 0xdeadbee;
6691 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6692 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6693 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6694 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6696 state = 0xdeadbee;
6697 action = 0xdeadbee;
6698 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6699 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6700 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6701 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6703 state = 0xdeadbee;
6704 action = 0xdeadbee;
6705 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6706 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6707 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6708 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6710 state = 0xdeadbee;
6711 action = 0xdeadbee;
6712 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6713 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6714 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6715 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6717 state = 0xdeadbee;
6718 action = 0xdeadbee;
6719 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6720 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6721 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6722 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6724 state = 0xdeadbee;
6725 action = 0xdeadbee;
6726 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6727 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6728 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6729 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6731 state = 0xdeadbee;
6732 action = 0xdeadbee;
6733 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6734 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6735 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6736 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6738 state = 0xdeadbee;
6739 action = 0xdeadbee;
6740 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6741 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6742 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6743 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6745 state = 0xdeadbee;
6746 action = 0xdeadbee;
6747 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6748 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6749 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6750 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6752 state = 0xdeadbee;
6753 action = 0xdeadbee;
6754 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6755 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6756 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6757 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6759 state = 0xdeadbee;
6760 action = 0xdeadbee;
6761 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6762 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6763 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6764 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6766 state = 0xdeadbee;
6767 action = 0xdeadbee;
6768 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6769 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6770 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6771 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6773 state = 0xdeadbee;
6774 action = 0xdeadbee;
6775 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6776 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6777 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6778 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6780 state = 0xdeadbee;
6781 action = 0xdeadbee;
6782 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6783 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6784 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6785 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6787 state = 0xdeadbee;
6788 action = 0xdeadbee;
6789 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6790 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6794 state = 0xdeadbee;
6795 action = 0xdeadbee;
6796 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6797 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6801 state = 0xdeadbee;
6802 action = 0xdeadbee;
6803 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6804 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6808 state = 0xdeadbee;
6809 action = 0xdeadbee;
6810 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6811 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6815 state = 0xdeadbee;
6816 action = 0xdeadbee;
6817 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6818 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6822 state = 0xdeadbee;
6823 action = 0xdeadbee;
6824 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6825 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6826 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6827 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6829 state = 0xdeadbee;
6830 action = 0xdeadbee;
6831 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6832 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6833 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6834 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6836 state = 0xdeadbee;
6837 action = 0xdeadbee;
6838 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6839 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6840 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6841 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6843 state = 0xdeadbee;
6844 action = 0xdeadbee;
6845 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6846 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6847 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6848 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6850 state = 0xdeadbee;
6851 action = 0xdeadbee;
6852 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6853 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6854 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6855 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6857 state = 0xdeadbee;
6858 action = 0xdeadbee;
6859 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6860 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6861 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6862 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6864 state = 0xdeadbee;
6865 action = 0xdeadbee;
6866 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6867 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6868 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6869 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6871 state = 0xdeadbee;
6872 action = 0xdeadbee;
6873 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6874 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6875 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6876 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6878 state = 0xdeadbee;
6879 action = 0xdeadbee;
6880 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6881 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6882 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6883 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6885 state = 0xdeadbee;
6886 action = 0xdeadbee;
6887 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6888 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6889 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6890 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6892 state = 0xdeadbee;
6893 action = 0xdeadbee;
6894 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6895 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6896 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6897 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6899 state = 0xdeadbee;
6900 action = 0xdeadbee;
6901 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6902 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6903 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6904 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6906 state = 0xdeadbee;
6907 action = 0xdeadbee;
6908 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6909 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6910 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6911 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6913 state = 0xdeadbee;
6914 action = 0xdeadbee;
6915 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6916 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6917 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6918 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6920 r = MsiDoAction( hpkg, "CostInitialize");
6921 ok( r == ERROR_SUCCESS, "cost init failed\n");
6923 state = 0xdeadbee;
6924 action = 0xdeadbee;
6925 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6926 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6927 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6928 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6930 state = 0xdeadbee;
6931 action = 0xdeadbee;
6932 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6933 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6934 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6935 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6937 state = 0xdeadbee;
6938 action = 0xdeadbee;
6939 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6940 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6941 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6942 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6944 state = 0xdeadbee;
6945 action = 0xdeadbee;
6946 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6947 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6948 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6949 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6951 state = 0xdeadbee;
6952 action = 0xdeadbee;
6953 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6954 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6955 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6956 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6958 state = 0xdeadbee;
6959 action = 0xdeadbee;
6960 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6961 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6962 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6963 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6965 state = 0xdeadbee;
6966 action = 0xdeadbee;
6967 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6968 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6969 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6970 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6972 state = 0xdeadbee;
6973 action = 0xdeadbee;
6974 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6979 state = 0xdeadbee;
6980 action = 0xdeadbee;
6981 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6986 state = 0xdeadbee;
6987 action = 0xdeadbee;
6988 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6993 state = 0xdeadbee;
6994 action = 0xdeadbee;
6995 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7000 state = 0xdeadbee;
7001 action = 0xdeadbee;
7002 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7004 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7007 state = 0xdeadbee;
7008 action = 0xdeadbee;
7009 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7014 state = 0xdeadbee;
7015 action = 0xdeadbee;
7016 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7021 state = 0xdeadbee;
7022 action = 0xdeadbee;
7023 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7028 state = 0xdeadbee;
7029 action = 0xdeadbee;
7030 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7035 state = 0xdeadbee;
7036 action = 0xdeadbee;
7037 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7042 state = 0xdeadbee;
7043 action = 0xdeadbee;
7044 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7049 state = 0xdeadbee;
7050 action = 0xdeadbee;
7051 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7056 state = 0xdeadbee;
7057 action = 0xdeadbee;
7058 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7060 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7061 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7063 state = 0xdeadbee;
7064 action = 0xdeadbee;
7065 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7067 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7068 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7070 state = 0xdeadbee;
7071 action = 0xdeadbee;
7072 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7074 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7075 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7077 state = 0xdeadbee;
7078 action = 0xdeadbee;
7079 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7081 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7082 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7084 state = 0xdeadbee;
7085 action = 0xdeadbee;
7086 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7088 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7089 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7091 state = 0xdeadbee;
7092 action = 0xdeadbee;
7093 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7095 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7096 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7098 state = 0xdeadbee;
7099 action = 0xdeadbee;
7100 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7102 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7103 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7105 state = 0xdeadbee;
7106 action = 0xdeadbee;
7107 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7109 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7112 state = 0xdeadbee;
7113 action = 0xdeadbee;
7114 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7116 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7119 state = 0xdeadbee;
7120 action = 0xdeadbee;
7121 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7123 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7126 state = 0xdeadbee;
7127 action = 0xdeadbee;
7128 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7130 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7131 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7133 state = 0xdeadbee;
7134 action = 0xdeadbee;
7135 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7137 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7140 state = 0xdeadbee;
7141 action = 0xdeadbee;
7142 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7144 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7145 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7147 state = 0xdeadbee;
7148 action = 0xdeadbee;
7149 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7151 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7154 r = MsiDoAction( hpkg, "FileCost");
7155 ok( r == ERROR_SUCCESS, "file cost failed\n");
7157 state = 0xdeadbee;
7158 action = 0xdeadbee;
7159 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7164 state = 0xdeadbee;
7165 action = 0xdeadbee;
7166 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7171 state = 0xdeadbee;
7172 action = 0xdeadbee;
7173 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7178 state = 0xdeadbee;
7179 action = 0xdeadbee;
7180 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7185 state = 0xdeadbee;
7186 action = 0xdeadbee;
7187 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7192 state = 0xdeadbee;
7193 action = 0xdeadbee;
7194 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7199 state = 0xdeadbee;
7200 action = 0xdeadbee;
7201 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7206 state = 0xdeadbee;
7207 action = 0xdeadbee;
7208 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7213 state = 0xdeadbee;
7214 action = 0xdeadbee;
7215 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7220 state = 0xdeadbee;
7221 action = 0xdeadbee;
7222 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7227 state = 0xdeadbee;
7228 action = 0xdeadbee;
7229 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7234 state = 0xdeadbee;
7235 action = 0xdeadbee;
7236 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7241 state = 0xdeadbee;
7242 action = 0xdeadbee;
7243 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7248 state = 0xdeadbee;
7249 action = 0xdeadbee;
7250 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7255 state = 0xdeadbee;
7256 action = 0xdeadbee;
7257 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7262 state = 0xdeadbee;
7263 action = 0xdeadbee;
7264 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7269 state = 0xdeadbee;
7270 action = 0xdeadbee;
7271 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7276 state = 0xdeadbee;
7277 action = 0xdeadbee;
7278 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7283 state = 0xdeadbee;
7284 action = 0xdeadbee;
7285 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7287 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7288 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7290 state = 0xdeadbee;
7291 action = 0xdeadbee;
7292 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7293 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7294 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7295 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7297 state = 0xdeadbee;
7298 action = 0xdeadbee;
7299 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7300 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7301 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7302 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7304 state = 0xdeadbee;
7305 action = 0xdeadbee;
7306 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7307 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7308 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7309 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7311 state = 0xdeadbee;
7312 action = 0xdeadbee;
7313 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7314 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7315 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7316 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7318 state = 0xdeadbee;
7319 action = 0xdeadbee;
7320 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7321 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7322 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7323 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7325 state = 0xdeadbee;
7326 action = 0xdeadbee;
7327 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7328 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7329 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7330 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7332 state = 0xdeadbee;
7333 action = 0xdeadbee;
7334 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7335 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7336 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7337 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7339 state = 0xdeadbee;
7340 action = 0xdeadbee;
7341 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7342 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7343 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7344 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7346 state = 0xdeadbee;
7347 action = 0xdeadbee;
7348 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7349 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7350 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7351 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7353 state = 0xdeadbee;
7354 action = 0xdeadbee;
7355 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7356 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7357 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7358 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7360 state = 0xdeadbee;
7361 action = 0xdeadbee;
7362 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7363 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7364 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7365 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7367 state = 0xdeadbee;
7368 action = 0xdeadbee;
7369 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7371 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7372 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7374 state = 0xdeadbee;
7375 action = 0xdeadbee;
7376 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7378 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7381 state = 0xdeadbee;
7382 action = 0xdeadbee;
7383 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7388 r = MsiDoAction( hpkg, "CostFinalize");
7389 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
7391 state = 0xdeadbee;
7392 action = 0xdeadbee;
7393 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7395 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7396 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7398 state = 0xdeadbee;
7399 action = 0xdeadbee;
7400 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7402 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7403 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7405 state = 0xdeadbee;
7406 action = 0xdeadbee;
7407 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7409 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7410 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7412 state = 0xdeadbee;
7413 action = 0xdeadbee;
7414 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7416 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7417 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7419 state = 0xdeadbee;
7420 action = 0xdeadbee;
7421 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7423 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7426 state = 0xdeadbee;
7427 action = 0xdeadbee;
7428 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7430 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7431 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7433 state = 0xdeadbee;
7434 action = 0xdeadbee;
7435 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7437 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7438 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7440 state = 0xdeadbee;
7441 action = 0xdeadbee;
7442 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7444 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7445 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7447 state = 0xdeadbee;
7448 action = 0xdeadbee;
7449 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7451 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7452 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7454 state = 0xdeadbee;
7455 action = 0xdeadbee;
7456 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7458 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7459 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7461 state = 0xdeadbee;
7462 action = 0xdeadbee;
7463 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7465 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7466 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7468 state = 0xdeadbee;
7469 action = 0xdeadbee;
7470 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7472 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7473 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7475 state = 0xdeadbee;
7476 action = 0xdeadbee;
7477 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7479 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7480 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7482 state = 0xdeadbee;
7483 action = 0xdeadbee;
7484 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7486 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7487 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7489 state = 0xdeadbee;
7490 action = 0xdeadbee;
7491 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7493 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7494 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7496 state = 0xdeadbee;
7497 action = 0xdeadbee;
7498 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7500 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7501 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7503 state = 0xdeadbee;
7504 action = 0xdeadbee;
7505 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7507 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7508 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7510 state = 0xdeadbee;
7511 action = 0xdeadbee;
7512 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7514 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7515 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7517 state = 0xdeadbee;
7518 action = 0xdeadbee;
7519 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7520 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7521 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7522 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7524 state = 0xdeadbee;
7525 action = 0xdeadbee;
7526 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7527 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7528 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7529 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7531 state = 0xdeadbee;
7532 action = 0xdeadbee;
7533 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7534 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7535 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7536 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7538 state = 0xdeadbee;
7539 action = 0xdeadbee;
7540 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7541 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7542 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7543 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7545 state = 0xdeadbee;
7546 action = 0xdeadbee;
7547 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7549 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7550 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7552 state = 0xdeadbee;
7553 action = 0xdeadbee;
7554 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7556 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7557 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7559 state = 0xdeadbee;
7560 action = 0xdeadbee;
7561 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7563 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7564 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7566 state = 0xdeadbee;
7567 action = 0xdeadbee;
7568 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7569 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7570 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7571 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7573 state = 0xdeadbee;
7574 action = 0xdeadbee;
7575 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7576 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7577 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7578 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7580 state = 0xdeadbee;
7581 action = 0xdeadbee;
7582 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7583 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7584 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7585 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7587 state = 0xdeadbee;
7588 action = 0xdeadbee;
7589 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7590 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7591 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7592 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7594 state = 0xdeadbee;
7595 action = 0xdeadbee;
7596 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7597 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7598 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7599 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7601 state = 0xdeadbee;
7602 action = 0xdeadbee;
7603 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7604 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7605 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7606 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7608 state = 0xdeadbee;
7609 action = 0xdeadbee;
7610 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7612 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7613 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7615 state = 0xdeadbee;
7616 action = 0xdeadbee;
7617 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7619 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7620 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7622 MsiCloseHandle(hpkg);
7624 /* uninstall the product */
7625 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7628 DeleteFileA(msifile);
7629 DeleteFileA(msifile2);
7630 DeleteFileA(msifile3);
7631 DeleteFileA(msifile4);
7634 static void test_getproperty(void)
7636 MSIHANDLE hPackage = 0;
7637 char prop[100];
7638 static CHAR empty[] = "";
7639 DWORD size;
7640 UINT r;
7642 r = package_from_db(create_package_db(), &hPackage);
7643 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7645 skip("Not enough rights to perform tests\n");
7646 DeleteFile(msifile);
7647 return;
7649 ok( r == ERROR_SUCCESS, "Failed to create package %u\n", r );
7651 /* set the property */
7652 r = MsiSetProperty(hPackage, "Name", "Value");
7653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7655 /* retrieve the size, NULL pointer */
7656 size = 0;
7657 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7659 ok( size == 5, "Expected 5, got %d\n", size);
7661 /* retrieve the size, empty string */
7662 size = 0;
7663 r = MsiGetProperty(hPackage, "Name", empty, &size);
7664 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7665 ok( size == 5, "Expected 5, got %d\n", size);
7667 /* don't change size */
7668 r = MsiGetProperty(hPackage, "Name", prop, &size);
7669 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7670 ok( size == 5, "Expected 5, got %d\n", size);
7671 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7673 /* increase the size by 1 */
7674 size++;
7675 r = MsiGetProperty(hPackage, "Name", prop, &size);
7676 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7677 ok( size == 5, "Expected 5, got %d\n", size);
7678 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7680 r = MsiCloseHandle( hPackage);
7681 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7682 DeleteFile(msifile);
7685 static void test_removefiles(void)
7687 MSIHANDLE hpkg;
7688 UINT r;
7689 MSIHANDLE hdb;
7691 hdb = create_package_db();
7692 ok ( hdb, "failed to create package database\n" );
7694 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7695 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7697 r = create_feature_table( hdb );
7698 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7700 r = create_component_table( hdb );
7701 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7703 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7704 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7706 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7707 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7709 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7710 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7712 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7713 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7715 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7716 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7718 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7719 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7721 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7722 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7724 r = create_feature_components_table( hdb );
7725 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7727 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7728 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7730 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7731 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7733 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7734 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7736 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7737 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7739 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7740 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7742 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7743 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7745 r = create_file_table( hdb );
7746 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7748 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7749 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7751 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7752 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7754 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7755 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7757 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7758 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7760 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7761 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7763 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7764 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7766 r = create_remove_file_table( hdb );
7767 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7769 r = package_from_db( hdb, &hpkg );
7770 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7772 skip("Not enough rights to perform tests\n");
7773 DeleteFile(msifile);
7774 return;
7776 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7778 MsiCloseHandle( hdb );
7780 create_test_file( "hydrogen.txt" );
7781 create_test_file( "helium.txt" );
7782 create_test_file( "lithium.txt" );
7783 create_test_file( "beryllium.txt" );
7784 create_test_file( "boron.txt" );
7785 create_test_file( "carbon.txt" );
7787 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7788 ok( r == ERROR_SUCCESS, "set property failed\n");
7790 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7792 r = MsiDoAction( hpkg, "CostInitialize");
7793 ok( r == ERROR_SUCCESS, "cost init failed\n");
7795 r = MsiDoAction( hpkg, "FileCost");
7796 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7798 r = MsiDoAction( hpkg, "CostFinalize");
7799 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7801 r = MsiDoAction( hpkg, "InstallValidate");
7802 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7804 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7805 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7807 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7808 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7810 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7811 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7813 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7814 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7816 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7817 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7819 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7820 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7822 r = MsiDoAction( hpkg, "RemoveFiles");
7823 ok( r == ERROR_SUCCESS, "remove files failed\n");
7825 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7826 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7827 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7828 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7829 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7830 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7832 MsiCloseHandle( hpkg );
7833 DeleteFileA(msifile);
7836 static void test_appsearch(void)
7838 MSIHANDLE hpkg;
7839 UINT r;
7840 MSIHANDLE hdb;
7841 CHAR prop[MAX_PATH];
7842 DWORD size;
7844 hdb = create_package_db();
7845 ok ( hdb, "failed to create package database\n" );
7847 r = create_appsearch_table( hdb );
7848 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7850 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7851 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7853 r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
7854 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7856 r = create_reglocator_table( hdb );
7857 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7859 r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7860 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7862 r = create_drlocator_table( hdb );
7863 ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
7865 r = add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7866 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7868 r = create_signature_table( hdb );
7869 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7871 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7872 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7874 r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7875 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7877 r = package_from_db( hdb, &hpkg );
7878 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7880 skip("Not enough rights to perform tests\n");
7881 DeleteFile(msifile);
7882 return;
7884 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7885 MsiCloseHandle( hdb );
7886 if (r != ERROR_SUCCESS)
7887 goto done;
7889 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7891 r = MsiDoAction( hpkg, "AppSearch" );
7892 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7894 size = sizeof(prop);
7895 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7896 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7897 todo_wine
7899 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7902 size = sizeof(prop);
7903 r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size );
7904 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7906 done:
7907 MsiCloseHandle( hpkg );
7908 DeleteFileA(msifile);
7911 static void test_appsearch_complocator(void)
7913 MSIHANDLE hpkg, hdb;
7914 CHAR path[MAX_PATH];
7915 CHAR prop[MAX_PATH];
7916 LPSTR usersid;
7917 DWORD size;
7918 UINT r;
7920 if (!get_user_sid(&usersid))
7921 return;
7923 if (is_process_limited())
7925 skip("process is limited\n");
7926 return;
7929 create_test_file("FileName1");
7930 create_test_file("FileName4");
7931 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7932 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7934 create_test_file("FileName2");
7935 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7936 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7938 create_test_file("FileName3");
7939 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7940 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7942 create_test_file("FileName5");
7943 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7944 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7946 create_test_file("FileName6");
7947 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7948 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7950 create_test_file("FileName7");
7951 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7952 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7954 /* dir is FALSE, but we're pretending it's a directory */
7955 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7956 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7958 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7959 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7960 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7962 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7963 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7964 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7966 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7967 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7968 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7970 hdb = create_package_db();
7971 ok(hdb, "Expected a valid database handle\n");
7973 r = create_appsearch_table(hdb);
7974 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7976 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7977 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7979 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7982 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7985 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7986 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7988 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7991 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7994 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7995 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7997 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7998 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8000 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8001 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8003 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8004 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8006 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8009 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8012 r = create_complocator_table(hdb);
8013 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8015 /* published component, machine, file, signature, misdbLocatorTypeFile */
8016 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
8017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8019 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
8020 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
8021 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8023 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
8024 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
8025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8027 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
8028 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
8029 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8031 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
8032 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
8033 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8035 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
8036 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
8037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8039 /* published component, machine, file, no signature, misdbLocatorTypeFile */
8040 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
8041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8043 /* unpublished component, no signature, misdbLocatorTypeDir */
8044 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
8045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8047 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
8048 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
8049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8051 /* published component, signature w/ ver, misdbLocatorTypeFile */
8052 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
8053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8055 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
8056 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
8057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8059 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
8060 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
8061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8063 r = create_signature_table(hdb);
8064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8066 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
8067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8069 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
8070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8072 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
8073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8075 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
8076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8078 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
8079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8081 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8082 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8084 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8087 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8088 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8090 r = package_from_db(hdb, &hpkg);
8091 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8093 skip("Not enough rights to perform tests\n");
8094 goto error;
8096 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8098 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
8099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8101 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8103 r = MsiDoAction(hpkg, "AppSearch");
8104 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8106 size = MAX_PATH;
8107 sprintf(path, "%s\\FileName1", CURR_DIR);
8108 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8110 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8112 size = MAX_PATH;
8113 sprintf(path, "%s\\FileName2", CURR_DIR);
8114 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8116 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8118 size = MAX_PATH;
8119 sprintf(path, "%s\\FileName3", CURR_DIR);
8120 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8122 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8124 size = MAX_PATH;
8125 sprintf(path, "%s\\FileName4", CURR_DIR);
8126 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8127 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8128 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8130 size = MAX_PATH;
8131 sprintf(path, "%s\\FileName5", CURR_DIR);
8132 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8133 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8134 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8136 size = MAX_PATH;
8137 sprintf(path, "%s\\", CURR_DIR);
8138 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8140 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8142 size = MAX_PATH;
8143 sprintf(path, "%s\\", CURR_DIR);
8144 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8146 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8148 size = MAX_PATH;
8149 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8151 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
8153 size = MAX_PATH;
8154 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8155 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8156 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8158 size = MAX_PATH;
8159 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
8160 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8161 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8162 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8164 size = MAX_PATH;
8165 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8167 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8169 size = MAX_PATH;
8170 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
8171 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8172 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8173 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8175 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
8176 MSIINSTALLCONTEXT_MACHINE, NULL);
8177 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
8178 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
8179 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
8180 MSIINSTALLCONTEXT_USERMANAGED, usersid);
8181 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
8182 MSIINSTALLCONTEXT_MACHINE, NULL);
8183 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
8184 MSIINSTALLCONTEXT_MACHINE, NULL);
8185 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
8186 MSIINSTALLCONTEXT_MACHINE, NULL);
8187 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
8188 MSIINSTALLCONTEXT_MACHINE, NULL);
8189 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
8190 MSIINSTALLCONTEXT_MACHINE, NULL);
8191 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
8192 MSIINSTALLCONTEXT_MACHINE, NULL);
8193 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
8194 MSIINSTALLCONTEXT_MACHINE, NULL);
8196 MsiCloseHandle(hpkg);
8198 error:
8199 DeleteFileA("FileName1");
8200 DeleteFileA("FileName2");
8201 DeleteFileA("FileName3");
8202 DeleteFileA("FileName4");
8203 DeleteFileA("FileName5");
8204 DeleteFileA("FileName6");
8205 DeleteFileA("FileName7");
8206 DeleteFileA("FileName8.dll");
8207 DeleteFileA("FileName9.dll");
8208 DeleteFileA("FileName10.dll");
8209 DeleteFileA(msifile);
8210 LocalFree(usersid);
8213 static void test_appsearch_reglocator(void)
8215 MSIHANDLE hpkg, hdb;
8216 CHAR path[MAX_PATH], prop[MAX_PATH];
8217 DWORD binary[2], size, val;
8218 BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
8219 HKEY hklm, classes, hkcu, users;
8220 LPSTR pathdata, pathvar, ptr;
8221 LPCSTR str;
8222 LONG res;
8223 UINT r, type = 0;
8225 version = TRUE;
8226 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8227 version = FALSE;
8229 DeleteFileA("test.dll");
8231 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
8232 if (res == ERROR_ACCESS_DENIED)
8234 skip("Not enough rights to perform tests\n");
8235 return;
8237 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8239 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
8240 (const BYTE *)"regszdata", 10);
8241 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8243 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
8244 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8246 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
8247 (const BYTE *)"regszdata", 10);
8248 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8250 users = 0;
8251 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
8252 ok(res == ERROR_SUCCESS ||
8253 broken(res == ERROR_INVALID_PARAMETER),
8254 "Expected ERROR_SUCCESS, got %d\n", res);
8256 if (res == ERROR_SUCCESS)
8258 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
8259 (const BYTE *)"regszdata", 10);
8260 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8263 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
8264 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8266 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
8267 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8269 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
8270 (const BYTE *)"regszdata", 10);
8271 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8273 val = 42;
8274 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
8275 (const BYTE *)&val, sizeof(DWORD));
8276 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8278 val = -42;
8279 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
8280 (const BYTE *)&val, sizeof(DWORD));
8281 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8283 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
8284 (const BYTE *)"%PATH%", 7);
8285 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8287 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
8288 (const BYTE *)"my%NOVAR%", 10);
8289 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8291 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
8292 (const BYTE *)"one\0two\0", 9);
8293 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8295 binary[0] = 0x1234abcd;
8296 binary[1] = 0x567890ef;
8297 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
8298 (const BYTE *)binary, sizeof(binary));
8299 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8301 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
8302 (const BYTE *)"#regszdata", 11);
8303 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8305 create_test_file("FileName1");
8306 sprintf(path, "%s\\FileName1", CURR_DIR);
8307 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
8308 (const BYTE *)path, lstrlenA(path) + 1);
8309 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8311 sprintf(path, "%s\\FileName2", CURR_DIR);
8312 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
8313 (const BYTE *)path, lstrlenA(path) + 1);
8314 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8316 lstrcpyA(path, CURR_DIR);
8317 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
8318 (const BYTE *)path, lstrlenA(path) + 1);
8319 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8321 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
8322 (const BYTE *)"", 1);
8323 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8325 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8326 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8327 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
8328 (const BYTE *)path, lstrlenA(path) + 1);
8329 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8331 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8332 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8333 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
8334 (const BYTE *)path, lstrlenA(path) + 1);
8335 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8337 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8338 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8339 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
8340 (const BYTE *)path, lstrlenA(path) + 1);
8341 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8343 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
8344 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
8345 (const BYTE *)path, lstrlenA(path) + 1);
8347 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
8348 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
8349 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
8350 (const BYTE *)path, lstrlenA(path) + 1);
8352 hdb = create_package_db();
8353 ok(hdb, "Expected a valid database handle\n");
8355 r = create_appsearch_table(hdb);
8356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8358 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8361 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8362 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8364 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8367 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8370 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8373 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8374 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8376 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8379 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8382 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8385 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8388 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8391 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8394 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8397 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
8398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8400 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
8401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8403 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
8404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8406 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
8407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8409 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
8410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8412 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
8413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8415 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
8416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8418 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
8419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8421 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
8422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8424 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
8425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8427 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
8428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8430 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
8431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8433 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
8434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8436 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
8437 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8439 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
8440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8442 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
8443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8445 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
8446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8448 r = create_reglocator_table(hdb);
8449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8451 type = msidbLocatorTypeRawValue;
8452 if (is_64bit)
8453 type |= msidbLocatorType64bit;
8455 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8456 r = add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine", "Value1", type);
8457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8459 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8460 r = add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine", "Value2", type);
8461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8463 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8464 r = add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine", "Value3", type);
8465 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8467 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8468 r = add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine", "Value4", type);
8469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8471 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8472 r = add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine", "Value5", type);
8473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8475 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8476 r = add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine", "Value6", type);
8477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8479 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8480 r = add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine", "Value7", type);
8481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8483 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8484 r = add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine", "Value8", type);
8485 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8487 type = msidbLocatorTypeFileName;
8488 if (is_64bit)
8489 type |= msidbLocatorType64bit;
8491 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8492 r = add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine", "Value9", type);
8493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8495 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8496 r = add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine", "Value10", type);
8497 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8499 /* HKLM, msidbLocatorTypeFileName, no signature */
8500 r = add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine", "Value9", type);
8501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8503 type = msidbLocatorTypeDirectory;
8504 if (is_64bit)
8505 type |= msidbLocatorType64bit;
8507 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8508 r = add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine", "Value9", type);
8509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8511 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8512 r = add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine", "Value11", type);
8513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8515 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8516 r = add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine", "Value9", type);
8517 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8519 type = msidbLocatorTypeRawValue;
8520 if (is_64bit)
8521 type |= msidbLocatorType64bit;
8523 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8524 r = add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine", "Value1", type);
8525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8527 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8528 r = add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine", "Value1", type);
8529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8531 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8532 r = add_reglocator_entry(hdb, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type);
8533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8535 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8536 r = add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine", "", type);
8537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8539 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8540 r = add_reglocator_entry(hdb, "NewSignature19", 2, "Software\\IDontExist", "", type);
8541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8543 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8544 r = add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine", "Value12", type);
8545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8547 type = msidbLocatorTypeFileName;
8548 if (is_64bit)
8549 type |= msidbLocatorType64bit;
8551 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8552 r = add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine", "Value13", type);
8553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8555 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8556 r = add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine", "Value14", type);
8557 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8559 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8560 r = add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine", "Value15", type);
8561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8563 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8564 r = add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine", "Value11", type);
8565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8567 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8568 r = add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine", "Value10", type);
8569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8571 type = msidbLocatorTypeDirectory;
8572 if (is_64bit)
8573 type |= msidbLocatorType64bit;
8575 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8576 r = add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine", "Value11", type);
8577 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8579 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8580 r = add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine", "Value10", type);
8581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8583 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8584 r = add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine", "Value10", type);
8585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8587 type = msidbLocatorTypeFileName;
8588 if (is_64bit)
8589 type |= msidbLocatorType64bit;
8591 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8592 r = add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine", "Value16", type);
8593 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8595 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8596 r = add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine", "Value17", type);
8597 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8599 r = create_signature_table(hdb);
8600 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8602 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8603 r = add_signature_entry(hdb, str);
8604 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8606 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8607 r = add_signature_entry(hdb, str);
8608 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8610 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8611 r = add_signature_entry(hdb, str);
8612 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8614 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8615 r = add_signature_entry(hdb, str);
8616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8618 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8619 r = add_signature_entry(hdb, str);
8620 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8622 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8623 r = add_signature_entry(hdb, str);
8624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8626 ptr = strrchr(CURR_DIR, '\\') + 1;
8627 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8628 r = add_signature_entry(hdb, path);
8629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8631 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8632 r = add_signature_entry(hdb, str);
8633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8635 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8636 r = add_signature_entry(hdb, str);
8637 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8639 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8640 r = add_signature_entry(hdb, str);
8641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8643 r = package_from_db(hdb, &hpkg);
8644 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8646 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8648 r = MsiDoAction(hpkg, "AppSearch");
8649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8651 size = MAX_PATH;
8652 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8653 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8654 ok(!lstrcmpA(prop, "regszdata"),
8655 "Expected \"regszdata\", got \"%s\"\n", prop);
8657 size = MAX_PATH;
8658 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8659 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8660 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8662 size = MAX_PATH;
8663 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8664 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8665 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8667 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8668 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8670 /* Workaround for Win95 */
8671 CHAR tempbuf[1];
8672 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8674 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8675 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8677 size = 0;
8678 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8681 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8682 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8683 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8684 ok(!lstrcmpA(pathdata, pathvar),
8685 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8687 HeapFree(GetProcessHeap(), 0, pathvar);
8688 HeapFree(GetProcessHeap(), 0, pathdata);
8690 size = MAX_PATH;
8691 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8692 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8693 ok(!lstrcmpA(prop,
8694 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8696 size = MAX_PATH;
8697 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8699 todo_wine
8701 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8702 "Expected \"\\0one\\0two\\0\\0\"\n");
8705 size = MAX_PATH;
8706 lstrcpyA(path, "#xCDAB3412EF907856");
8707 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8709 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8711 size = MAX_PATH;
8712 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8714 ok(!lstrcmpA(prop, "##regszdata"),
8715 "Expected \"##regszdata\", got \"%s\"\n", prop);
8717 size = MAX_PATH;
8718 sprintf(path, "%s\\FileName1", CURR_DIR);
8719 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8721 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8723 size = MAX_PATH;
8724 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8725 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8726 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8728 size = MAX_PATH;
8729 sprintf(path, "%s\\", CURR_DIR);
8730 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8731 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8732 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8734 size = MAX_PATH;
8735 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8736 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8737 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8739 size = MAX_PATH;
8740 sprintf(path, "%s\\", CURR_DIR);
8741 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8742 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8743 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8745 size = MAX_PATH;
8746 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8747 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8748 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8750 size = MAX_PATH;
8751 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8753 ok(!lstrcmpA(prop, "regszdata"),
8754 "Expected \"regszdata\", got \"%s\"\n", prop);
8756 size = MAX_PATH;
8757 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8758 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8759 ok(!lstrcmpA(prop, "regszdata"),
8760 "Expected \"regszdata\", got \"%s\"\n", prop);
8762 if (users)
8764 size = MAX_PATH;
8765 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8766 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8767 ok(!lstrcmpA(prop, "regszdata"),
8768 "Expected \"regszdata\", got \"%s\"\n", prop);
8771 size = MAX_PATH;
8772 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8774 ok(!lstrcmpA(prop, "defvalue"),
8775 "Expected \"defvalue\", got \"%s\"\n", prop);
8777 size = MAX_PATH;
8778 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8780 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8782 size = MAX_PATH;
8783 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8785 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8787 if (version)
8789 size = MAX_PATH;
8790 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8791 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8793 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8795 size = MAX_PATH;
8796 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8797 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8798 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8800 size = MAX_PATH;
8801 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8802 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8804 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8807 size = MAX_PATH;
8808 lstrcpyA(path, CURR_DIR);
8809 ptr = strrchr(path, '\\') + 1;
8810 *ptr = '\0';
8811 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8812 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8813 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8815 size = MAX_PATH;
8816 sprintf(path, "%s\\", CURR_DIR);
8817 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8819 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8821 size = MAX_PATH;
8822 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8824 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8826 size = MAX_PATH;
8827 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8829 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8831 size = MAX_PATH;
8832 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8834 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8836 size = MAX_PATH;
8837 sprintf(path, "%s\\FileName1", CURR_DIR);
8838 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8839 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8840 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8842 size = MAX_PATH;
8843 sprintf(path, "%s\\FileName1", CURR_DIR);
8844 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8845 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8846 if (space)
8847 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8848 else
8849 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8851 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8852 RegDeleteValueA(hklm, "Value1");
8853 RegDeleteValueA(hklm, "Value2");
8854 RegDeleteValueA(hklm, "Value3");
8855 RegDeleteValueA(hklm, "Value4");
8856 RegDeleteValueA(hklm, "Value5");
8857 RegDeleteValueA(hklm, "Value6");
8858 RegDeleteValueA(hklm, "Value7");
8859 RegDeleteValueA(hklm, "Value8");
8860 RegDeleteValueA(hklm, "Value9");
8861 RegDeleteValueA(hklm, "Value10");
8862 RegDeleteValueA(hklm, "Value11");
8863 RegDeleteValueA(hklm, "Value12");
8864 RegDeleteValueA(hklm, "Value13");
8865 RegDeleteValueA(hklm, "Value14");
8866 RegDeleteValueA(hklm, "Value15");
8867 RegDeleteValueA(hklm, "Value16");
8868 RegDeleteValueA(hklm, "Value17");
8869 RegDeleteKey(hklm, "");
8870 RegCloseKey(hklm);
8872 RegDeleteValueA(classes, "Value1");
8873 RegDeleteKeyA(classes, "");
8874 RegCloseKey(classes);
8876 RegDeleteValueA(hkcu, "Value1");
8877 RegDeleteKeyA(hkcu, "");
8878 RegCloseKey(hkcu);
8880 RegDeleteValueA(users, "Value1");
8881 RegDeleteKeyA(users, "");
8882 RegCloseKey(users);
8884 DeleteFileA("FileName1");
8885 DeleteFileA("FileName3.dll");
8886 DeleteFileA("FileName4.dll");
8887 DeleteFileA("FileName5.dll");
8888 MsiCloseHandle(hpkg);
8889 DeleteFileA(msifile);
8892 static void delete_win_ini(LPCSTR file)
8894 CHAR path[MAX_PATH];
8896 GetWindowsDirectoryA(path, MAX_PATH);
8897 lstrcatA(path, "\\");
8898 lstrcatA(path, file);
8900 DeleteFileA(path);
8903 static void test_appsearch_inilocator(void)
8905 MSIHANDLE hpkg, hdb;
8906 CHAR path[MAX_PATH];
8907 CHAR prop[MAX_PATH];
8908 BOOL version;
8909 LPCSTR str;
8910 LPSTR ptr;
8911 DWORD size;
8912 UINT r;
8914 version = TRUE;
8915 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8916 version = FALSE;
8918 DeleteFileA("test.dll");
8920 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8922 create_test_file("FileName1");
8923 sprintf(path, "%s\\FileName1", CURR_DIR);
8924 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8926 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8928 sprintf(path, "%s\\IDontExist", CURR_DIR);
8929 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8931 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8932 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8933 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8935 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8936 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8937 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8939 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8940 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8941 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8943 hdb = create_package_db();
8944 ok(hdb, "Expected a valid database handle\n");
8946 r = create_appsearch_table(hdb);
8947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8949 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8952 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8953 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8955 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8956 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8958 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8959 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8961 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8964 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8967 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8968 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8970 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8973 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8974 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8976 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8977 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8979 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8980 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8982 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8983 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8985 r = create_inilocator_table(hdb);
8986 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8988 /* msidbLocatorTypeRawValue, field 1 */
8989 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8990 r = add_inilocator_entry(hdb, str);
8991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8993 /* msidbLocatorTypeRawValue, field 2 */
8994 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8995 r = add_inilocator_entry(hdb, str);
8996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8998 /* msidbLocatorTypeRawValue, entire field */
8999 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
9000 r = add_inilocator_entry(hdb, str);
9001 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9003 /* msidbLocatorTypeFile */
9004 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9005 r = add_inilocator_entry(hdb, str);
9006 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9008 /* msidbLocatorTypeDirectory, file */
9009 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9010 r = add_inilocator_entry(hdb, str);
9011 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9013 /* msidbLocatorTypeDirectory, directory */
9014 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9015 r = add_inilocator_entry(hdb, str);
9016 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9018 /* msidbLocatorTypeFile, file, no signature */
9019 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9020 r = add_inilocator_entry(hdb, str);
9021 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9023 /* msidbLocatorTypeFile, dir, no signature */
9024 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9025 r = add_inilocator_entry(hdb, str);
9026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9028 /* msidbLocatorTypeFile, file does not exist */
9029 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9030 r = add_inilocator_entry(hdb, str);
9031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9033 /* msidbLocatorTypeFile, signature with version */
9034 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9035 r = add_inilocator_entry(hdb, str);
9036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9038 /* msidbLocatorTypeFile, signature with version, ver > max */
9039 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
9040 r = add_inilocator_entry(hdb, str);
9041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9043 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
9044 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9045 r = add_inilocator_entry(hdb, str);
9046 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9048 r = create_signature_table(hdb);
9049 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9051 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9054 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9057 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9060 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9063 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9066 r = package_from_db(hdb, &hpkg);
9067 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9069 skip("Not enough rights to perform tests\n");
9070 goto error;
9072 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9074 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9076 r = MsiDoAction(hpkg, "AppSearch");
9077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9079 size = MAX_PATH;
9080 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9082 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
9084 size = MAX_PATH;
9085 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9087 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
9089 size = MAX_PATH;
9090 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9092 ok(!lstrcmpA(prop, "keydata,field2"),
9093 "Expected \"keydata,field2\", got \"%s\"\n", prop);
9095 size = MAX_PATH;
9096 sprintf(path, "%s\\FileName1", CURR_DIR);
9097 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9099 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9101 size = MAX_PATH;
9102 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9104 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9106 size = MAX_PATH;
9107 sprintf(path, "%s\\", CURR_DIR);
9108 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9110 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9112 size = MAX_PATH;
9113 sprintf(path, "%s\\", CURR_DIR);
9114 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9116 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9118 size = MAX_PATH;
9119 lstrcpyA(path, CURR_DIR);
9120 ptr = strrchr(path, '\\');
9121 *(ptr + 1) = '\0';
9122 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9124 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9126 size = MAX_PATH;
9127 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9128 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9129 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9131 if (version)
9133 size = MAX_PATH;
9134 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9135 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9137 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9139 size = MAX_PATH;
9140 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9142 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9144 size = MAX_PATH;
9145 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9146 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
9147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9148 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9151 MsiCloseHandle(hpkg);
9153 error:
9154 delete_win_ini("IniFile.ini");
9155 DeleteFileA("FileName1");
9156 DeleteFileA("FileName2.dll");
9157 DeleteFileA("FileName3.dll");
9158 DeleteFileA("FileName4.dll");
9159 DeleteFileA(msifile);
9163 * MSI AppSearch action on DrLocator table always returns absolute paths.
9164 * If a relative path was set, it returns the first absolute path that
9165 * matches or an empty string if it didn't find anything.
9166 * This helper function replicates this behaviour.
9168 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
9170 int i, size;
9171 DWORD attr, drives;
9173 size = lstrlenA(relative);
9174 drives = GetLogicalDrives();
9175 lstrcpyA(absolute, "A:\\");
9176 for (i = 0; i < 26; absolute[0] = '\0', i++)
9178 if (!(drives & (1 << i)))
9179 continue;
9181 absolute[0] = 'A' + i;
9182 if (GetDriveType(absolute) != DRIVE_FIXED)
9183 continue;
9185 lstrcpynA(absolute + 3, relative, size + 1);
9186 attr = GetFileAttributesA(absolute);
9187 if (attr != INVALID_FILE_ATTRIBUTES &&
9188 (attr & FILE_ATTRIBUTE_DIRECTORY))
9190 if (absolute[3 + size - 1] != '\\')
9191 lstrcatA(absolute, "\\");
9192 break;
9194 absolute[3] = '\0';
9198 static void test_appsearch_drlocator(void)
9200 MSIHANDLE hpkg, hdb;
9201 CHAR path[MAX_PATH];
9202 CHAR prop[MAX_PATH];
9203 BOOL version;
9204 LPCSTR str;
9205 DWORD size;
9206 UINT r;
9208 version = TRUE;
9209 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9210 version = FALSE;
9212 DeleteFileA("test.dll");
9214 create_test_file("FileName1");
9215 CreateDirectoryA("one", NULL);
9216 CreateDirectoryA("one\\two", NULL);
9217 CreateDirectoryA("one\\two\\three", NULL);
9218 create_test_file("one\\two\\three\\FileName2");
9219 CreateDirectoryA("another", NULL);
9220 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9221 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9222 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9224 hdb = create_package_db();
9225 ok(hdb, "Expected a valid database handle\n");
9227 r = create_appsearch_table(hdb);
9228 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9230 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9231 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9233 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9234 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9236 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9237 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9239 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9242 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9243 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9245 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9248 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9251 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9254 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9255 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9257 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9260 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9261 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9263 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
9264 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9266 r = create_drlocator_table(hdb);
9267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9269 /* no parent, full path, depth 0, signature */
9270 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
9271 r = add_drlocator_entry(hdb, path);
9272 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9274 /* no parent, full path, depth 0, no signature */
9275 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
9276 r = add_drlocator_entry(hdb, path);
9277 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9279 /* no parent, relative path, depth 0, no signature */
9280 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
9281 r = add_drlocator_entry(hdb, path);
9282 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9284 /* no parent, full path, depth 2, signature */
9285 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
9286 r = add_drlocator_entry(hdb, path);
9287 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9289 /* no parent, full path, depth 3, signature */
9290 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
9291 r = add_drlocator_entry(hdb, path);
9292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9294 /* no parent, full path, depth 1, signature is dir */
9295 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
9296 r = add_drlocator_entry(hdb, path);
9297 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9299 /* parent is in DrLocator, relative path, depth 0, signature */
9300 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
9301 r = add_drlocator_entry(hdb, path);
9302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9304 /* no parent, full path, depth 0, signature w/ version */
9305 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
9306 r = add_drlocator_entry(hdb, path);
9307 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9309 /* no parent, full path, depth 0, signature w/ version, ver > max */
9310 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
9311 r = add_drlocator_entry(hdb, path);
9312 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9314 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9315 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
9316 r = add_drlocator_entry(hdb, path);
9317 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9319 /* no parent, relative empty path, depth 0, no signature */
9320 sprintf(path, "'NewSignature11', '', '', 0");
9321 r = add_drlocator_entry(hdb, path);
9322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9324 r = create_reglocator_table(hdb);
9325 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9327 /* parent */
9328 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9331 /* parent is in RegLocator, no path, depth 0, no signature */
9332 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9333 r = add_drlocator_entry(hdb, path);
9334 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9336 r = create_signature_table(hdb);
9337 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9339 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9340 r = add_signature_entry(hdb, str);
9341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9343 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9344 r = add_signature_entry(hdb, str);
9345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9347 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9348 r = add_signature_entry(hdb, str);
9349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9351 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9352 r = add_signature_entry(hdb, str);
9353 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9355 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9356 r = add_signature_entry(hdb, str);
9357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9359 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9360 r = add_signature_entry(hdb, str);
9361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9363 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9364 r = add_signature_entry(hdb, str);
9365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9367 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9368 r = add_signature_entry(hdb, str);
9369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9371 r = package_from_db(hdb, &hpkg);
9372 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9374 skip("Not enough rights to perform tests\n");
9375 goto error;
9377 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9379 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9381 r = MsiDoAction(hpkg, "AppSearch");
9382 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9384 size = MAX_PATH;
9385 sprintf(path, "%s\\FileName1", CURR_DIR);
9386 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9388 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9390 size = MAX_PATH;
9391 sprintf(path, "%s\\", CURR_DIR);
9392 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9394 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9396 size = MAX_PATH;
9397 search_absolute_directory(path, CURR_DIR + 3);
9398 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9400 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9402 size = MAX_PATH;
9403 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9405 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9407 size = MAX_PATH;
9408 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9409 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9411 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9413 size = MAX_PATH;
9414 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9415 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9416 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9418 size = MAX_PATH;
9419 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9420 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9422 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9424 if (version)
9426 size = MAX_PATH;
9427 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9428 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9430 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9432 size = MAX_PATH;
9433 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9435 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9437 size = MAX_PATH;
9438 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9440 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9443 size = MAX_PATH;
9444 search_absolute_directory(path, "");
9445 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9447 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9449 size = MAX_PATH;
9450 strcpy(path, "c:\\");
9451 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9452 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9453 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9455 MsiCloseHandle(hpkg);
9457 error:
9458 DeleteFileA("FileName1");
9459 DeleteFileA("FileName3.dll");
9460 DeleteFileA("FileName4.dll");
9461 DeleteFileA("FileName5.dll");
9462 DeleteFileA("one\\two\\three\\FileName2");
9463 RemoveDirectoryA("one\\two\\three");
9464 RemoveDirectoryA("one\\two");
9465 RemoveDirectoryA("one");
9466 RemoveDirectoryA("another");
9467 DeleteFileA(msifile);
9470 static void test_featureparents(void)
9472 MSIHANDLE hpkg;
9473 UINT r;
9474 MSIHANDLE hdb;
9475 INSTALLSTATE state, action;
9477 hdb = create_package_db();
9478 ok ( hdb, "failed to create package database\n" );
9480 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9481 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9483 r = create_feature_table( hdb );
9484 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9486 r = create_component_table( hdb );
9487 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9489 r = create_feature_components_table( hdb );
9490 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9492 r = create_file_table( hdb );
9493 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9495 /* msidbFeatureAttributesFavorLocal */
9496 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9497 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9499 /* msidbFeatureAttributesFavorSource */
9500 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9501 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9503 /* msidbFeatureAttributesFavorLocal */
9504 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9505 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9507 /* disabled because of install level */
9508 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9509 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9511 /* child feature of disabled feature */
9512 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9513 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9515 /* component of disabled feature (install level) */
9516 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9517 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9519 /* component of disabled child feature (install level) */
9520 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9521 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9523 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9524 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9525 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9527 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9528 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9529 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9531 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9532 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9533 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9535 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9536 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9537 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9539 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9540 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9541 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9543 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9544 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9545 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9547 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9548 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9549 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9551 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9552 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9553 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9555 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9556 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9558 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9559 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9561 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9562 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9564 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9565 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9567 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9568 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9570 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9571 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9573 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9574 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9576 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9577 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9579 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9580 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9582 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9583 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9585 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9586 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9588 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9589 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9591 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9592 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9594 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9595 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9597 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9598 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9600 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9601 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9603 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9604 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9606 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9607 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9609 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9610 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9612 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9613 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9615 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9616 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9618 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9619 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9621 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9622 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9624 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9625 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9627 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9628 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9630 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9631 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9633 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9634 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9636 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9637 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9639 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9640 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9642 r = package_from_db( hdb, &hpkg );
9643 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9645 skip("Not enough rights to perform tests\n");
9646 DeleteFile(msifile);
9647 return;
9649 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9651 MsiCloseHandle( hdb );
9653 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9655 r = MsiDoAction( hpkg, "CostInitialize");
9656 ok( r == ERROR_SUCCESS, "cost init failed\n");
9658 r = MsiDoAction( hpkg, "FileCost");
9659 ok( r == ERROR_SUCCESS, "file cost failed\n");
9661 r = MsiDoAction( hpkg, "CostFinalize");
9662 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9664 state = 0xdeadbee;
9665 action = 0xdeadbee;
9666 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9668 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9669 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9671 state = 0xdeadbee;
9672 action = 0xdeadbee;
9673 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9675 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9676 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9678 state = 0xdeadbee;
9679 action = 0xdeadbee;
9680 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9681 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9682 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9683 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9685 state = 0xdeadbee;
9686 action = 0xdeadbee;
9687 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9688 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9689 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9690 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9692 state = 0xdeadbee;
9693 action = 0xdeadbee;
9694 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9695 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9696 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9697 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9699 state = 0xdeadbee;
9700 action = 0xdeadbee;
9701 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9702 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9703 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9704 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9706 state = 0xdeadbee;
9707 action = 0xdeadbee;
9708 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9709 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9710 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9711 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9713 state = 0xdeadbee;
9714 action = 0xdeadbee;
9715 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9716 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9717 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9718 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9720 state = 0xdeadbee;
9721 action = 0xdeadbee;
9722 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9723 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9724 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9725 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9727 state = 0xdeadbee;
9728 action = 0xdeadbee;
9729 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9730 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9731 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9732 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9734 state = 0xdeadbee;
9735 action = 0xdeadbee;
9736 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9737 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9738 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9739 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9741 state = 0xdeadbee;
9742 action = 0xdeadbee;
9743 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9744 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9745 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9746 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9748 state = 0xdeadbee;
9749 action = 0xdeadbee;
9750 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9751 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9752 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9753 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9755 state = 0xdeadbee;
9756 action = 0xdeadbee;
9757 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9758 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9759 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9760 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9762 state = 0xdeadbee;
9763 action = 0xdeadbee;
9764 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9765 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9766 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9767 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9769 state = 0xdeadbee;
9770 action = 0xdeadbee;
9771 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9772 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9773 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9774 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9776 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9777 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9779 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9780 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9782 state = 0xdeadbee;
9783 action = 0xdeadbee;
9784 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9786 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9787 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9789 state = 0xdeadbee;
9790 action = 0xdeadbee;
9791 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9792 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9793 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9794 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9796 state = 0xdeadbee;
9797 action = 0xdeadbee;
9798 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9800 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9801 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9803 state = 0xdeadbee;
9804 action = 0xdeadbee;
9805 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9807 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9808 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9810 state = 0xdeadbee;
9811 action = 0xdeadbee;
9812 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9814 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9815 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9817 state = 0xdeadbee;
9818 action = 0xdeadbee;
9819 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9820 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9821 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9822 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9824 state = 0xdeadbee;
9825 action = 0xdeadbee;
9826 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9827 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9828 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9829 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9831 state = 0xdeadbee;
9832 action = 0xdeadbee;
9833 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9834 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9835 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9836 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9838 state = 0xdeadbee;
9839 action = 0xdeadbee;
9840 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9841 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9842 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9843 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9845 state = 0xdeadbee;
9846 action = 0xdeadbee;
9847 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9848 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9849 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9850 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9852 state = 0xdeadbee;
9853 action = 0xdeadbee;
9854 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9855 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9856 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9857 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9859 state = 0xdeadbee;
9860 action = 0xdeadbee;
9861 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9862 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9863 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9864 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9866 state = 0xdeadbee;
9867 action = 0xdeadbee;
9868 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9869 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9870 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9871 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9873 state = 0xdeadbee;
9874 action = 0xdeadbee;
9875 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9876 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9877 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9878 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9880 MsiCloseHandle(hpkg);
9881 DeleteFileA(msifile);
9884 static void test_installprops(void)
9886 MSIHANDLE hpkg, hdb;
9887 CHAR path[MAX_PATH], buf[MAX_PATH];
9888 DWORD size, type;
9889 LANGID langid;
9890 HKEY hkey1, hkey2;
9891 int res;
9892 UINT r;
9893 REGSAM access = KEY_ALL_ACCESS;
9894 SYSTEM_INFO si;
9896 if (is_wow64)
9897 access |= KEY_WOW64_64KEY;
9899 GetCurrentDirectory(MAX_PATH, path);
9900 lstrcat(path, "\\");
9901 lstrcat(path, msifile);
9903 hdb = create_package_db();
9904 ok( hdb, "failed to create database\n");
9906 r = package_from_db(hdb, &hpkg);
9907 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9909 skip("Not enough rights to perform tests\n");
9910 DeleteFile(msifile);
9911 return;
9913 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9915 MsiCloseHandle(hdb);
9917 size = MAX_PATH;
9918 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9919 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9920 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9922 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9923 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
9925 size = MAX_PATH;
9926 type = REG_SZ;
9927 *path = '\0';
9928 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9930 size = MAX_PATH;
9931 type = REG_SZ;
9932 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9935 /* win9x doesn't set this */
9936 if (*path)
9938 size = MAX_PATH;
9939 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9940 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9941 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9944 size = MAX_PATH;
9945 type = REG_SZ;
9946 *path = '\0';
9947 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9949 size = MAX_PATH;
9950 type = REG_SZ;
9951 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9954 if (*path)
9956 size = MAX_PATH;
9957 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9958 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9959 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9962 size = MAX_PATH;
9963 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9964 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9965 trace("VersionDatabase = %s\n", buf);
9967 size = MAX_PATH;
9968 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9969 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9970 trace("VersionMsi = %s\n", buf);
9972 size = MAX_PATH;
9973 r = MsiGetProperty(hpkg, "Date", buf, &size);
9974 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9975 trace("Date = %s\n", buf);
9977 size = MAX_PATH;
9978 r = MsiGetProperty(hpkg, "Time", buf, &size);
9979 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9980 trace("Time = %s\n", buf);
9982 size = MAX_PATH;
9983 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9984 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9985 trace("PackageCode = %s\n", buf);
9987 langid = GetUserDefaultLangID();
9988 sprintf(path, "%d", langid);
9990 size = MAX_PATH;
9991 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9992 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9993 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9995 res = GetSystemMetrics(SM_CXSCREEN);
9996 size = MAX_PATH;
9997 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9998 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10000 res = GetSystemMetrics(SM_CYSCREEN);
10001 size = MAX_PATH;
10002 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
10003 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10005 if (pGetSystemInfo && pSHGetFolderPathA)
10007 pGetSystemInfo(&si);
10008 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
10010 buf[0] = 0;
10011 size = MAX_PATH;
10012 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10013 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10014 ok(buf[0], "property not set\n");
10016 buf[0] = 0;
10017 size = MAX_PATH;
10018 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10019 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10020 ok(buf[0], "property not set\n");
10022 buf[0] = 0;
10023 size = MAX_PATH;
10024 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10025 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10026 GetSystemDirectoryA(path, MAX_PATH);
10027 if (size) buf[size - 1] = 0;
10028 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10030 buf[0] = 0;
10031 size = MAX_PATH;
10032 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10033 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10034 pGetSystemWow64DirectoryA(path, MAX_PATH);
10035 if (size) buf[size - 1] = 0;
10036 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10038 buf[0] = 0;
10039 size = MAX_PATH;
10040 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10041 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10042 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10043 if (size) buf[size - 1] = 0;
10044 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10046 buf[0] = 0;
10047 size = MAX_PATH;
10048 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10049 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10050 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10051 if (size) buf[size - 1] = 0;
10052 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10054 buf[0] = 0;
10055 size = MAX_PATH;
10056 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10057 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10058 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10059 if (size) buf[size - 1] = 0;
10060 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10062 buf[0] = 0;
10063 size = MAX_PATH;
10064 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10065 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10066 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10067 if (size) buf[size - 1] = 0;
10068 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10070 buf[0] = 0;
10071 size = MAX_PATH;
10072 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10073 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10074 ok(buf[0], "property not set\n");
10076 else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
10078 if (!is_wow64)
10080 buf[0] = 0;
10081 size = MAX_PATH;
10082 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10083 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10084 ok(!buf[0], "property set\n");
10086 buf[0] = 0;
10087 size = MAX_PATH;
10088 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10089 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10090 ok(!buf[0], "property set\n");
10092 buf[0] = 0;
10093 size = MAX_PATH;
10094 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10095 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10096 ok(!buf[0], "property set\n");
10098 buf[0] = 0;
10099 size = MAX_PATH;
10100 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10101 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10102 GetSystemDirectoryA(path, MAX_PATH);
10103 if (size) buf[size - 1] = 0;
10104 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10106 buf[0] = 0;
10107 size = MAX_PATH;
10108 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10109 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10110 ok(!buf[0], "property set\n");
10112 buf[0] = 0;
10113 size = MAX_PATH;
10114 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10115 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10116 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10117 if (size) buf[size - 1] = 0;
10118 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10120 buf[0] = 0;
10121 size = MAX_PATH;
10122 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10123 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10124 ok(!buf[0], "property set\n");
10126 buf[0] = 0;
10127 size = MAX_PATH;
10128 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10129 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10130 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10131 if (size) buf[size - 1] = 0;
10132 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10134 buf[0] = 0;
10135 size = MAX_PATH;
10136 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10137 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10138 ok(!buf[0], "property set\n");
10140 else
10142 buf[0] = 0;
10143 size = MAX_PATH;
10144 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10145 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10146 ok(buf[0], "property not set\n");
10148 buf[0] = 0;
10149 size = MAX_PATH;
10150 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10151 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10152 ok(buf[0], "property not set\n");
10154 buf[0] = 0;
10155 size = MAX_PATH;
10156 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10157 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10158 GetSystemDirectoryA(path, MAX_PATH);
10159 if (size) buf[size - 1] = 0;
10160 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10162 buf[0] = 0;
10163 size = MAX_PATH;
10164 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10165 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10166 pGetSystemWow64DirectoryA(path, MAX_PATH);
10167 if (size) buf[size - 1] = 0;
10168 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10170 buf[0] = 0;
10171 size = MAX_PATH;
10172 r = MsiGetProperty(hpkg, "ProgramFilesFolder64", buf, &size);
10173 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10174 ok(!buf[0], "property set\n");
10176 buf[0] = 0;
10177 size = MAX_PATH;
10178 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10179 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10180 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10181 if (size) buf[size - 1] = 0;
10182 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10184 buf[0] = 0;
10185 size = MAX_PATH;
10186 r = MsiGetProperty(hpkg, "CommonFilesFolder64", buf, &size);
10187 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10188 ok(!buf[0], "property set\n");
10190 buf[0] = 0;
10191 size = MAX_PATH;
10192 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10193 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10194 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10195 if (size) buf[size - 1] = 0;
10196 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10198 buf[0] = 0;
10199 size = MAX_PATH;
10200 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10201 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10202 ok(buf[0], "property not set\n");
10207 CloseHandle(hkey1);
10208 CloseHandle(hkey2);
10209 MsiCloseHandle(hpkg);
10210 DeleteFile(msifile);
10213 static void test_launchconditions(void)
10215 MSIHANDLE hpkg;
10216 MSIHANDLE hdb;
10217 UINT r;
10219 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10221 hdb = create_package_db();
10222 ok( hdb, "failed to create package database\n" );
10224 r = create_launchcondition_table( hdb );
10225 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
10227 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
10228 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10230 /* invalid condition */
10231 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
10232 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10234 r = package_from_db( hdb, &hpkg );
10235 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10237 skip("Not enough rights to perform tests\n");
10238 DeleteFile(msifile);
10239 return;
10241 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10243 MsiCloseHandle( hdb );
10245 r = MsiSetProperty( hpkg, "X", "1" );
10246 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10248 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10250 /* invalid conditions are ignored */
10251 r = MsiDoAction( hpkg, "LaunchConditions" );
10252 ok( r == ERROR_SUCCESS, "cost init failed\n" );
10254 /* verify LaunchConditions still does some verification */
10255 r = MsiSetProperty( hpkg, "X", "2" );
10256 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10258 r = MsiDoAction( hpkg, "LaunchConditions" );
10259 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
10261 MsiCloseHandle( hpkg );
10262 DeleteFile( msifile );
10265 static void test_ccpsearch(void)
10267 MSIHANDLE hdb, hpkg;
10268 CHAR prop[MAX_PATH];
10269 DWORD size = MAX_PATH;
10270 UINT r;
10272 hdb = create_package_db();
10273 ok(hdb, "failed to create package database\n");
10275 r = create_ccpsearch_table(hdb);
10276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10278 r = add_ccpsearch_entry(hdb, "'CCP_random'");
10279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10281 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
10282 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10284 r = create_reglocator_table(hdb);
10285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10287 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10288 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10290 r = create_drlocator_table(hdb);
10291 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10293 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
10294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10296 r = create_signature_table(hdb);
10297 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10299 r = package_from_db(hdb, &hpkg);
10300 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10302 skip("Not enough rights to perform tests\n");
10303 DeleteFile(msifile);
10304 return;
10306 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10308 MsiCloseHandle(hdb);
10310 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10312 r = MsiDoAction(hpkg, "CCPSearch");
10313 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10315 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
10316 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10317 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
10319 MsiCloseHandle(hpkg);
10320 DeleteFileA(msifile);
10323 static void test_complocator(void)
10325 MSIHANDLE hdb, hpkg;
10326 UINT r;
10327 CHAR prop[MAX_PATH];
10328 CHAR expected[MAX_PATH];
10329 DWORD size = MAX_PATH;
10331 hdb = create_package_db();
10332 ok(hdb, "failed to create package database\n");
10334 r = create_appsearch_table(hdb);
10335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10337 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
10338 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10340 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
10341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10343 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
10344 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10346 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
10347 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10349 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
10350 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10352 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
10353 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10355 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
10356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10358 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
10359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10361 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
10362 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10364 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
10365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10367 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
10368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10370 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
10371 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10373 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
10374 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10376 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
10377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10379 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
10380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10382 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
10383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10385 r = create_complocator_table(hdb);
10386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10388 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10391 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10394 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10397 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10400 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10403 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10406 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10409 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10410 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10412 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10415 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10418 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10421 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10424 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10427 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10428 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10430 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10431 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10433 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10436 r = create_signature_table(hdb);
10437 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10439 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10442 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10445 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10448 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10451 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10452 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10454 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10457 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10460 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10463 r = package_from_db(hdb, &hpkg);
10464 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10466 skip("Not enough rights to perform tests\n");
10467 DeleteFile(msifile);
10468 return;
10470 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10472 MsiCloseHandle(hdb);
10474 create_test_file("abelisaurus");
10475 create_test_file("bactrosaurus");
10476 create_test_file("camelotia");
10477 create_test_file("diclonius");
10478 create_test_file("echinodon");
10479 create_test_file("falcarius");
10480 create_test_file("gallimimus");
10481 create_test_file("hagryphus");
10482 CreateDirectoryA("iguanodon", NULL);
10483 CreateDirectoryA("jobaria", NULL);
10484 CreateDirectoryA("kakuru", NULL);
10485 CreateDirectoryA("labocania", NULL);
10486 CreateDirectoryA("megaraptor", NULL);
10487 CreateDirectoryA("neosodon", NULL);
10488 CreateDirectoryA("olorotitan", NULL);
10489 CreateDirectoryA("pantydraco", NULL);
10491 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
10492 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
10493 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
10494 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
10495 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
10496 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
10497 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
10498 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
10499 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
10500 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
10501 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
10502 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
10503 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
10504 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
10505 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
10506 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10508 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10510 r = MsiDoAction(hpkg, "AppSearch");
10511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10513 size = MAX_PATH;
10514 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10517 lstrcpyA(expected, CURR_DIR);
10518 lstrcatA(expected, "\\abelisaurus");
10519 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10520 "Expected %s or empty string, got %s\n", expected, prop);
10522 size = MAX_PATH;
10523 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
10524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10525 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10527 size = MAX_PATH;
10528 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
10529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10530 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10532 size = MAX_PATH;
10533 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
10534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10535 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10537 size = MAX_PATH;
10538 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
10539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10541 lstrcpyA(expected, CURR_DIR);
10542 lstrcatA(expected, "\\");
10543 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10544 "Expected %s or empty string, got %s\n", expected, prop);
10546 size = MAX_PATH;
10547 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
10548 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10549 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10551 size = MAX_PATH;
10552 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
10553 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10554 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10556 size = MAX_PATH;
10557 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
10558 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10559 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10561 size = MAX_PATH;
10562 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
10563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10564 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10566 size = MAX_PATH;
10567 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
10568 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10569 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10571 size = MAX_PATH;
10572 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
10573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10574 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10576 size = MAX_PATH;
10577 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
10578 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10579 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10581 size = MAX_PATH;
10582 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
10583 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10585 lstrcpyA(expected, CURR_DIR);
10586 lstrcatA(expected, "\\");
10587 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10588 "Expected %s or empty string, got %s\n", expected, prop);
10590 size = MAX_PATH;
10591 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10592 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10594 lstrcpyA(expected, CURR_DIR);
10595 lstrcatA(expected, "\\neosodon\\");
10596 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10597 "Expected %s or empty string, got %s\n", expected, prop);
10599 size = MAX_PATH;
10600 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10602 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10604 size = MAX_PATH;
10605 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10607 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10609 MsiCloseHandle(hpkg);
10610 DeleteFileA("abelisaurus");
10611 DeleteFileA("bactrosaurus");
10612 DeleteFileA("camelotia");
10613 DeleteFileA("diclonius");
10614 DeleteFileA("echinodon");
10615 DeleteFileA("falcarius");
10616 DeleteFileA("gallimimus");
10617 DeleteFileA("hagryphus");
10618 RemoveDirectoryA("iguanodon");
10619 RemoveDirectoryA("jobaria");
10620 RemoveDirectoryA("kakuru");
10621 RemoveDirectoryA("labocania");
10622 RemoveDirectoryA("megaraptor");
10623 RemoveDirectoryA("neosodon");
10624 RemoveDirectoryA("olorotitan");
10625 RemoveDirectoryA("pantydraco");
10626 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10627 MSIINSTALLCONTEXT_MACHINE, NULL);
10628 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10629 MSIINSTALLCONTEXT_MACHINE, NULL);
10630 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10631 MSIINSTALLCONTEXT_MACHINE, NULL);
10632 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10633 MSIINSTALLCONTEXT_MACHINE, NULL);
10634 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10635 MSIINSTALLCONTEXT_MACHINE, NULL);
10636 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10637 MSIINSTALLCONTEXT_MACHINE, NULL);
10638 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10639 MSIINSTALLCONTEXT_MACHINE, NULL);
10640 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10641 MSIINSTALLCONTEXT_MACHINE, NULL);
10642 DeleteFileA(msifile);
10645 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10647 MSIHANDLE summary;
10648 UINT r;
10650 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10653 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10656 r = MsiSummaryInfoPersist(summary);
10657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10659 MsiCloseHandle(summary);
10662 static void test_MsiGetSourcePath(void)
10664 MSIHANDLE hdb, hpkg;
10665 CHAR path[MAX_PATH];
10666 CHAR cwd[MAX_PATH];
10667 CHAR subsrc[MAX_PATH];
10668 CHAR sub2[MAX_PATH];
10669 DWORD size;
10670 UINT r;
10672 lstrcpyA(cwd, CURR_DIR);
10673 lstrcatA(cwd, "\\");
10675 lstrcpyA(subsrc, cwd);
10676 lstrcatA(subsrc, "subsource");
10677 lstrcatA(subsrc, "\\");
10679 lstrcpyA(sub2, subsrc);
10680 lstrcatA(sub2, "sub2");
10681 lstrcatA(sub2, "\\");
10683 /* uncompressed source */
10685 hdb = create_package_db();
10686 ok( hdb, "failed to create database\n");
10688 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10690 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10691 ok(r == S_OK, "failed\n");
10693 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10694 ok(r == S_OK, "failed\n");
10696 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10697 ok(r == S_OK, "failed\n");
10699 r = MsiDatabaseCommit(hdb);
10700 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10702 r = package_from_db(hdb, &hpkg);
10703 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10705 skip("Not enough rights to perform tests\n");
10706 DeleteFile(msifile);
10707 return;
10709 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10711 MsiCloseHandle(hdb);
10713 /* invalid database handle */
10714 size = MAX_PATH;
10715 lstrcpyA(path, "kiwi");
10716 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10717 ok(r == ERROR_INVALID_HANDLE,
10718 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10719 ok(!lstrcmpA(path, "kiwi"),
10720 "Expected path to be unchanged, got \"%s\"\n", path);
10721 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10723 /* NULL szFolder */
10724 size = MAX_PATH;
10725 lstrcpyA(path, "kiwi");
10726 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10727 ok(r == ERROR_INVALID_PARAMETER,
10728 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10729 ok(!lstrcmpA(path, "kiwi"),
10730 "Expected path to be unchanged, got \"%s\"\n", path);
10731 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10733 /* empty szFolder */
10734 size = MAX_PATH;
10735 lstrcpyA(path, "kiwi");
10736 r = MsiGetSourcePath(hpkg, "", path, &size);
10737 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10738 ok(!lstrcmpA(path, "kiwi"),
10739 "Expected path to be unchanged, got \"%s\"\n", path);
10740 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10742 /* try TARGETDIR */
10743 size = MAX_PATH;
10744 lstrcpyA(path, "kiwi");
10745 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10746 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10747 ok(!lstrcmpA(path, "kiwi"),
10748 "Expected path to be unchanged, got \"%s\"\n", path);
10749 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10751 size = MAX_PATH;
10752 lstrcpyA(path, "kiwi");
10753 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10755 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10756 ok(size == 0, "Expected 0, got %d\n", size);
10758 size = MAX_PATH;
10759 lstrcpyA(path, "kiwi");
10760 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10762 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10763 ok(size == 0, "Expected 0, got %d\n", size);
10765 /* try SourceDir */
10766 size = MAX_PATH;
10767 lstrcpyA(path, "kiwi");
10768 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10769 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10770 ok(!lstrcmpA(path, "kiwi"),
10771 "Expected path to be unchanged, got \"%s\"\n", path);
10772 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10774 /* try SOURCEDIR */
10775 size = MAX_PATH;
10776 lstrcpyA(path, "kiwi");
10777 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10778 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10779 ok(!lstrcmpA(path, "kiwi"),
10780 "Expected path to be unchanged, got \"%s\"\n", path);
10781 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10783 /* source path does not exist, but the property exists */
10784 size = MAX_PATH;
10785 lstrcpyA(path, "kiwi");
10786 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10787 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10788 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10789 ok(size == 0, "Expected 0, got %d\n", size);
10791 size = MAX_PATH;
10792 lstrcpyA(path, "kiwi");
10793 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10795 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10796 ok(size == 0, "Expected 0, got %d\n", size);
10798 /* try SubDir */
10799 size = MAX_PATH;
10800 lstrcpyA(path, "kiwi");
10801 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10802 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10803 ok(!lstrcmpA(path, "kiwi"),
10804 "Expected path to be unchanged, got \"%s\"\n", path);
10805 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10807 /* try SubDir2 */
10808 size = MAX_PATH;
10809 lstrcpyA(path, "kiwi");
10810 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10811 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10812 ok(!lstrcmpA(path, "kiwi"),
10813 "Expected path to be unchanged, got \"%s\"\n", path);
10814 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10816 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10818 r = MsiDoAction(hpkg, "CostInitialize");
10819 ok(r == ERROR_SUCCESS, "cost init failed\n");
10821 /* try TARGETDIR after CostInitialize */
10822 size = MAX_PATH;
10823 lstrcpyA(path, "kiwi");
10824 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10826 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10827 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10829 /* try SourceDir after CostInitialize */
10830 size = MAX_PATH;
10831 lstrcpyA(path, "kiwi");
10832 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10833 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10834 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10835 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10837 /* try SOURCEDIR after CostInitialize */
10838 size = MAX_PATH;
10839 lstrcpyA(path, "kiwi");
10840 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10841 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10842 ok(!lstrcmpA(path, "kiwi"),
10843 "Expected path to be unchanged, got \"%s\"\n", path);
10844 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10846 /* source path does not exist, but the property exists */
10847 size = MAX_PATH;
10848 lstrcpyA(path, "kiwi");
10849 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10850 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10851 todo_wine
10853 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10854 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10857 /* try SubDir after CostInitialize */
10858 size = MAX_PATH;
10859 lstrcpyA(path, "kiwi");
10860 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10862 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10863 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10865 /* try SubDir2 after CostInitialize */
10866 size = MAX_PATH;
10867 lstrcpyA(path, "kiwi");
10868 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10870 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10871 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10873 r = MsiDoAction(hpkg, "ResolveSource");
10874 ok(r == ERROR_SUCCESS, "file cost failed\n");
10876 /* try TARGETDIR after ResolveSource */
10877 size = MAX_PATH;
10878 lstrcpyA(path, "kiwi");
10879 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10880 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10881 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10882 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10884 /* try SourceDir after ResolveSource */
10885 size = MAX_PATH;
10886 lstrcpyA(path, "kiwi");
10887 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10888 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10889 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10890 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10892 /* try SOURCEDIR after ResolveSource */
10893 size = MAX_PATH;
10894 lstrcpyA(path, "kiwi");
10895 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10896 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10897 ok(!lstrcmpA(path, "kiwi"),
10898 "Expected path to be unchanged, got \"%s\"\n", path);
10899 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10901 /* source path does not exist, but the property exists */
10902 size = MAX_PATH;
10903 lstrcpyA(path, "kiwi");
10904 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10905 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10906 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10907 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10909 /* try SubDir after ResolveSource */
10910 size = MAX_PATH;
10911 lstrcpyA(path, "kiwi");
10912 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10914 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10915 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10917 /* try SubDir2 after ResolveSource */
10918 size = MAX_PATH;
10919 lstrcpyA(path, "kiwi");
10920 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10921 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10922 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10923 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10925 r = MsiDoAction(hpkg, "FileCost");
10926 ok(r == ERROR_SUCCESS, "file cost failed\n");
10928 /* try TARGETDIR after FileCost */
10929 size = MAX_PATH;
10930 lstrcpyA(path, "kiwi");
10931 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10932 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10933 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10934 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10936 /* try SourceDir after FileCost */
10937 size = MAX_PATH;
10938 lstrcpyA(path, "kiwi");
10939 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10940 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10941 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10942 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10944 /* try SOURCEDIR after FileCost */
10945 size = MAX_PATH;
10946 lstrcpyA(path, "kiwi");
10947 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10948 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10949 ok(!lstrcmpA(path, "kiwi"),
10950 "Expected path to be unchanged, got \"%s\"\n", path);
10951 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10953 /* source path does not exist, but the property exists */
10954 size = MAX_PATH;
10955 lstrcpyA(path, "kiwi");
10956 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10958 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10959 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10961 /* try SubDir after FileCost */
10962 size = MAX_PATH;
10963 lstrcpyA(path, "kiwi");
10964 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10966 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10967 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10969 /* try SubDir2 after FileCost */
10970 size = MAX_PATH;
10971 lstrcpyA(path, "kiwi");
10972 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10973 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10974 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10975 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10977 r = MsiDoAction(hpkg, "CostFinalize");
10978 ok(r == ERROR_SUCCESS, "file cost failed\n");
10980 /* try TARGETDIR after CostFinalize */
10981 size = MAX_PATH;
10982 lstrcpyA(path, "kiwi");
10983 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10985 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10986 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10988 /* try SourceDir after CostFinalize */
10989 size = MAX_PATH;
10990 lstrcpyA(path, "kiwi");
10991 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10993 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10994 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10996 /* try SOURCEDIR after CostFinalize */
10997 size = MAX_PATH;
10998 lstrcpyA(path, "kiwi");
10999 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11000 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11001 ok(!lstrcmpA(path, "kiwi"),
11002 "Expected path to be unchanged, got \"%s\"\n", path);
11003 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11005 /* source path does not exist, but the property exists */
11006 size = MAX_PATH;
11007 lstrcpyA(path, "kiwi");
11008 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11010 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11011 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11013 /* try SubDir after CostFinalize */
11014 size = MAX_PATH;
11015 lstrcpyA(path, "kiwi");
11016 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11018 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11019 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11021 /* try SubDir2 after CostFinalize */
11022 size = MAX_PATH;
11023 lstrcpyA(path, "kiwi");
11024 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11026 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11027 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11029 /* nonexistent directory */
11030 size = MAX_PATH;
11031 lstrcpyA(path, "kiwi");
11032 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
11033 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11034 ok(!lstrcmpA(path, "kiwi"),
11035 "Expected path to be unchanged, got \"%s\"\n", path);
11036 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11038 /* NULL szPathBuf */
11039 size = MAX_PATH;
11040 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
11041 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11042 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11044 /* NULL pcchPathBuf */
11045 lstrcpyA(path, "kiwi");
11046 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
11047 ok(r == ERROR_INVALID_PARAMETER,
11048 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11049 ok(!lstrcmpA(path, "kiwi"),
11050 "Expected path to be unchanged, got \"%s\"\n", path);
11052 /* pcchPathBuf is 0 */
11053 size = 0;
11054 lstrcpyA(path, "kiwi");
11055 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11056 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11057 ok(!lstrcmpA(path, "kiwi"),
11058 "Expected path to be unchanged, got \"%s\"\n", path);
11059 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11061 /* pcchPathBuf does not have room for NULL terminator */
11062 size = lstrlenA(cwd);
11063 lstrcpyA(path, "kiwi");
11064 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11065 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11066 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
11067 "Expected path with no backslash, got \"%s\"\n", path);
11068 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11070 /* pcchPathBuf has room for NULL terminator */
11071 size = lstrlenA(cwd) + 1;
11072 lstrcpyA(path, "kiwi");
11073 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11075 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11076 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11078 /* remove property */
11079 r = MsiSetProperty(hpkg, "SourceDir", NULL);
11080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11082 /* try SourceDir again */
11083 size = MAX_PATH;
11084 lstrcpyA(path, "kiwi");
11085 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11087 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11088 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11090 /* set property to a valid directory */
11091 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
11092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11094 /* try SOURCEDIR again */
11095 size = MAX_PATH;
11096 lstrcpyA(path, "kiwi");
11097 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11098 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11099 ok(!lstrcmpA(path, "kiwi"),
11100 "Expected path to be unchanged, got \"%s\"\n", path);
11101 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11103 MsiCloseHandle(hpkg);
11105 /* compressed source */
11107 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11110 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
11112 r = package_from_db(hdb, &hpkg);
11113 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11115 /* try TARGETDIR */
11116 size = MAX_PATH;
11117 lstrcpyA(path, "kiwi");
11118 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11119 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11120 ok(!lstrcmpA(path, "kiwi"),
11121 "Expected path to be unchanged, got \"%s\"\n", path);
11122 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11124 /* try SourceDir */
11125 size = MAX_PATH;
11126 lstrcpyA(path, "kiwi");
11127 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11128 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11129 ok(!lstrcmpA(path, "kiwi"),
11130 "Expected path to be unchanged, got \"%s\"\n", path);
11131 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11133 /* try SOURCEDIR */
11134 size = MAX_PATH;
11135 lstrcpyA(path, "kiwi");
11136 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11137 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11138 ok(!lstrcmpA(path, "kiwi"),
11139 "Expected path to be unchanged, got \"%s\"\n", path);
11140 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11142 /* source path nor the property exist */
11143 size = MAX_PATH;
11144 lstrcpyA(path, "kiwi");
11145 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11146 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11147 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11148 ok(size == 0, "Expected 0, got %d\n", size);
11150 /* try SubDir */
11151 size = MAX_PATH;
11152 lstrcpyA(path, "kiwi");
11153 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11154 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11155 ok(!lstrcmpA(path, "kiwi"),
11156 "Expected path to be unchanged, got \"%s\"\n", path);
11157 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11159 /* try SubDir2 */
11160 size = MAX_PATH;
11161 lstrcpyA(path, "kiwi");
11162 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11163 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11164 ok(!lstrcmpA(path, "kiwi"),
11165 "Expected path to be unchanged, got \"%s\"\n", path);
11166 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11168 r = MsiDoAction(hpkg, "CostInitialize");
11169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11171 /* try TARGETDIR after CostInitialize */
11172 size = MAX_PATH;
11173 lstrcpyA(path, "kiwi");
11174 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11175 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11176 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11177 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11179 /* try SourceDir after CostInitialize */
11180 size = MAX_PATH;
11181 lstrcpyA(path, "kiwi");
11182 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11183 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11184 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11185 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11187 /* try SOURCEDIR after CostInitialize */
11188 size = MAX_PATH;
11189 lstrcpyA(path, "kiwi");
11190 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11191 todo_wine
11193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11194 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11195 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11198 /* source path does not exist, but the property exists */
11199 size = MAX_PATH;
11200 lstrcpyA(path, "kiwi");
11201 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11202 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11203 todo_wine
11205 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11206 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11209 /* try SubDir after CostInitialize */
11210 size = MAX_PATH;
11211 lstrcpyA(path, "kiwi");
11212 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11213 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11214 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11215 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11217 /* try SubDir2 after CostInitialize */
11218 size = MAX_PATH;
11219 lstrcpyA(path, "kiwi");
11220 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11221 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11222 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11223 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11225 r = MsiDoAction(hpkg, "ResolveSource");
11226 ok(r == ERROR_SUCCESS, "file cost failed\n");
11228 /* try TARGETDIR after ResolveSource */
11229 size = MAX_PATH;
11230 lstrcpyA(path, "kiwi");
11231 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11232 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11233 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11234 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11236 /* try SourceDir after ResolveSource */
11237 size = MAX_PATH;
11238 lstrcpyA(path, "kiwi");
11239 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11241 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11242 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11244 /* try SOURCEDIR after ResolveSource */
11245 size = MAX_PATH;
11246 lstrcpyA(path, "kiwi");
11247 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11248 todo_wine
11250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11251 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11252 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11255 /* source path and the property exist */
11256 size = MAX_PATH;
11257 lstrcpyA(path, "kiwi");
11258 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11259 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11260 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11261 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11263 /* try SubDir after ResolveSource */
11264 size = MAX_PATH;
11265 lstrcpyA(path, "kiwi");
11266 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11268 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11269 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11271 /* try SubDir2 after ResolveSource */
11272 size = MAX_PATH;
11273 lstrcpyA(path, "kiwi");
11274 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11275 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11276 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11277 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11279 r = MsiDoAction(hpkg, "FileCost");
11280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11282 /* try TARGETDIR after CostFinalize */
11283 size = MAX_PATH;
11284 lstrcpyA(path, "kiwi");
11285 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11287 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11288 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11290 /* try SourceDir after CostFinalize */
11291 size = MAX_PATH;
11292 lstrcpyA(path, "kiwi");
11293 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11295 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11296 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11298 /* try SOURCEDIR after CostFinalize */
11299 size = MAX_PATH;
11300 lstrcpyA(path, "kiwi");
11301 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11302 todo_wine
11304 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11305 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11306 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11309 /* source path and the property exist */
11310 size = MAX_PATH;
11311 lstrcpyA(path, "kiwi");
11312 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11313 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11314 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11315 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11317 /* try SubDir after CostFinalize */
11318 size = MAX_PATH;
11319 lstrcpyA(path, "kiwi");
11320 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11321 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11322 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11323 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11325 /* try SubDir2 after CostFinalize */
11326 size = MAX_PATH;
11327 lstrcpyA(path, "kiwi");
11328 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11330 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11331 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11333 r = MsiDoAction(hpkg, "CostFinalize");
11334 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11336 /* try TARGETDIR after CostFinalize */
11337 size = MAX_PATH;
11338 lstrcpyA(path, "kiwi");
11339 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11340 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11341 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11342 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11344 /* try SourceDir after CostFinalize */
11345 size = MAX_PATH;
11346 lstrcpyA(path, "kiwi");
11347 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11349 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11350 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11352 /* try SOURCEDIR after CostFinalize */
11353 size = MAX_PATH;
11354 lstrcpyA(path, "kiwi");
11355 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11356 todo_wine
11358 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11359 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11360 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11363 /* source path and the property exist */
11364 size = MAX_PATH;
11365 lstrcpyA(path, "kiwi");
11366 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11368 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11369 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11371 /* try SubDir after CostFinalize */
11372 size = MAX_PATH;
11373 lstrcpyA(path, "kiwi");
11374 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11376 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11377 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11379 /* try SubDir2 after CostFinalize */
11380 size = MAX_PATH;
11381 lstrcpyA(path, "kiwi");
11382 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11383 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11384 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11385 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11387 MsiCloseHandle(hpkg);
11388 DeleteFile(msifile);
11391 static void test_shortlongsource(void)
11393 MSIHANDLE hdb, hpkg;
11394 CHAR path[MAX_PATH];
11395 CHAR cwd[MAX_PATH];
11396 CHAR subsrc[MAX_PATH];
11397 DWORD size;
11398 UINT r;
11400 lstrcpyA(cwd, CURR_DIR);
11401 lstrcatA(cwd, "\\");
11403 lstrcpyA(subsrc, cwd);
11404 lstrcatA(subsrc, "long");
11405 lstrcatA(subsrc, "\\");
11407 /* long file names */
11409 hdb = create_package_db();
11410 ok( hdb, "failed to create database\n");
11412 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
11414 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11415 ok(r == S_OK, "failed\n");
11417 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
11418 ok(r == S_OK, "failed\n");
11420 /* CostInitialize:short */
11421 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
11422 ok(r == S_OK, "failed\n");
11424 /* CostInitialize:long */
11425 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
11426 ok(r == S_OK, "failed\n");
11428 /* FileCost:short */
11429 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
11430 ok(r == S_OK, "failed\n");
11432 /* FileCost:long */
11433 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11434 ok(r == S_OK, "failed\n");
11436 /* CostFinalize:short */
11437 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11438 ok(r == S_OK, "failed\n");
11440 /* CostFinalize:long */
11441 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11442 ok(r == S_OK, "failed\n");
11444 MsiDatabaseCommit(hdb);
11446 r = package_from_db(hdb, &hpkg);
11447 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11449 skip("Not enough rights to perform tests\n");
11450 DeleteFile(msifile);
11451 return;
11453 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11455 MsiCloseHandle(hdb);
11457 CreateDirectoryA("one", NULL);
11458 CreateDirectoryA("four", NULL);
11460 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11462 r = MsiDoAction(hpkg, "CostInitialize");
11463 ok(r == ERROR_SUCCESS, "file cost failed\n");
11465 CreateDirectory("five", NULL);
11466 CreateDirectory("eight", NULL);
11468 r = MsiDoAction(hpkg, "FileCost");
11469 ok(r == ERROR_SUCCESS, "file cost failed\n");
11471 CreateDirectory("nine", NULL);
11472 CreateDirectory("twelve", NULL);
11474 r = MsiDoAction(hpkg, "CostFinalize");
11475 ok(r == ERROR_SUCCESS, "file cost failed\n");
11477 /* neither short nor long source directories exist */
11478 size = MAX_PATH;
11479 lstrcpyA(path, "kiwi");
11480 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11482 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11483 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11485 CreateDirectoryA("short", NULL);
11487 /* short source directory exists */
11488 size = MAX_PATH;
11489 lstrcpyA(path, "kiwi");
11490 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11492 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11493 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11495 CreateDirectoryA("long", NULL);
11497 /* both short and long source directories exist */
11498 size = MAX_PATH;
11499 lstrcpyA(path, "kiwi");
11500 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11502 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11503 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11505 lstrcpyA(subsrc, cwd);
11506 lstrcatA(subsrc, "two");
11507 lstrcatA(subsrc, "\\");
11509 /* short dir exists before CostInitialize */
11510 size = MAX_PATH;
11511 lstrcpyA(path, "kiwi");
11512 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11514 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11515 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11517 lstrcpyA(subsrc, cwd);
11518 lstrcatA(subsrc, "four");
11519 lstrcatA(subsrc, "\\");
11521 /* long dir exists before CostInitialize */
11522 size = MAX_PATH;
11523 lstrcpyA(path, "kiwi");
11524 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11526 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11527 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11529 lstrcpyA(subsrc, cwd);
11530 lstrcatA(subsrc, "six");
11531 lstrcatA(subsrc, "\\");
11533 /* short dir exists before FileCost */
11534 size = MAX_PATH;
11535 lstrcpyA(path, "kiwi");
11536 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11538 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11539 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11541 lstrcpyA(subsrc, cwd);
11542 lstrcatA(subsrc, "eight");
11543 lstrcatA(subsrc, "\\");
11545 /* long dir exists before FileCost */
11546 size = MAX_PATH;
11547 lstrcpyA(path, "kiwi");
11548 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11550 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11551 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11553 lstrcpyA(subsrc, cwd);
11554 lstrcatA(subsrc, "ten");
11555 lstrcatA(subsrc, "\\");
11557 /* short dir exists before CostFinalize */
11558 size = MAX_PATH;
11559 lstrcpyA(path, "kiwi");
11560 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11562 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11563 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11565 lstrcpyA(subsrc, cwd);
11566 lstrcatA(subsrc, "twelve");
11567 lstrcatA(subsrc, "\\");
11569 /* long dir exists before CostFinalize */
11570 size = MAX_PATH;
11571 lstrcpyA(path, "kiwi");
11572 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11574 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11575 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11577 MsiCloseHandle(hpkg);
11578 RemoveDirectoryA("short");
11579 RemoveDirectoryA("long");
11580 RemoveDirectoryA("one");
11581 RemoveDirectoryA("four");
11582 RemoveDirectoryA("five");
11583 RemoveDirectoryA("eight");
11584 RemoveDirectoryA("nine");
11585 RemoveDirectoryA("twelve");
11587 /* short file names */
11589 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11592 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11594 r = package_from_db(hdb, &hpkg);
11595 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11597 MsiCloseHandle(hdb);
11599 CreateDirectoryA("one", NULL);
11600 CreateDirectoryA("four", NULL);
11602 r = MsiDoAction(hpkg, "CostInitialize");
11603 ok(r == ERROR_SUCCESS, "file cost failed\n");
11605 CreateDirectory("five", NULL);
11606 CreateDirectory("eight", NULL);
11608 r = MsiDoAction(hpkg, "FileCost");
11609 ok(r == ERROR_SUCCESS, "file cost failed\n");
11611 CreateDirectory("nine", NULL);
11612 CreateDirectory("twelve", NULL);
11614 r = MsiDoAction(hpkg, "CostFinalize");
11615 ok(r == ERROR_SUCCESS, "file cost failed\n");
11617 lstrcpyA(subsrc, cwd);
11618 lstrcatA(subsrc, "short");
11619 lstrcatA(subsrc, "\\");
11621 /* neither short nor long source directories exist */
11622 size = MAX_PATH;
11623 lstrcpyA(path, "kiwi");
11624 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11626 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11627 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11629 CreateDirectoryA("short", NULL);
11631 /* short source directory exists */
11632 size = MAX_PATH;
11633 lstrcpyA(path, "kiwi");
11634 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11636 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11637 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11639 CreateDirectoryA("long", NULL);
11641 /* both short and long source directories exist */
11642 size = MAX_PATH;
11643 lstrcpyA(path, "kiwi");
11644 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11646 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11647 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11649 lstrcpyA(subsrc, cwd);
11650 lstrcatA(subsrc, "one");
11651 lstrcatA(subsrc, "\\");
11653 /* short dir exists before CostInitialize */
11654 size = MAX_PATH;
11655 lstrcpyA(path, "kiwi");
11656 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11658 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11659 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11661 lstrcpyA(subsrc, cwd);
11662 lstrcatA(subsrc, "three");
11663 lstrcatA(subsrc, "\\");
11665 /* long dir exists before CostInitialize */
11666 size = MAX_PATH;
11667 lstrcpyA(path, "kiwi");
11668 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11670 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11671 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11673 lstrcpyA(subsrc, cwd);
11674 lstrcatA(subsrc, "five");
11675 lstrcatA(subsrc, "\\");
11677 /* short dir exists before FileCost */
11678 size = MAX_PATH;
11679 lstrcpyA(path, "kiwi");
11680 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11681 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11682 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11683 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11685 lstrcpyA(subsrc, cwd);
11686 lstrcatA(subsrc, "seven");
11687 lstrcatA(subsrc, "\\");
11689 /* long dir exists before FileCost */
11690 size = MAX_PATH;
11691 lstrcpyA(path, "kiwi");
11692 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11694 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11695 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11697 lstrcpyA(subsrc, cwd);
11698 lstrcatA(subsrc, "nine");
11699 lstrcatA(subsrc, "\\");
11701 /* short dir exists before CostFinalize */
11702 size = MAX_PATH;
11703 lstrcpyA(path, "kiwi");
11704 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11705 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11706 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11707 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11709 lstrcpyA(subsrc, cwd);
11710 lstrcatA(subsrc, "eleven");
11711 lstrcatA(subsrc, "\\");
11713 /* long dir exists before CostFinalize */
11714 size = MAX_PATH;
11715 lstrcpyA(path, "kiwi");
11716 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11718 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11719 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11721 MsiCloseHandle(hpkg);
11722 RemoveDirectoryA("short");
11723 RemoveDirectoryA("long");
11724 RemoveDirectoryA("one");
11725 RemoveDirectoryA("four");
11726 RemoveDirectoryA("five");
11727 RemoveDirectoryA("eight");
11728 RemoveDirectoryA("nine");
11729 RemoveDirectoryA("twelve");
11730 DeleteFileA(msifile);
11733 static void test_sourcedir(void)
11735 MSIHANDLE hdb, hpkg;
11736 CHAR package[12];
11737 CHAR path[MAX_PATH];
11738 CHAR cwd[MAX_PATH];
11739 CHAR subsrc[MAX_PATH];
11740 DWORD size;
11741 UINT r;
11743 lstrcpyA(cwd, CURR_DIR);
11744 lstrcatA(cwd, "\\");
11746 lstrcpyA(subsrc, cwd);
11747 lstrcatA(subsrc, "long");
11748 lstrcatA(subsrc, "\\");
11750 hdb = create_package_db();
11751 ok( hdb, "failed to create database\n");
11753 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11754 ok(r == S_OK, "failed\n");
11756 sprintf(package, "#%u", hdb);
11757 r = MsiOpenPackage(package, &hpkg);
11758 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11760 skip("Not enough rights to perform tests\n");
11761 goto error;
11763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11765 /* properties only */
11767 /* SourceDir prop */
11768 size = MAX_PATH;
11769 lstrcpyA(path, "kiwi");
11770 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11772 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11773 ok(size == 0, "Expected 0, got %d\n", size);
11775 /* SOURCEDIR prop */
11776 size = MAX_PATH;
11777 lstrcpyA(path, "kiwi");
11778 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11780 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11781 ok(size == 0, "Expected 0, got %d\n", size);
11783 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11785 r = MsiDoAction(hpkg, "CostInitialize");
11786 ok(r == ERROR_SUCCESS, "file cost failed\n");
11788 /* SourceDir after CostInitialize */
11789 size = MAX_PATH;
11790 lstrcpyA(path, "kiwi");
11791 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11793 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11794 ok(size == 0, "Expected 0, got %d\n", size);
11796 /* SOURCEDIR after CostInitialize */
11797 size = MAX_PATH;
11798 lstrcpyA(path, "kiwi");
11799 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11800 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11801 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11802 ok(size == 0, "Expected 0, got %d\n", size);
11804 r = MsiDoAction(hpkg, "FileCost");
11805 ok(r == ERROR_SUCCESS, "file cost failed\n");
11807 /* SourceDir after FileCost */
11808 size = MAX_PATH;
11809 lstrcpyA(path, "kiwi");
11810 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11811 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11812 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11813 ok(size == 0, "Expected 0, got %d\n", size);
11815 /* SOURCEDIR after FileCost */
11816 size = MAX_PATH;
11817 lstrcpyA(path, "kiwi");
11818 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11820 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11821 ok(size == 0, "Expected 0, got %d\n", size);
11823 r = MsiDoAction(hpkg, "CostFinalize");
11824 ok(r == ERROR_SUCCESS, "file cost failed\n");
11826 /* SourceDir after CostFinalize */
11827 size = MAX_PATH;
11828 lstrcpyA(path, "kiwi");
11829 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11831 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11832 ok(size == 0, "Expected 0, got %d\n", size);
11834 /* SOURCEDIR after CostFinalize */
11835 size = MAX_PATH;
11836 lstrcpyA(path, "kiwi");
11837 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11839 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11840 ok(size == 0, "Expected 0, got %d\n", size);
11842 r = MsiDoAction(hpkg, "ResolveSource");
11843 ok(r == ERROR_SUCCESS, "file cost failed\n");
11845 /* SourceDir after ResolveSource */
11846 size = MAX_PATH;
11847 lstrcpyA(path, "kiwi");
11848 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11849 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11850 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11851 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11853 /* SOURCEDIR after ResolveSource */
11854 size = MAX_PATH;
11855 lstrcpyA(path, "kiwi");
11856 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11857 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11858 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11859 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11861 /* random casing */
11862 size = MAX_PATH;
11863 lstrcpyA(path, "kiwi");
11864 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11866 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11867 ok(size == 0, "Expected 0, got %d\n", size);
11869 MsiCloseHandle(hpkg);
11871 /* reset the package state */
11872 sprintf(package, "#%i", hdb);
11873 r = MsiOpenPackage(package, &hpkg);
11874 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11876 /* test how MsiGetSourcePath affects the properties */
11878 /* SourceDir prop */
11879 size = MAX_PATH;
11880 lstrcpyA(path, "kiwi");
11881 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11882 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11883 todo_wine
11885 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11886 ok(size == 0, "Expected 0, got %d\n", size);
11889 size = MAX_PATH;
11890 lstrcpyA(path, "kiwi");
11891 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11892 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11893 ok(!lstrcmpA(path, "kiwi"),
11894 "Expected path to be unchanged, got \"%s\"\n", path);
11895 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11897 /* SourceDir after MsiGetSourcePath */
11898 size = MAX_PATH;
11899 lstrcpyA(path, "kiwi");
11900 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11902 todo_wine
11904 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11905 ok(size == 0, "Expected 0, got %d\n", size);
11908 /* SOURCEDIR prop */
11909 size = MAX_PATH;
11910 lstrcpyA(path, "kiwi");
11911 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11913 todo_wine
11915 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11916 ok(size == 0, "Expected 0, got %d\n", size);
11919 size = MAX_PATH;
11920 lstrcpyA(path, "kiwi");
11921 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11922 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11923 ok(!lstrcmpA(path, "kiwi"),
11924 "Expected path to be unchanged, got \"%s\"\n", path);
11925 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11927 /* SOURCEDIR prop after MsiGetSourcePath */
11928 size = MAX_PATH;
11929 lstrcpyA(path, "kiwi");
11930 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11931 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11932 todo_wine
11934 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11935 ok(size == 0, "Expected 0, got %d\n", size);
11938 r = MsiDoAction(hpkg, "CostInitialize");
11939 ok(r == ERROR_SUCCESS, "file cost failed\n");
11941 /* SourceDir after CostInitialize */
11942 size = MAX_PATH;
11943 lstrcpyA(path, "kiwi");
11944 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11945 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11946 todo_wine
11948 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11949 ok(size == 0, "Expected 0, got %d\n", size);
11952 size = MAX_PATH;
11953 lstrcpyA(path, "kiwi");
11954 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11956 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11957 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11959 /* SourceDir after MsiGetSourcePath */
11960 size = MAX_PATH;
11961 lstrcpyA(path, "kiwi");
11962 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11963 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11964 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11965 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11967 /* SOURCEDIR after CostInitialize */
11968 size = MAX_PATH;
11969 lstrcpyA(path, "kiwi");
11970 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11972 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11973 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11975 /* SOURCEDIR source path still does not exist */
11976 size = MAX_PATH;
11977 lstrcpyA(path, "kiwi");
11978 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11979 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11980 ok(!lstrcmpA(path, "kiwi"),
11981 "Expected path to be unchanged, got \"%s\"\n", path);
11982 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11984 r = MsiDoAction(hpkg, "FileCost");
11985 ok(r == ERROR_SUCCESS, "file cost failed\n");
11987 /* SourceDir after FileCost */
11988 size = MAX_PATH;
11989 lstrcpyA(path, "kiwi");
11990 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11992 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11993 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11995 /* SOURCEDIR after FileCost */
11996 size = MAX_PATH;
11997 lstrcpyA(path, "kiwi");
11998 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12000 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12001 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12003 /* SOURCEDIR source path still does not exist */
12004 size = MAX_PATH;
12005 lstrcpyA(path, "kiwi");
12006 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12007 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12008 ok(!lstrcmpA(path, "kiwi"),
12009 "Expected path to be unchanged, got \"%s\"\n", path);
12010 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12012 r = MsiDoAction(hpkg, "CostFinalize");
12013 ok(r == ERROR_SUCCESS, "file cost failed\n");
12015 /* SourceDir after CostFinalize */
12016 size = MAX_PATH;
12017 lstrcpyA(path, "kiwi");
12018 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12019 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12020 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12021 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12023 /* SOURCEDIR after CostFinalize */
12024 size = MAX_PATH;
12025 lstrcpyA(path, "kiwi");
12026 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12028 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12029 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12031 /* SOURCEDIR source path still does not exist */
12032 size = MAX_PATH;
12033 lstrcpyA(path, "kiwi");
12034 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12035 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12036 ok(!lstrcmpA(path, "kiwi"),
12037 "Expected path to be unchanged, got \"%s\"\n", path);
12038 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12040 r = MsiDoAction(hpkg, "ResolveSource");
12041 ok(r == ERROR_SUCCESS, "file cost failed\n");
12043 /* SourceDir after ResolveSource */
12044 size = MAX_PATH;
12045 lstrcpyA(path, "kiwi");
12046 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12048 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12049 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12051 /* SOURCEDIR after ResolveSource */
12052 size = MAX_PATH;
12053 lstrcpyA(path, "kiwi");
12054 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12056 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12057 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12059 /* SOURCEDIR source path still does not exist */
12060 size = MAX_PATH;
12061 lstrcpyA(path, "kiwi");
12062 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12063 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12064 ok(!lstrcmpA(path, "kiwi"),
12065 "Expected path to be unchanged, got \"%s\"\n", path);
12066 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12068 MsiCloseHandle(hpkg);
12070 error:
12071 MsiCloseHandle(hdb);
12072 DeleteFileA(msifile);
12075 struct access_res
12077 BOOL gothandle;
12078 DWORD lasterr;
12079 BOOL ignore;
12082 static const struct access_res create[16] =
12084 { TRUE, ERROR_SUCCESS, TRUE },
12085 { TRUE, ERROR_SUCCESS, TRUE },
12086 { TRUE, ERROR_SUCCESS, FALSE },
12087 { TRUE, ERROR_SUCCESS, FALSE },
12088 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12089 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12090 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12091 { TRUE, ERROR_SUCCESS, FALSE },
12092 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12093 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12094 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12095 { TRUE, ERROR_SUCCESS, TRUE },
12096 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12097 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12098 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12099 { TRUE, ERROR_SUCCESS, TRUE }
12102 static const struct access_res create_commit[16] =
12104 { TRUE, ERROR_SUCCESS, TRUE },
12105 { TRUE, ERROR_SUCCESS, TRUE },
12106 { TRUE, ERROR_SUCCESS, FALSE },
12107 { TRUE, ERROR_SUCCESS, FALSE },
12108 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12109 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12110 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12111 { TRUE, ERROR_SUCCESS, FALSE },
12112 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12113 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12114 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12115 { TRUE, ERROR_SUCCESS, TRUE },
12116 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12117 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12118 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12119 { TRUE, ERROR_SUCCESS, TRUE }
12122 static const struct access_res create_close[16] =
12124 { TRUE, ERROR_SUCCESS, FALSE },
12125 { TRUE, ERROR_SUCCESS, FALSE },
12126 { TRUE, ERROR_SUCCESS, FALSE },
12127 { TRUE, ERROR_SUCCESS, FALSE },
12128 { TRUE, ERROR_SUCCESS, FALSE },
12129 { TRUE, ERROR_SUCCESS, FALSE },
12130 { TRUE, ERROR_SUCCESS, FALSE },
12131 { TRUE, ERROR_SUCCESS, FALSE },
12132 { TRUE, ERROR_SUCCESS, FALSE },
12133 { TRUE, ERROR_SUCCESS, FALSE },
12134 { TRUE, ERROR_SUCCESS, FALSE },
12135 { TRUE, ERROR_SUCCESS, FALSE },
12136 { TRUE, ERROR_SUCCESS, FALSE },
12137 { TRUE, ERROR_SUCCESS, FALSE },
12138 { TRUE, ERROR_SUCCESS, FALSE },
12139 { TRUE, ERROR_SUCCESS }
12142 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
12144 DWORD access = 0, share = 0;
12145 DWORD lasterr;
12146 HANDLE hfile;
12147 int i, j, idx = 0;
12149 for (i = 0; i < 4; i++)
12151 if (i == 0) access = 0;
12152 if (i == 1) access = GENERIC_READ;
12153 if (i == 2) access = GENERIC_WRITE;
12154 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
12156 for (j = 0; j < 4; j++)
12158 if (ares[idx].ignore)
12159 continue;
12161 if (j == 0) share = 0;
12162 if (j == 1) share = FILE_SHARE_READ;
12163 if (j == 2) share = FILE_SHARE_WRITE;
12164 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
12166 SetLastError(0xdeadbeef);
12167 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
12168 FILE_ATTRIBUTE_NORMAL, 0);
12169 lasterr = GetLastError();
12171 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
12172 "(%d, handle, %d): Expected %d, got %d\n",
12173 line, idx, ares[idx].gothandle,
12174 (hfile != INVALID_HANDLE_VALUE));
12176 ok(lasterr == ares[idx].lasterr ||
12177 lasterr == 0xdeadbeef, /* win9x */
12178 "(%d, lasterr, %d): Expected %d, got %d\n",
12179 line, idx, ares[idx].lasterr, lasterr);
12181 CloseHandle(hfile);
12182 idx++;
12187 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12189 static void test_access(void)
12191 MSIHANDLE hdb;
12192 UINT r;
12194 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
12195 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12197 test_file_access(msifile, create);
12199 r = MsiDatabaseCommit(hdb);
12200 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12202 test_file_access(msifile, create_commit);
12203 MsiCloseHandle(hdb);
12205 test_file_access(msifile, create_close);
12206 DeleteFileA(msifile);
12208 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
12209 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12211 test_file_access(msifile, create);
12213 r = MsiDatabaseCommit(hdb);
12214 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12216 test_file_access(msifile, create_commit);
12217 MsiCloseHandle(hdb);
12219 test_file_access(msifile, create_close);
12220 DeleteFileA(msifile);
12223 static void test_emptypackage(void)
12225 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
12226 MSIHANDLE hview = 0, hrec = 0;
12227 MSICONDITION condition;
12228 CHAR buffer[MAX_PATH];
12229 DWORD size;
12230 UINT r;
12232 r = MsiOpenPackageA("", &hpkg);
12233 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12235 skip("Not enough rights to perform tests\n");
12236 return;
12238 todo_wine
12240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12243 hdb = MsiGetActiveDatabase(hpkg);
12244 todo_wine
12246 ok(hdb != 0, "Expected a valid database handle\n");
12249 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
12250 todo_wine
12252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12254 r = MsiViewExecute(hview, 0);
12255 todo_wine
12257 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12260 r = MsiViewFetch(hview, &hrec);
12261 todo_wine
12263 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12266 buffer[0] = 0;
12267 size = MAX_PATH;
12268 r = MsiRecordGetString(hrec, 1, buffer, &size);
12269 todo_wine
12271 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12272 ok(!lstrcmpA(buffer, "_Property"),
12273 "Expected \"_Property\", got \"%s\"\n", buffer);
12276 MsiCloseHandle(hrec);
12278 r = MsiViewFetch(hview, &hrec);
12279 todo_wine
12281 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12284 size = MAX_PATH;
12285 r = MsiRecordGetString(hrec, 1, buffer, &size);
12286 todo_wine
12288 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12289 ok(!lstrcmpA(buffer, "#_FolderCache"),
12290 "Expected \"_Property\", got \"%s\"\n", buffer);
12293 MsiCloseHandle(hrec);
12294 MsiViewClose(hview);
12295 MsiCloseHandle(hview);
12297 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
12298 todo_wine
12300 ok(condition == MSICONDITION_FALSE,
12301 "Expected MSICONDITION_FALSE, got %d\n", condition);
12304 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
12305 todo_wine
12307 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12309 r = MsiViewExecute(hview, 0);
12310 todo_wine
12312 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12315 /* _Property table is not empty */
12316 r = MsiViewFetch(hview, &hrec);
12317 todo_wine
12319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12322 MsiCloseHandle(hrec);
12323 MsiViewClose(hview);
12324 MsiCloseHandle(hview);
12326 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
12327 todo_wine
12329 ok(condition == MSICONDITION_FALSE,
12330 "Expected MSICONDITION_FALSE, got %d\n", condition);
12333 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
12334 todo_wine
12336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12338 r = MsiViewExecute(hview, 0);
12339 todo_wine
12341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12344 /* #_FolderCache is not empty */
12345 r = MsiViewFetch(hview, &hrec);
12346 todo_wine
12348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12351 MsiCloseHandle(hrec);
12352 MsiViewClose(hview);
12353 MsiCloseHandle(hview);
12355 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
12356 todo_wine
12358 ok(r == ERROR_BAD_QUERY_SYNTAX,
12359 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12362 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
12363 todo_wine
12365 ok(r == ERROR_BAD_QUERY_SYNTAX,
12366 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12369 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
12370 todo_wine
12372 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
12373 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
12376 MsiCloseHandle(hsuminfo);
12378 r = MsiDatabaseCommit(hdb);
12379 todo_wine
12381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12384 MsiCloseHandle(hdb);
12385 MsiCloseHandle(hpkg);
12388 static void test_MsiGetProductProperty(void)
12390 MSIHANDLE hprod, hdb;
12391 CHAR val[MAX_PATH];
12392 CHAR path[MAX_PATH];
12393 CHAR query[MAX_PATH];
12394 CHAR keypath[MAX_PATH*2];
12395 CHAR prodcode[MAX_PATH];
12396 CHAR prod_squashed[MAX_PATH];
12397 HKEY prodkey, userkey, props;
12398 DWORD size;
12399 LONG res;
12400 UINT r;
12401 SC_HANDLE scm;
12402 REGSAM access = KEY_ALL_ACCESS;
12404 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
12405 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
12407 win_skip("Different registry keys on Win9x and WinMe\n");
12408 return;
12410 CloseServiceHandle(scm);
12412 GetCurrentDirectoryA(MAX_PATH, path);
12413 lstrcatA(path, "\\");
12415 create_test_guid(prodcode, prod_squashed);
12417 if (is_wow64)
12418 access |= KEY_WOW64_64KEY;
12420 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
12421 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12423 r = MsiDatabaseCommit(hdb);
12424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12426 r = set_summary_info(hdb);
12427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12429 r = run_query(hdb,
12430 "CREATE TABLE `Directory` ( "
12431 "`Directory` CHAR(255) NOT NULL, "
12432 "`Directory_Parent` CHAR(255), "
12433 "`DefaultDir` CHAR(255) NOT NULL "
12434 "PRIMARY KEY `Directory`)");
12435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12437 r = run_query(hdb,
12438 "CREATE TABLE `Property` ( "
12439 "`Property` CHAR(72) NOT NULL, "
12440 "`Value` CHAR(255) "
12441 "PRIMARY KEY `Property`)");
12442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12444 sprintf(query, "INSERT INTO `Property` "
12445 "(`Property`, `Value`) "
12446 "VALUES( 'ProductCode', '%s' )", prodcode);
12447 r = run_query(hdb, query);
12448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12450 r = MsiDatabaseCommit(hdb);
12451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12453 MsiCloseHandle(hdb);
12455 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
12456 lstrcatA(keypath, prod_squashed);
12458 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
12459 if (res == ERROR_ACCESS_DENIED)
12461 skip("Not enough rights to perform tests\n");
12462 DeleteFile(msifile);
12463 return;
12465 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12467 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12468 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
12469 lstrcatA(keypath, prod_squashed);
12471 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
12472 if (res == ERROR_ACCESS_DENIED)
12474 skip("Not enough rights to perform tests\n");
12475 RegDeleteKeyA(prodkey, "");
12476 RegCloseKey(prodkey);
12477 return;
12479 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12481 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
12482 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12484 lstrcpyA(val, path);
12485 lstrcatA(val, "\\");
12486 lstrcatA(val, msifile);
12487 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
12488 (const BYTE *)val, lstrlenA(val) + 1);
12489 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12491 hprod = 0xdeadbeef;
12492 r = MsiOpenProductA(prodcode, &hprod);
12493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12494 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
12496 /* hProduct is invalid */
12497 size = MAX_PATH;
12498 lstrcpyA(val, "apple");
12499 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
12500 ok(r == ERROR_INVALID_HANDLE,
12501 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12502 ok(!lstrcmpA(val, "apple"),
12503 "Expected val to be unchanged, got \"%s\"\n", val);
12504 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12506 /* szProperty is NULL */
12507 size = MAX_PATH;
12508 lstrcpyA(val, "apple");
12509 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12510 ok(r == ERROR_INVALID_PARAMETER,
12511 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12512 ok(!lstrcmpA(val, "apple"),
12513 "Expected val to be unchanged, got \"%s\"\n", val);
12514 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12516 /* szProperty is empty */
12517 size = MAX_PATH;
12518 lstrcpyA(val, "apple");
12519 r = MsiGetProductPropertyA(hprod, "", val, &size);
12520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12521 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12522 ok(size == 0, "Expected 0, got %d\n", size);
12524 /* get the property */
12525 size = MAX_PATH;
12526 lstrcpyA(val, "apple");
12527 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12529 ok(!lstrcmpA(val, prodcode),
12530 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12531 ok(size == lstrlenA(prodcode),
12532 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12534 /* lpValueBuf is NULL */
12535 size = MAX_PATH;
12536 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12538 ok(size == lstrlenA(prodcode),
12539 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12541 /* pcchValueBuf is NULL */
12542 lstrcpyA(val, "apple");
12543 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12544 ok(r == ERROR_INVALID_PARAMETER,
12545 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12546 ok(!lstrcmpA(val, "apple"),
12547 "Expected val to be unchanged, got \"%s\"\n", val);
12548 ok(size == lstrlenA(prodcode),
12549 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12551 /* pcchValueBuf is too small */
12552 size = 4;
12553 lstrcpyA(val, "apple");
12554 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12555 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12556 ok(!strncmp(val, prodcode, 3),
12557 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12558 ok(size == lstrlenA(prodcode),
12559 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12561 /* pcchValueBuf does not leave room for NULL terminator */
12562 size = lstrlenA(prodcode);
12563 lstrcpyA(val, "apple");
12564 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12565 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12566 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12567 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12568 ok(size == lstrlenA(prodcode),
12569 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12571 /* pcchValueBuf has enough room for NULL terminator */
12572 size = lstrlenA(prodcode) + 1;
12573 lstrcpyA(val, "apple");
12574 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12576 ok(!lstrcmpA(val, prodcode),
12577 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12578 ok(size == lstrlenA(prodcode),
12579 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12581 /* nonexistent property */
12582 size = MAX_PATH;
12583 lstrcpyA(val, "apple");
12584 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12585 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12586 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12587 ok(size == 0, "Expected 0, got %d\n", size);
12589 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12592 /* non-product property set */
12593 size = MAX_PATH;
12594 lstrcpyA(val, "apple");
12595 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12596 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12597 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12598 ok(size == 0, "Expected 0, got %d\n", size);
12600 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12603 /* non-product property that is also a product property set */
12604 size = MAX_PATH;
12605 lstrcpyA(val, "apple");
12606 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12607 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12608 ok(!lstrcmpA(val, prodcode),
12609 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12610 ok(size == lstrlenA(prodcode),
12611 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12613 MsiCloseHandle(hprod);
12615 RegDeleteValueA(props, "LocalPackage");
12616 delete_key(props, "", access);
12617 RegCloseKey(props);
12618 delete_key(userkey, "", access);
12619 RegCloseKey(userkey);
12620 delete_key(prodkey, "", access);
12621 RegCloseKey(prodkey);
12622 DeleteFileA(msifile);
12625 static void test_MsiSetProperty(void)
12627 MSIHANDLE hpkg, hdb, hrec;
12628 CHAR buf[MAX_PATH];
12629 LPCSTR query;
12630 DWORD size;
12631 UINT r;
12633 r = package_from_db(create_package_db(), &hpkg);
12634 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12636 skip("Not enough rights to perform tests\n");
12637 DeleteFile(msifile);
12638 return;
12640 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12642 /* invalid hInstall */
12643 r = MsiSetPropertyA(0, "Prop", "Val");
12644 ok(r == ERROR_INVALID_HANDLE,
12645 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12647 /* invalid hInstall */
12648 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12649 ok(r == ERROR_INVALID_HANDLE,
12650 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12652 /* szName is NULL */
12653 r = MsiSetPropertyA(hpkg, NULL, "Val");
12654 ok(r == ERROR_INVALID_PARAMETER,
12655 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12657 /* both szName and szValue are NULL */
12658 r = MsiSetPropertyA(hpkg, NULL, NULL);
12659 ok(r == ERROR_INVALID_PARAMETER,
12660 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12662 /* szName is empty */
12663 r = MsiSetPropertyA(hpkg, "", "Val");
12664 ok(r == ERROR_FUNCTION_FAILED,
12665 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12667 /* szName is empty and szValue is NULL */
12668 r = MsiSetPropertyA(hpkg, "", NULL);
12669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12671 /* set a property */
12672 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12673 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12675 /* get the property */
12676 size = MAX_PATH;
12677 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12679 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12680 ok(size == 3, "Expected 3, got %d\n", size);
12682 /* update the property */
12683 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12686 /* get the property */
12687 size = MAX_PATH;
12688 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12690 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12691 ok(size == 4, "Expected 4, got %d\n", size);
12693 hdb = MsiGetActiveDatabase(hpkg);
12694 ok(hdb != 0, "Expected a valid database handle\n");
12696 /* set prop is not in the _Property table */
12697 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12698 r = do_query(hdb, query, &hrec);
12699 ok(r == ERROR_BAD_QUERY_SYNTAX,
12700 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12702 /* set prop is not in the Property table */
12703 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12704 r = do_query(hdb, query, &hrec);
12705 ok(r == ERROR_BAD_QUERY_SYNTAX,
12706 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12708 MsiCloseHandle(hdb);
12710 /* szValue is an empty string */
12711 r = MsiSetPropertyA(hpkg, "Prop", "");
12712 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12714 /* try to get the property */
12715 size = MAX_PATH;
12716 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12718 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12719 ok(size == 0, "Expected 0, got %d\n", size);
12721 /* reset the property */
12722 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12725 /* delete the property */
12726 r = MsiSetPropertyA(hpkg, "Prop", NULL);
12727 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12729 /* try to get the property */
12730 size = MAX_PATH;
12731 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12733 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12734 ok(size == 0, "Expected 0, got %d\n", size);
12736 MsiCloseHandle(hpkg);
12737 DeleteFileA(msifile);
12740 static void test_MsiApplyMultiplePatches(void)
12742 UINT r, type = GetDriveType(NULL);
12744 if (!pMsiApplyMultiplePatchesA) {
12745 win_skip("MsiApplyMultiplePatchesA not found\n");
12746 return;
12749 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12750 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12752 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12753 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12755 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
12756 todo_wine
12758 if (type == DRIVE_FIXED)
12759 ok(r == ERROR_PATH_NOT_FOUND,
12760 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12761 else
12762 ok(r == ERROR_INVALID_NAME,
12763 "Expected ERROR_INVALID_NAME, got %u\n", r);
12766 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
12767 todo_wine
12769 if (type == DRIVE_FIXED)
12770 ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED,
12771 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12772 else
12773 ok(r == ERROR_INVALID_NAME,
12774 "Expected ERROR_INVALID_NAME, got %u\n", r);
12777 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12778 todo_wine
12780 if (type == DRIVE_FIXED)
12781 ok(r == ERROR_PATH_NOT_FOUND,
12782 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12783 else
12784 ok(r == ERROR_INVALID_NAME,
12785 "Expected ERROR_INVALID_NAME, got %u\n", r);
12788 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12789 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12791 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12792 todo_wine
12794 if (type == DRIVE_FIXED)
12795 ok(r == ERROR_PATH_NOT_FOUND,
12796 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12797 else
12798 ok(r == ERROR_INVALID_NAME,
12799 "Expected ERROR_INVALID_NAME, got %u\n", r);
12802 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12803 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12805 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12806 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12809 static void test_MsiApplyPatch(void)
12811 UINT r;
12813 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12814 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12816 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12817 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12820 START_TEST(package)
12822 STATEMGRSTATUS status;
12823 BOOL ret = FALSE;
12825 init_functionpointers();
12827 if (pIsWow64Process)
12828 pIsWow64Process(GetCurrentProcess(), &is_wow64);
12830 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
12832 /* Create a restore point ourselves so we circumvent the multitude of restore points
12833 * that would have been created by all the installation and removal tests.
12835 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
12836 * creation of restore points.
12838 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
12840 memset(&status, 0, sizeof(status));
12841 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
12844 test_createpackage();
12845 test_doaction();
12846 test_gettargetpath_bad();
12847 test_settargetpath();
12848 test_props();
12849 test_property_table();
12850 test_condition();
12851 test_msipackage();
12852 test_formatrecord2();
12853 test_states();
12854 test_getproperty();
12855 test_removefiles();
12856 test_appsearch();
12857 test_appsearch_complocator();
12858 test_appsearch_reglocator();
12859 test_appsearch_inilocator();
12860 test_appsearch_drlocator();
12861 test_featureparents();
12862 test_installprops();
12863 test_launchconditions();
12864 test_ccpsearch();
12865 test_complocator();
12866 test_MsiGetSourcePath();
12867 test_shortlongsource();
12868 test_sourcedir();
12869 test_access();
12870 test_emptypackage();
12871 test_MsiGetProductProperty();
12872 test_MsiSetProperty();
12873 test_MsiApplyMultiplePatches();
12874 test_MsiApplyPatch();
12876 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
12878 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
12879 if (ret)
12880 remove_restore_point(status.llSequenceNumber);