msi/tests: Reduce the UI level for a couple of tests.
[wine/wine-gecko.git] / dlls / msi / tests / package.c
blob6cb5533f19d3725f1de4c276679c5dca2956647b
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 HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
41 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
42 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
43 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
44 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
45 static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
46 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
47 static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
48 static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
50 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
51 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
53 static void init_functionpointers(void)
55 HMODULE hmsi = GetModuleHandleA("msi.dll");
56 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
57 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
58 HMODULE hshell32 = GetModuleHandleA("shell32.dll");
59 HMODULE hsrclient;
61 #define GET_PROC(mod, func) \
62 p ## func = (void*)GetProcAddress(mod, #func);
64 GET_PROC(hmsi, MsiApplyMultiplePatchesA);
65 GET_PROC(hshell32, SHGetFolderPathA);
67 GET_PROC(hadvapi32, ConvertSidToStringSidA);
68 GET_PROC(hadvapi32, GetTokenInformation);
69 GET_PROC(hadvapi32, OpenProcessToken);
70 GET_PROC(hadvapi32, RegDeleteKeyExA)
71 GET_PROC(hadvapi32, RegDeleteKeyExW)
72 GET_PROC(hkernel32, IsWow64Process)
73 GET_PROC(hkernel32, GetSystemInfo)
74 GET_PROC(hkernel32, GetSystemWow64DirectoryA)
76 hsrclient = LoadLibraryA("srclient.dll");
77 GET_PROC(hsrclient, SRRemoveRestorePoint);
78 GET_PROC(hsrclient, SRSetRestorePointA);
79 #undef GET_PROC
82 static BOOL is_process_limited(void)
84 HANDLE token;
86 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
88 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
90 BOOL ret;
91 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
92 DWORD size;
94 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
95 CloseHandle(token);
96 return (ret && type == TokenElevationTypeLimited);
98 return FALSE;
101 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
103 if (pRegDeleteKeyExA)
104 return pRegDeleteKeyExA( key, subkey, access, 0 );
105 return RegDeleteKeyA( key, subkey );
108 static LPSTR get_user_sid(LPSTR *usersid)
110 HANDLE token;
111 BYTE buf[1024];
112 DWORD size;
113 PTOKEN_USER user;
115 if (!pConvertSidToStringSidA)
117 win_skip("ConvertSidToStringSidA is not available\n");
118 return NULL;
121 *usersid = NULL;
122 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
123 size = sizeof(buf);
124 GetTokenInformation(token, TokenUser, buf, size, &size);
125 user = (PTOKEN_USER)buf;
126 pConvertSidToStringSidA(user->User.Sid, usersid);
127 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
128 CloseHandle(token);
129 return *usersid;
132 /* RegDeleteTreeW from dlls/advapi32/registry.c */
133 static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM access)
135 LONG ret;
136 DWORD dwMaxSubkeyLen, dwMaxValueLen;
137 DWORD dwMaxLen, dwSize;
138 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
139 HKEY hSubKey = hKey;
141 if(lpszSubKey)
143 ret = RegOpenKeyExW(hKey, lpszSubKey, 0, access, &hSubKey);
144 if (ret) return ret;
147 ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
148 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
149 if (ret) goto cleanup;
151 dwMaxSubkeyLen++;
152 dwMaxValueLen++;
153 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
154 if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
156 /* Name too big: alloc a buffer for it */
157 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
159 ret = ERROR_NOT_ENOUGH_MEMORY;
160 goto cleanup;
164 /* Recursively delete all the subkeys */
165 while (TRUE)
167 dwSize = dwMaxLen;
168 if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL,
169 NULL, NULL, NULL)) break;
171 ret = package_RegDeleteTreeW(hSubKey, lpszName, access);
172 if (ret) goto cleanup;
175 if (lpszSubKey)
177 if (pRegDeleteKeyExW)
178 ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
179 else
180 ret = RegDeleteKeyW(hKey, lpszSubKey);
182 else
183 while (TRUE)
185 dwSize = dwMaxLen;
186 if (RegEnumValueW(hKey, 0, lpszName, &dwSize,
187 NULL, NULL, NULL, NULL)) break;
189 ret = RegDeleteValueW(hKey, lpszName);
190 if (ret) goto cleanup;
193 cleanup:
194 if (lpszName != szNameBuf)
195 HeapFree(GetProcessHeap(), 0, lpszName);
196 if(lpszSubKey)
197 RegCloseKey(hSubKey);
198 return ret;
201 static BOOL squash_guid(LPCWSTR in, LPWSTR out)
203 DWORD i,n=1;
204 GUID guid;
206 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
207 return FALSE;
209 for(i=0; i<8; i++)
210 out[7-i] = in[n++];
211 n++;
212 for(i=0; i<4; i++)
213 out[11-i] = in[n++];
214 n++;
215 for(i=0; i<4; i++)
216 out[15-i] = in[n++];
217 n++;
218 for(i=0; i<2; i++)
220 out[17+i*2] = in[n++];
221 out[16+i*2] = in[n++];
223 n++;
224 for( ; i<8; i++)
226 out[17+i*2] = in[n++];
227 out[16+i*2] = in[n++];
229 out[32]=0;
230 return TRUE;
233 static void create_test_guid(LPSTR prodcode, LPSTR squashed)
235 WCHAR guidW[MAX_PATH];
236 WCHAR squashedW[MAX_PATH];
237 GUID guid;
238 HRESULT hr;
239 int size;
241 hr = CoCreateGuid(&guid);
242 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
244 size = StringFromGUID2(&guid, guidW, MAX_PATH);
245 ok(size == 39, "Expected 39, got %d\n", hr);
247 WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
248 squash_guid(guidW, squashedW);
249 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
252 static void set_component_path(LPCSTR filename, MSIINSTALLCONTEXT context,
253 LPCSTR guid, LPSTR usersid, BOOL dir)
255 WCHAR guidW[MAX_PATH];
256 WCHAR squashedW[MAX_PATH];
257 CHAR squashed[MAX_PATH];
258 CHAR comppath[MAX_PATH];
259 CHAR prodpath[MAX_PATH];
260 CHAR path[MAX_PATH];
261 LPCSTR prod = NULL;
262 HKEY hkey;
263 REGSAM access = KEY_ALL_ACCESS;
265 if (is_wow64)
266 access |= KEY_WOW64_64KEY;
268 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
269 squash_guid(guidW, squashedW);
270 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
272 if (context == MSIINSTALLCONTEXT_MACHINE)
274 prod = "3D0DAE300FACA1300AD792060BCDAA92";
275 sprintf(comppath,
276 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
277 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
278 lstrcpyA(prodpath,
279 "SOFTWARE\\Classes\\Installer\\"
280 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
282 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
284 prod = "7D2F387510109040002000060BECB6AB";
285 sprintf(comppath,
286 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
287 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
288 sprintf(prodpath,
289 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
290 "Installer\\%s\\Installer\\Products\\"
291 "7D2F387510109040002000060BECB6AB", usersid);
293 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
295 prod = "7D2F387510109040002000060BECB6AB";
296 sprintf(comppath,
297 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
298 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
299 sprintf(prodpath,
300 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
301 "Installer\\Managed\\%s\\Installer\\Products\\"
302 "7D2F387510109040002000060BECB6AB", usersid);
305 RegCreateKeyExA(HKEY_LOCAL_MACHINE, comppath, 0, NULL, 0, access, NULL, &hkey, NULL);
307 lstrcpyA(path, CURR_DIR);
308 lstrcatA(path, "\\");
309 if (!dir) lstrcatA(path, filename);
311 RegSetValueExA(hkey, prod, 0, REG_SZ, (LPBYTE)path, lstrlenA(path));
312 RegCloseKey(hkey);
314 RegCreateKeyExA(HKEY_LOCAL_MACHINE, prodpath, 0, NULL, 0, access, NULL, &hkey, NULL);
315 RegCloseKey(hkey);
318 static void delete_component_path(LPCSTR guid, MSIINSTALLCONTEXT context, LPSTR usersid)
320 WCHAR guidW[MAX_PATH];
321 WCHAR squashedW[MAX_PATH];
322 WCHAR substrW[MAX_PATH];
323 CHAR squashed[MAX_PATH];
324 CHAR comppath[MAX_PATH];
325 CHAR prodpath[MAX_PATH];
326 REGSAM access = KEY_ALL_ACCESS;
328 if (is_wow64)
329 access |= KEY_WOW64_64KEY;
331 MultiByteToWideChar(CP_ACP, 0, guid, -1, guidW, MAX_PATH);
332 squash_guid(guidW, squashedW);
333 WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL);
335 if (context == MSIINSTALLCONTEXT_MACHINE)
337 sprintf(comppath,
338 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
339 "Installer\\UserData\\S-1-5-18\\Components\\%s", squashed);
340 lstrcpyA(prodpath,
341 "SOFTWARE\\Classes\\Installer\\"
342 "Products\\3D0DAE300FACA1300AD792060BCDAA92");
344 else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
346 sprintf(comppath,
347 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
348 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
349 sprintf(prodpath,
350 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
351 "Installer\\%s\\Installer\\Products\\"
352 "7D2F387510109040002000060BECB6AB", usersid);
354 else if (context == MSIINSTALLCONTEXT_USERMANAGED)
356 sprintf(comppath,
357 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
358 "Installer\\UserData\\%s\\Components\\%s", usersid, squashed);
359 sprintf(prodpath,
360 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
361 "Installer\\Managed\\%s\\Installer\\Products\\"
362 "7D2F387510109040002000060BECB6AB", usersid);
365 MultiByteToWideChar(CP_ACP, 0, comppath, -1, substrW, MAX_PATH);
366 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
368 MultiByteToWideChar(CP_ACP, 0, prodpath, -1, substrW, MAX_PATH);
369 package_RegDeleteTreeW(HKEY_LOCAL_MACHINE, substrW, access);
372 static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec)
374 MSIHANDLE hview = 0;
375 UINT r, ret;
377 /* open a select query */
378 r = MsiDatabaseOpenView(hdb, query, &hview);
379 if (r != ERROR_SUCCESS)
380 return r;
381 r = MsiViewExecute(hview, 0);
382 if (r != ERROR_SUCCESS)
383 return r;
384 ret = MsiViewFetch(hview, phrec);
385 r = MsiViewClose(hview);
386 if (r != ERROR_SUCCESS)
387 return r;
388 r = MsiCloseHandle(hview);
389 if (r != ERROR_SUCCESS)
390 return r;
391 return ret;
394 static UINT run_query( MSIHANDLE hdb, const char *query )
396 MSIHANDLE hview = 0;
397 UINT r;
399 r = MsiDatabaseOpenView(hdb, query, &hview);
400 if( r != ERROR_SUCCESS )
401 return r;
403 r = MsiViewExecute(hview, 0);
404 if( r == ERROR_SUCCESS )
405 r = MsiViewClose(hview);
406 MsiCloseHandle(hview);
407 return r;
410 static UINT create_component_table( MSIHANDLE hdb )
412 return run_query( hdb,
413 "CREATE TABLE `Component` ( "
414 "`Component` CHAR(72) NOT NULL, "
415 "`ComponentId` CHAR(38), "
416 "`Directory_` CHAR(72) NOT NULL, "
417 "`Attributes` SHORT NOT NULL, "
418 "`Condition` CHAR(255), "
419 "`KeyPath` CHAR(72) "
420 "PRIMARY KEY `Component`)" );
423 static UINT create_feature_table( MSIHANDLE hdb )
425 return run_query( hdb,
426 "CREATE TABLE `Feature` ( "
427 "`Feature` CHAR(38) NOT NULL, "
428 "`Feature_Parent` CHAR(38), "
429 "`Title` CHAR(64), "
430 "`Description` CHAR(255), "
431 "`Display` SHORT NOT NULL, "
432 "`Level` SHORT NOT NULL, "
433 "`Directory_` CHAR(72), "
434 "`Attributes` SHORT NOT NULL "
435 "PRIMARY KEY `Feature`)" );
438 static UINT create_feature_components_table( MSIHANDLE hdb )
440 return run_query( hdb,
441 "CREATE TABLE `FeatureComponents` ( "
442 "`Feature_` CHAR(38) NOT NULL, "
443 "`Component_` CHAR(72) NOT NULL "
444 "PRIMARY KEY `Feature_`, `Component_` )" );
447 static UINT create_file_table( MSIHANDLE hdb )
449 return run_query( hdb,
450 "CREATE TABLE `File` ("
451 "`File` CHAR(72) NOT NULL, "
452 "`Component_` CHAR(72) NOT NULL, "
453 "`FileName` CHAR(255) NOT NULL, "
454 "`FileSize` LONG NOT NULL, "
455 "`Version` CHAR(72), "
456 "`Language` CHAR(20), "
457 "`Attributes` SHORT, "
458 "`Sequence` SHORT NOT NULL "
459 "PRIMARY KEY `File`)" );
462 static UINT create_remove_file_table( MSIHANDLE hdb )
464 return run_query( hdb,
465 "CREATE TABLE `RemoveFile` ("
466 "`FileKey` CHAR(72) NOT NULL, "
467 "`Component_` CHAR(72) NOT NULL, "
468 "`FileName` CHAR(255) LOCALIZABLE, "
469 "`DirProperty` CHAR(72) NOT NULL, "
470 "`InstallMode` SHORT NOT NULL "
471 "PRIMARY KEY `FileKey`)" );
474 static UINT create_appsearch_table( MSIHANDLE hdb )
476 return run_query( hdb,
477 "CREATE TABLE `AppSearch` ("
478 "`Property` CHAR(72) NOT NULL, "
479 "`Signature_` CHAR(72) NOT NULL "
480 "PRIMARY KEY `Property`, `Signature_`)" );
483 static UINT create_reglocator_table( MSIHANDLE hdb )
485 return run_query( hdb,
486 "CREATE TABLE `RegLocator` ("
487 "`Signature_` CHAR(72) NOT NULL, "
488 "`Root` SHORT NOT NULL, "
489 "`Key` CHAR(255) NOT NULL, "
490 "`Name` CHAR(255), "
491 "`Type` SHORT "
492 "PRIMARY KEY `Signature_`)" );
495 static UINT create_signature_table( MSIHANDLE hdb )
497 return run_query( hdb,
498 "CREATE TABLE `Signature` ("
499 "`Signature` CHAR(72) NOT NULL, "
500 "`FileName` CHAR(255) NOT NULL, "
501 "`MinVersion` CHAR(20), "
502 "`MaxVersion` CHAR(20), "
503 "`MinSize` LONG, "
504 "`MaxSize` LONG, "
505 "`MinDate` LONG, "
506 "`MaxDate` LONG, "
507 "`Languages` CHAR(255) "
508 "PRIMARY KEY `Signature`)" );
511 static UINT create_launchcondition_table( MSIHANDLE hdb )
513 return run_query( hdb,
514 "CREATE TABLE `LaunchCondition` ("
515 "`Condition` CHAR(255) NOT NULL, "
516 "`Description` CHAR(255) NOT NULL "
517 "PRIMARY KEY `Condition`)" );
520 static UINT create_property_table( MSIHANDLE hdb )
522 return run_query( hdb,
523 "CREATE TABLE `Property` ("
524 "`Property` CHAR(72) NOT NULL, "
525 "`Value` CHAR(0) "
526 "PRIMARY KEY `Property`)" );
529 static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
531 return run_query( hdb,
532 "CREATE TABLE `InstallExecuteSequence` ("
533 "`Action` CHAR(72) NOT NULL, "
534 "`Condition` CHAR(255), "
535 "`Sequence` SHORT "
536 "PRIMARY KEY `Action`)" );
539 static UINT create_media_table( MSIHANDLE hdb )
541 return run_query( hdb,
542 "CREATE TABLE `Media` ("
543 "`DiskId` SHORT NOT NULL, "
544 "`LastSequence` SHORT NOT NULL, "
545 "`DiskPrompt` CHAR(64), "
546 "`Cabinet` CHAR(255), "
547 "`VolumeLabel` CHAR(32), "
548 "`Source` CHAR(72) "
549 "PRIMARY KEY `DiskId`)" );
552 static UINT create_ccpsearch_table( MSIHANDLE hdb )
554 return run_query( hdb,
555 "CREATE TABLE `CCPSearch` ("
556 "`Signature_` CHAR(72) NOT NULL "
557 "PRIMARY KEY `Signature_`)" );
560 static UINT create_drlocator_table( MSIHANDLE hdb )
562 return run_query( hdb,
563 "CREATE TABLE `DrLocator` ("
564 "`Signature_` CHAR(72) NOT NULL, "
565 "`Parent` CHAR(72), "
566 "`Path` CHAR(255), "
567 "`Depth` SHORT "
568 "PRIMARY KEY `Signature_`, `Parent`, `Path`)" );
571 static UINT create_complocator_table( MSIHANDLE hdb )
573 return run_query( hdb,
574 "CREATE TABLE `CompLocator` ("
575 "`Signature_` CHAR(72) NOT NULL, "
576 "`ComponentId` CHAR(38) NOT NULL, "
577 "`Type` SHORT "
578 "PRIMARY KEY `Signature_`)" );
581 static UINT create_inilocator_table( MSIHANDLE hdb )
583 return run_query( hdb,
584 "CREATE TABLE `IniLocator` ("
585 "`Signature_` CHAR(72) NOT NULL, "
586 "`FileName` CHAR(255) NOT NULL, "
587 "`Section` CHAR(96)NOT NULL, "
588 "`Key` CHAR(128)NOT NULL, "
589 "`Field` SHORT, "
590 "`Type` SHORT "
591 "PRIMARY KEY `Signature_`)" );
594 #define make_add_entry(type, qtext) \
595 static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
597 char insert[] = qtext; \
598 char *query; \
599 UINT sz, r; \
600 sz = strlen(values) + sizeof insert; \
601 query = HeapAlloc(GetProcessHeap(),0,sz); \
602 sprintf(query,insert,values); \
603 r = run_query( hdb, query ); \
604 HeapFree(GetProcessHeap(), 0, query); \
605 return r; \
608 make_add_entry(component,
609 "INSERT INTO `Component` "
610 "(`Component`, `ComponentId`, `Directory_`, "
611 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
613 make_add_entry(directory,
614 "INSERT INTO `Directory` "
615 "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )")
617 make_add_entry(feature,
618 "INSERT INTO `Feature` "
619 "(`Feature`, `Feature_Parent`, `Title`, `Description`, "
620 "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )")
622 make_add_entry(feature_components,
623 "INSERT INTO `FeatureComponents` "
624 "(`Feature_`, `Component_`) VALUES( %s )")
626 make_add_entry(file,
627 "INSERT INTO `File` "
628 "(`File`, `Component_`, `FileName`, `FileSize`, "
629 "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )")
631 make_add_entry(appsearch,
632 "INSERT INTO `AppSearch` "
633 "(`Property`, `Signature_`) VALUES( %s )")
635 make_add_entry(signature,
636 "INSERT INTO `Signature` "
637 "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`,"
638 " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) "
639 "VALUES( %s )")
641 make_add_entry(launchcondition,
642 "INSERT INTO `LaunchCondition` "
643 "(`Condition`, `Description`) VALUES( %s )")
645 make_add_entry(property,
646 "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )")
648 make_add_entry(install_execute_sequence,
649 "INSERT INTO `InstallExecuteSequence` "
650 "(`Action`, `Condition`, `Sequence`) VALUES( %s )")
652 make_add_entry(media,
653 "INSERT INTO `Media` "
654 "(`DiskId`, `LastSequence`, `DiskPrompt`, "
655 "`Cabinet`, `VolumeLabel`, `Source`) VALUES( %s )")
657 make_add_entry(ccpsearch,
658 "INSERT INTO `CCPSearch` (`Signature_`) VALUES( %s )")
660 make_add_entry(drlocator,
661 "INSERT INTO `DrLocator` "
662 "(`Signature_`, `Parent`, `Path`, `Depth`) VALUES( %s )")
664 make_add_entry(complocator,
665 "INSERT INTO `CompLocator` "
666 "(`Signature_`, `ComponentId`, `Type`) VALUES( %s )")
668 make_add_entry(inilocator,
669 "INSERT INTO `IniLocator` "
670 "(`Signature_`, `FileName`, `Section`, `Key`, `Field`, `Type`) "
671 "VALUES( %s )")
673 static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path,
674 const char *name, UINT type )
676 const char insert[] =
677 "INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) "
678 "VALUES( '%s', %u, '%s', '%s', %u )";
679 char *query;
680 UINT sz, r;
682 sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
683 query = HeapAlloc( GetProcessHeap(), 0, sz );
684 sprintf( query, insert, sig, root, path, name, type );
685 r = run_query( hdb, query );
686 HeapFree( GetProcessHeap(), 0, query );
687 return r;
690 static UINT set_summary_info(MSIHANDLE hdb)
692 UINT res;
693 MSIHANDLE suminfo;
695 /* build summary info */
696 res = MsiGetSummaryInformation(hdb, NULL, 7, &suminfo);
697 ok( res == ERROR_SUCCESS , "Failed to open summaryinfo\n" );
699 res = MsiSummaryInfoSetProperty(suminfo,2, VT_LPSTR, 0,NULL,
700 "Installation Database");
701 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
703 res = MsiSummaryInfoSetProperty(suminfo,3, VT_LPSTR, 0,NULL,
704 "Installation Database");
705 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
707 res = MsiSummaryInfoSetProperty(suminfo,4, VT_LPSTR, 0,NULL,
708 "Wine Hackers");
709 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
711 res = MsiSummaryInfoSetProperty(suminfo,7, VT_LPSTR, 0,NULL,
712 ";1033");
713 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
715 res = MsiSummaryInfoSetProperty(suminfo,9, VT_LPSTR, 0,NULL,
716 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
717 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
719 res = MsiSummaryInfoSetProperty(suminfo, 14, VT_I4, 100, NULL, NULL);
720 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
722 res = MsiSummaryInfoSetProperty(suminfo, 15, VT_I4, 0, NULL, NULL);
723 ok( res == ERROR_SUCCESS , "Failed to set summary info\n" );
725 res = MsiSummaryInfoPersist(suminfo);
726 ok( res == ERROR_SUCCESS , "Failed to make summary info persist\n" );
728 res = MsiCloseHandle( suminfo);
729 ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
731 return res;
735 static MSIHANDLE create_package_db(void)
737 MSIHANDLE hdb = 0;
738 UINT res;
740 DeleteFile(msifile);
742 /* create an empty database */
743 res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
744 ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res );
745 if( res != ERROR_SUCCESS )
746 return hdb;
748 res = MsiDatabaseCommit( hdb );
749 ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
751 res = set_summary_info(hdb);
753 res = run_query( hdb,
754 "CREATE TABLE `Directory` ( "
755 "`Directory` CHAR(255) NOT NULL, "
756 "`Directory_Parent` CHAR(255), "
757 "`DefaultDir` CHAR(255) NOT NULL "
758 "PRIMARY KEY `Directory`)" );
759 ok( res == ERROR_SUCCESS , "Failed to create directory table\n" );
761 return hdb;
764 static UINT package_from_db(MSIHANDLE hdb, MSIHANDLE *handle)
766 UINT res;
767 CHAR szPackage[12];
768 MSIHANDLE hPackage;
770 sprintf(szPackage, "#%u", hdb);
771 res = MsiOpenPackage(szPackage, &hPackage);
772 if (res != ERROR_SUCCESS)
774 MsiCloseHandle(hdb);
775 return res;
778 res = MsiCloseHandle(hdb);
779 if (res != ERROR_SUCCESS)
781 MsiCloseHandle(hPackage);
782 return res;
785 *handle = hPackage;
786 return ERROR_SUCCESS;
789 static void create_test_file(const CHAR *name)
791 HANDLE file;
792 DWORD written;
794 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
795 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
796 WriteFile(file, name, strlen(name), &written, NULL);
797 WriteFile(file, "\n", strlen("\n"), &written, NULL);
798 CloseHandle(file);
801 typedef struct _tagVS_VERSIONINFO
803 WORD wLength;
804 WORD wValueLength;
805 WORD wType;
806 WCHAR szKey[1];
807 WORD wPadding1[1];
808 VS_FIXEDFILEINFO Value;
809 WORD wPadding2[1];
810 WORD wChildren[1];
811 } VS_VERSIONINFO;
813 #define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1))
814 #define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r))
816 static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls)
818 VS_VERSIONINFO *pVerInfo;
819 VS_FIXEDFILEINFO *pFixedInfo;
820 LPBYTE buffer, ofs;
821 CHAR path[MAX_PATH];
822 DWORD handle, size;
823 HANDLE resource;
824 BOOL ret = FALSE;
826 GetSystemDirectory(path, MAX_PATH);
827 /* Some dlls can't be updated on Vista/W2K8 */
828 lstrcatA(path, "\\version.dll");
830 CopyFileA(path, name, FALSE);
832 size = GetFileVersionInfoSize(path, &handle);
833 buffer = HeapAlloc(GetProcessHeap(), 0, size);
835 GetFileVersionInfoA(path, 0, size, buffer);
837 pVerInfo = (VS_VERSIONINFO *)buffer;
838 ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1];
839 pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4);
841 pFixedInfo->dwFileVersionMS = ms;
842 pFixedInfo->dwFileVersionLS = ls;
843 pFixedInfo->dwProductVersionMS = ms;
844 pFixedInfo->dwProductVersionLS = ls;
846 resource = BeginUpdateResource(name, FALSE);
847 if (!resource)
848 goto done;
850 if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO),
851 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size))
852 goto done;
854 if (!EndUpdateResource(resource, FALSE))
855 goto done;
857 ret = TRUE;
859 done:
860 HeapFree(GetProcessHeap(), 0, buffer);
861 return ret;
864 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
866 RESTOREPOINTINFOA spec;
868 spec.dwEventType = event_type;
869 spec.dwRestorePtType = APPLICATION_INSTALL;
870 spec.llSequenceNumber = status->llSequenceNumber;
871 lstrcpyA(spec.szDescription, "msitest restore point");
873 return pSRSetRestorePointA(&spec, status);
876 static void remove_restore_point(DWORD seq_number)
878 DWORD res;
880 res = pSRRemoveRestorePoint(seq_number);
881 if (res != ERROR_SUCCESS)
882 trace("Failed to remove the restore point : %08x\n", res);
885 static void test_createpackage(void)
887 MSIHANDLE hPackage = 0;
888 UINT res;
890 res = package_from_db(create_package_db(), &hPackage);
891 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
893 skip("Not enough rights to perform tests\n");
894 DeleteFile(msifile);
895 return;
897 ok( res == ERROR_SUCCESS, " Failed to create package %u\n", res );
899 res = MsiCloseHandle( hPackage);
900 ok( res == ERROR_SUCCESS , "Failed to close package\n" );
901 DeleteFile(msifile);
904 static void test_doaction( void )
906 MSIHANDLE hpkg;
907 UINT r;
909 r = MsiDoAction( -1, NULL );
910 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
912 r = package_from_db(create_package_db(), &hpkg);
913 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
915 skip("Not enough rights to perform tests\n");
916 DeleteFile(msifile);
917 return;
919 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
921 r = MsiDoAction(hpkg, NULL);
922 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
924 r = MsiDoAction(0, "boo");
925 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
927 r = MsiDoAction(hpkg, "boo");
928 ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
930 MsiCloseHandle( hpkg );
931 DeleteFile(msifile);
934 static void test_gettargetpath_bad(void)
936 static const WCHAR boo[] = {'b','o','o',0};
937 static const WCHAR empty[] = {0};
938 char buffer[0x80];
939 WCHAR bufferW[0x80];
940 MSIHANDLE hpkg;
941 DWORD sz;
942 UINT r;
944 r = package_from_db(create_package_db(), &hpkg);
945 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
947 skip("Not enough rights to perform tests\n");
948 DeleteFile(msifile);
949 return;
951 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
953 r = MsiGetTargetPath( 0, NULL, NULL, NULL );
954 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
956 r = MsiGetTargetPath( 0, NULL, NULL, &sz );
957 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
959 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
960 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
962 r = MsiGetTargetPath( 0, "boo", NULL, NULL );
963 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
965 r = MsiGetTargetPath( hpkg, "boo", NULL, NULL );
966 ok( r == ERROR_DIRECTORY, "wrong return val\n");
968 r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
969 ok( r == ERROR_DIRECTORY, "wrong return val\n");
971 sz = 0;
972 r = MsiGetTargetPath( hpkg, "", buffer, &sz );
973 ok( r == ERROR_DIRECTORY, "wrong return val\n");
975 r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
976 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
978 r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
979 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
981 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
982 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
984 r = MsiGetTargetPathW( 0, boo, NULL, NULL );
985 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
987 r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
988 ok( r == ERROR_DIRECTORY, "wrong return val\n");
990 r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
991 ok( r == ERROR_DIRECTORY, "wrong return val\n");
993 sz = 0;
994 r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
995 ok( r == ERROR_DIRECTORY, "wrong return val\n");
997 MsiCloseHandle( hpkg );
998 DeleteFile(msifile);
1001 static void query_file_path(MSIHANDLE hpkg, LPCSTR file, LPSTR buff)
1003 UINT r;
1004 DWORD size;
1005 MSIHANDLE rec;
1007 rec = MsiCreateRecord( 1 );
1008 ok(rec, "MsiCreate record failed\n");
1010 r = MsiRecordSetString( rec, 0, file );
1011 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1013 size = MAX_PATH;
1014 r = MsiFormatRecord( hpkg, rec, buff, &size );
1015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
1017 MsiCloseHandle( rec );
1020 static void test_settargetpath(void)
1022 char tempdir[MAX_PATH+8], buffer[MAX_PATH], file[MAX_PATH];
1023 DWORD sz;
1024 MSIHANDLE hpkg;
1025 UINT r;
1026 MSIHANDLE hdb;
1028 hdb = create_package_db();
1029 ok ( hdb, "failed to create package database\n" );
1031 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'" );
1032 ok( r == S_OK, "failed to add directory entry: %d\n" , r );
1034 r = create_component_table( hdb );
1035 ok( r == S_OK, "cannot create Component table: %d\n", r );
1037 r = add_component_entry( hdb, "'RootComp', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'RootFile'" );
1038 ok( r == S_OK, "cannot add dummy component: %d\n", r );
1040 r = add_component_entry( hdb, "'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile'" );
1041 ok( r == S_OK, "cannot add test component: %d\n", r );
1043 r = create_feature_table( hdb );
1044 ok( r == S_OK, "cannot create Feature table: %d\n", r );
1046 r = add_feature_entry( hdb, "'TestFeature', '', '', '', 0, 1, '', 0" );
1047 ok( r == ERROR_SUCCESS, "cannot add TestFeature to Feature table: %d\n", r );
1049 r = create_feature_components_table( hdb );
1050 ok( r == S_OK, "cannot create FeatureComponents table: %d\n", r );
1052 r = add_feature_components_entry( hdb, "'TestFeature', 'RootComp'" );
1053 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1055 r = add_feature_components_entry( hdb, "'TestFeature', 'TestComp'" );
1056 ok( r == S_OK, "cannot insert component into FeatureComponents table: %d\n", r );
1058 add_directory_entry( hdb, "'TestParent', 'TARGETDIR', 'TestParent'" );
1059 add_directory_entry( hdb, "'TestDir', 'TestParent', 'TestDir'" );
1061 r = create_file_table( hdb );
1062 ok( r == S_OK, "cannot create File table: %d\n", r );
1064 r = add_file_entry( hdb, "'RootFile', 'RootComp', 'rootfile.txt', 0, '', '1033', 8192, 1" );
1065 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1067 r = add_file_entry( hdb, "'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1" );
1068 ok( r == S_OK, "cannot add file to the File table: %d\n", r );
1070 r = package_from_db( hdb, &hpkg );
1071 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1073 skip("Not enough rights to perform tests\n");
1074 DeleteFile(msifile);
1075 return;
1077 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1079 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
1081 r = MsiDoAction( hpkg, "CostInitialize");
1082 ok( r == ERROR_SUCCESS, "cost init failed\n");
1084 r = MsiDoAction( hpkg, "FileCost");
1085 ok( r == ERROR_SUCCESS, "file cost failed\n");
1087 r = MsiDoAction( hpkg, "CostFinalize");
1088 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
1090 r = MsiSetTargetPath( 0, NULL, NULL );
1091 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1093 r = MsiSetTargetPath( 0, "boo", "C:\\bogusx" );
1094 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1096 r = MsiSetTargetPath( hpkg, "boo", NULL );
1097 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1099 r = MsiSetTargetPath( hpkg, "boo", "c:\\bogusx" );
1100 ok( r == ERROR_DIRECTORY, "wrong return val\n");
1102 sz = sizeof tempdir - 1;
1103 r = MsiGetTargetPath( hpkg, "TARGETDIR", tempdir, &sz );
1104 sprintf( file, "%srootfile.txt", tempdir );
1105 buffer[0] = 0;
1106 query_file_path( hpkg, "[#RootFile]", buffer );
1107 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1108 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer );
1110 GetTempFileName( tempdir, "_wt", 0, buffer );
1111 sprintf( tempdir, "%s\\subdir", buffer );
1113 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1114 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1115 "MsiSetTargetPath on file returned %d\n", r );
1117 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1118 ok( r == ERROR_SUCCESS || r == ERROR_DIRECTORY,
1119 "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
1121 DeleteFile( buffer );
1123 r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
1124 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1126 r = GetFileAttributes( buffer );
1127 ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
1129 r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
1130 ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
1132 sz = sizeof buffer - 1;
1133 lstrcat( tempdir, "\\" );
1134 r = MsiGetTargetPath( hpkg, "TARGETDIR", buffer, &sz );
1135 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1136 ok( !lstrcmp(buffer, tempdir), "Expected %s, got %s\n", tempdir, buffer);
1138 sprintf( file, "%srootfile.txt", tempdir );
1139 query_file_path( hpkg, "[#RootFile]", buffer );
1140 ok( !lstrcmp(buffer, file), "Expected %s, got %s\n", file, buffer);
1142 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two" );
1143 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1145 query_file_path( hpkg, "[#TestFile]", buffer );
1146 ok( !lstrcmpi(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
1147 "Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
1149 sz = sizeof buffer - 1;
1150 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1151 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1152 ok( !lstrcmpi(buffer, "C:\\one\\two\\"), "Expected C:\\one\\two\\, got %s\n", buffer);
1154 r = MsiSetTargetPath( hpkg, "TestParent", "C:\\one\\two\\three" );
1155 ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
1157 sz = sizeof buffer - 1;
1158 r = MsiGetTargetPath( hpkg, "TestParent", buffer, &sz );
1159 ok( r == ERROR_SUCCESS, "failed to get target path: %d\n", r);
1160 ok( !lstrcmpi(buffer, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", buffer);
1162 MsiCloseHandle( hpkg );
1165 static void test_condition(void)
1167 MSICONDITION r;
1168 MSIHANDLE hpkg;
1170 r = package_from_db(create_package_db(), &hpkg);
1171 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1173 skip("Not enough rights to perform tests\n");
1174 DeleteFile(msifile);
1175 return;
1177 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1179 r = MsiEvaluateCondition(0, NULL);
1180 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1182 r = MsiEvaluateCondition(hpkg, NULL);
1183 ok( r == MSICONDITION_NONE, "wrong return val\n");
1185 r = MsiEvaluateCondition(hpkg, "");
1186 ok( r == MSICONDITION_NONE, "wrong return val\n");
1188 r = MsiEvaluateCondition(hpkg, "1");
1189 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1191 r = MsiEvaluateCondition(hpkg, "0");
1192 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1194 r = MsiEvaluateCondition(hpkg, "-1");
1195 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1197 r = MsiEvaluateCondition(hpkg, "0 = 0");
1198 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1200 r = MsiEvaluateCondition(hpkg, "0 <> 0");
1201 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1203 r = MsiEvaluateCondition(hpkg, "0 = 1");
1204 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1206 r = MsiEvaluateCondition(hpkg, "0 > 1");
1207 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1209 r = MsiEvaluateCondition(hpkg, "0 ~> 1");
1210 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1212 r = MsiEvaluateCondition(hpkg, "1 > 1");
1213 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1215 r = MsiEvaluateCondition(hpkg, "1 ~> 1");
1216 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1218 r = MsiEvaluateCondition(hpkg, "0 >= 1");
1219 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1221 r = MsiEvaluateCondition(hpkg, "0 ~>= 1");
1222 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1224 r = MsiEvaluateCondition(hpkg, "1 >= 1");
1225 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1227 r = MsiEvaluateCondition(hpkg, "1 ~>= 1");
1228 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1230 r = MsiEvaluateCondition(hpkg, "0 < 1");
1231 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1233 r = MsiEvaluateCondition(hpkg, "0 ~< 1");
1234 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1236 r = MsiEvaluateCondition(hpkg, "1 < 1");
1237 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1239 r = MsiEvaluateCondition(hpkg, "1 ~< 1");
1240 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1242 r = MsiEvaluateCondition(hpkg, "0 <= 1");
1243 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1245 r = MsiEvaluateCondition(hpkg, "0 ~<= 1");
1246 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1248 r = MsiEvaluateCondition(hpkg, "1 <= 1");
1249 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1251 r = MsiEvaluateCondition(hpkg, "1 ~<= 1");
1252 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1254 r = MsiEvaluateCondition(hpkg, "0 >=");
1255 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1257 r = MsiEvaluateCondition(hpkg, " ");
1258 ok( r == MSICONDITION_NONE, "wrong return val\n");
1260 r = MsiEvaluateCondition(hpkg, "LicView <> \"1\"");
1261 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1263 r = MsiEvaluateCondition(hpkg, "LicView <> \"0\"");
1264 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1266 r = MsiEvaluateCondition(hpkg, "LicView <> LicView");
1267 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1269 r = MsiEvaluateCondition(hpkg, "not 0");
1270 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1272 r = MsiEvaluateCondition(hpkg, "not LicView");
1273 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1275 r = MsiEvaluateCondition(hpkg, "\"Testing\" ~<< \"Testing\"");
1276 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1278 r = MsiEvaluateCondition(hpkg, "LicView ~<< \"Testing\"");
1279 ok (r == MSICONDITION_FALSE, "wrong return val\n");
1281 r = MsiEvaluateCondition(hpkg, "Not LicView ~<< \"Testing\"");
1282 ok (r == MSICONDITION_TRUE, "wrong return val\n");
1284 r = MsiEvaluateCondition(hpkg, "not \"A\"");
1285 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1287 r = MsiEvaluateCondition(hpkg, "~not \"A\"");
1288 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1290 r = MsiEvaluateCondition(hpkg, "\"0\"");
1291 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1293 r = MsiEvaluateCondition(hpkg, "1 and 2");
1294 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1296 r = MsiEvaluateCondition(hpkg, "not 0 and 3");
1297 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1299 r = MsiEvaluateCondition(hpkg, "not 0 and 0");
1300 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1302 r = MsiEvaluateCondition(hpkg, "not 0 or 1");
1303 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1305 r = MsiEvaluateCondition(hpkg, "(0)");
1306 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1308 r = MsiEvaluateCondition(hpkg, "(((((1))))))");
1309 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1311 r = MsiEvaluateCondition(hpkg, "(((((1)))))");
1312 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1314 r = MsiEvaluateCondition(hpkg, " \"A\" < \"B\" ");
1315 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1317 r = MsiEvaluateCondition(hpkg, " \"A\" > \"B\" ");
1318 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1320 r = MsiEvaluateCondition(hpkg, " \"1\" > \"12\" ");
1321 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1323 r = MsiEvaluateCondition(hpkg, " \"100\" < \"21\" ");
1324 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1326 r = MsiEvaluateCondition(hpkg, "0 < > 0");
1327 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1329 r = MsiEvaluateCondition(hpkg, "(1<<1) == 2");
1330 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1332 r = MsiEvaluateCondition(hpkg, " \"A\" = \"a\" ");
1333 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1335 r = MsiEvaluateCondition(hpkg, " \"A\" ~ = \"a\" ");
1336 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1338 r = MsiEvaluateCondition(hpkg, " \"A\" ~= \"a\" ");
1339 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1341 r = MsiEvaluateCondition(hpkg, " \"A\" ~= 1 ");
1342 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1344 r = MsiEvaluateCondition(hpkg, " \"A\" = 1 ");
1345 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1347 r = MsiEvaluateCondition(hpkg, " 1 ~= 1 ");
1348 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1350 r = MsiEvaluateCondition(hpkg, " 1 ~= \"1\" ");
1351 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1353 r = MsiEvaluateCondition(hpkg, " 1 = \"1\" ");
1354 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1356 r = MsiEvaluateCondition(hpkg, " 0 = \"1\" ");
1357 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1359 r = MsiEvaluateCondition(hpkg, " 0 < \"100\" ");
1360 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1362 r = MsiEvaluateCondition(hpkg, " 100 > \"0\" ");
1363 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1365 r = MsiEvaluateCondition(hpkg, "1 XOR 1");
1366 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1368 r = MsiEvaluateCondition(hpkg, "1 IMP 1");
1369 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1371 r = MsiEvaluateCondition(hpkg, "1 IMP 0");
1372 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1374 r = MsiEvaluateCondition(hpkg, "0 IMP 0");
1375 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1377 r = MsiEvaluateCondition(hpkg, "0 EQV 0");
1378 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1380 r = MsiEvaluateCondition(hpkg, "0 EQV 1");
1381 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1383 r = MsiEvaluateCondition(hpkg, "1 IMP 1 OR 0");
1384 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1386 r = MsiEvaluateCondition(hpkg, "1 IMPL 1");
1387 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1389 r = MsiEvaluateCondition(hpkg, "\"ASFD\" >< \"S\" ");
1390 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1392 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"s\" ");
1393 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1395 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"\" ");
1396 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1398 r = MsiEvaluateCondition(hpkg, "\"ASFD\" ~>< \"sss\" ");
1399 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1401 MsiSetProperty(hpkg, "mm", "5" );
1403 r = MsiEvaluateCondition(hpkg, "mm = 5");
1404 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1406 r = MsiEvaluateCondition(hpkg, "mm < 6");
1407 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1409 r = MsiEvaluateCondition(hpkg, "mm <= 5");
1410 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1412 r = MsiEvaluateCondition(hpkg, "mm > 4");
1413 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1415 r = MsiEvaluateCondition(hpkg, "mm < 12");
1416 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1418 r = MsiEvaluateCondition(hpkg, "mm = \"5\"");
1419 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1421 r = MsiEvaluateCondition(hpkg, "0 = \"\"");
1422 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1424 r = MsiEvaluateCondition(hpkg, "0 AND \"\"");
1425 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1427 r = MsiEvaluateCondition(hpkg, "1 AND \"\"");
1428 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1430 r = MsiEvaluateCondition(hpkg, "1 AND \"1\"");
1431 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1433 r = MsiEvaluateCondition(hpkg, "3 >< 1");
1434 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1436 r = MsiEvaluateCondition(hpkg, "3 >< 4");
1437 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1439 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 0");
1440 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1442 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1");
1443 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1445 r = MsiEvaluateCondition(hpkg, "NOT 1 OR 0");
1446 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1448 r = MsiEvaluateCondition(hpkg, "0 AND 1 OR 1");
1449 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1451 r = MsiEvaluateCondition(hpkg, "0 AND 0 OR 1");
1452 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1454 r = MsiEvaluateCondition(hpkg, "NOT 0 AND 1 OR 0");
1455 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1457 r = MsiEvaluateCondition(hpkg, "_1 = _1");
1458 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1460 r = MsiEvaluateCondition(hpkg, "( 1 AND 1 ) = 2");
1461 ok( r == MSICONDITION_ERROR, "wrong return val\n");
1463 r = MsiEvaluateCondition(hpkg, "NOT ( 1 AND 1 )");
1464 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1466 r = MsiEvaluateCondition(hpkg, "NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd");
1467 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1469 r = MsiEvaluateCondition(hpkg, "Installed<>\"\"");
1470 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1472 r = MsiEvaluateCondition(hpkg, "NOT 1 AND 0");
1473 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1475 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1476 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1478 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1479 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1481 r = MsiEvaluateCondition(hpkg, "bandalmael<0");
1482 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1484 r = MsiEvaluateCondition(hpkg, "bandalmael>0");
1485 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1487 r = MsiEvaluateCondition(hpkg, "bandalmael>=0");
1488 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1490 r = MsiEvaluateCondition(hpkg, "bandalmael<=0");
1491 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1493 r = MsiEvaluateCondition(hpkg, "bandalmael~<>0");
1494 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1496 MsiSetProperty(hpkg, "bandalmael", "0" );
1497 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1498 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1500 MsiSetProperty(hpkg, "bandalmael", "" );
1501 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1502 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1504 MsiSetProperty(hpkg, "bandalmael", "asdf" );
1505 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1506 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1508 MsiSetProperty(hpkg, "bandalmael", "0asdf" );
1509 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1510 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1512 MsiSetProperty(hpkg, "bandalmael", "0 " );
1513 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1514 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1516 MsiSetProperty(hpkg, "bandalmael", "-0" );
1517 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1518 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1520 MsiSetProperty(hpkg, "bandalmael", "0000000000000" );
1521 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1522 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1524 MsiSetProperty(hpkg, "bandalmael", "--0" );
1525 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1526 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1528 MsiSetProperty(hpkg, "bandalmael", "0x00" );
1529 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1530 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1532 MsiSetProperty(hpkg, "bandalmael", "-" );
1533 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1534 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1536 MsiSetProperty(hpkg, "bandalmael", "+0" );
1537 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1538 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1540 MsiSetProperty(hpkg, "bandalmael", "0.0" );
1541 r = MsiEvaluateCondition(hpkg, "bandalmael=0");
1542 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1543 r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
1544 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1546 MsiSetProperty(hpkg, "one", "hi");
1547 MsiSetProperty(hpkg, "two", "hithere");
1548 r = MsiEvaluateCondition(hpkg, "one >< two");
1549 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1551 MsiSetProperty(hpkg, "one", "hithere");
1552 MsiSetProperty(hpkg, "two", "hi");
1553 r = MsiEvaluateCondition(hpkg, "one >< two");
1554 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1556 MsiSetProperty(hpkg, "one", "hello");
1557 MsiSetProperty(hpkg, "two", "hi");
1558 r = MsiEvaluateCondition(hpkg, "one >< two");
1559 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1561 MsiSetProperty(hpkg, "one", "hellohithere");
1562 MsiSetProperty(hpkg, "two", "hi");
1563 r = MsiEvaluateCondition(hpkg, "one >< two");
1564 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1566 MsiSetProperty(hpkg, "one", "");
1567 MsiSetProperty(hpkg, "two", "hi");
1568 r = MsiEvaluateCondition(hpkg, "one >< two");
1569 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1571 MsiSetProperty(hpkg, "one", "hi");
1572 MsiSetProperty(hpkg, "two", "");
1573 r = MsiEvaluateCondition(hpkg, "one >< two");
1574 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1576 MsiSetProperty(hpkg, "one", "");
1577 MsiSetProperty(hpkg, "two", "");
1578 r = MsiEvaluateCondition(hpkg, "one >< two");
1579 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1581 MsiSetProperty(hpkg, "one", "1234");
1582 MsiSetProperty(hpkg, "two", "1");
1583 r = MsiEvaluateCondition(hpkg, "one >< two");
1584 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1586 MsiSetProperty(hpkg, "one", "one 1234");
1587 MsiSetProperty(hpkg, "two", "1");
1588 r = MsiEvaluateCondition(hpkg, "one >< two");
1589 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1591 MsiSetProperty(hpkg, "one", "hithere");
1592 MsiSetProperty(hpkg, "two", "hi");
1593 r = MsiEvaluateCondition(hpkg, "one << two");
1594 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1596 MsiSetProperty(hpkg, "one", "hi");
1597 MsiSetProperty(hpkg, "two", "hithere");
1598 r = MsiEvaluateCondition(hpkg, "one << two");
1599 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1601 MsiSetProperty(hpkg, "one", "hi");
1602 MsiSetProperty(hpkg, "two", "hi");
1603 r = MsiEvaluateCondition(hpkg, "one << two");
1604 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1606 MsiSetProperty(hpkg, "one", "abcdhithere");
1607 MsiSetProperty(hpkg, "two", "hi");
1608 r = MsiEvaluateCondition(hpkg, "one << two");
1609 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1611 MsiSetProperty(hpkg, "one", "");
1612 MsiSetProperty(hpkg, "two", "hi");
1613 r = MsiEvaluateCondition(hpkg, "one << two");
1614 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1616 MsiSetProperty(hpkg, "one", "hithere");
1617 MsiSetProperty(hpkg, "two", "");
1618 r = MsiEvaluateCondition(hpkg, "one << two");
1619 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1621 MsiSetProperty(hpkg, "one", "");
1622 MsiSetProperty(hpkg, "two", "");
1623 r = MsiEvaluateCondition(hpkg, "one << two");
1624 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1626 MsiSetProperty(hpkg, "one", "1234");
1627 MsiSetProperty(hpkg, "two", "1");
1628 r = MsiEvaluateCondition(hpkg, "one << two");
1629 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1631 MsiSetProperty(hpkg, "one", "1234 one");
1632 MsiSetProperty(hpkg, "two", "1");
1633 r = MsiEvaluateCondition(hpkg, "one << two");
1634 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1636 MsiSetProperty(hpkg, "one", "hithere");
1637 MsiSetProperty(hpkg, "two", "there");
1638 r = MsiEvaluateCondition(hpkg, "one >> two");
1639 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1641 MsiSetProperty(hpkg, "one", "hithere");
1642 MsiSetProperty(hpkg, "two", "hi");
1643 r = MsiEvaluateCondition(hpkg, "one >> two");
1644 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1646 MsiSetProperty(hpkg, "one", "there");
1647 MsiSetProperty(hpkg, "two", "hithere");
1648 r = MsiEvaluateCondition(hpkg, "one >> two");
1649 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1651 MsiSetProperty(hpkg, "one", "there");
1652 MsiSetProperty(hpkg, "two", "there");
1653 r = MsiEvaluateCondition(hpkg, "one >> two");
1654 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1656 MsiSetProperty(hpkg, "one", "abcdhithere");
1657 MsiSetProperty(hpkg, "two", "hi");
1658 r = MsiEvaluateCondition(hpkg, "one >> two");
1659 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1661 MsiSetProperty(hpkg, "one", "");
1662 MsiSetProperty(hpkg, "two", "there");
1663 r = MsiEvaluateCondition(hpkg, "one >> two");
1664 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1666 MsiSetProperty(hpkg, "one", "there");
1667 MsiSetProperty(hpkg, "two", "");
1668 r = MsiEvaluateCondition(hpkg, "one >> two");
1669 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1671 MsiSetProperty(hpkg, "one", "");
1672 MsiSetProperty(hpkg, "two", "");
1673 r = MsiEvaluateCondition(hpkg, "one >> two");
1674 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1676 MsiSetProperty(hpkg, "one", "1234");
1677 MsiSetProperty(hpkg, "two", "4");
1678 r = MsiEvaluateCondition(hpkg, "one >> two");
1679 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1681 MsiSetProperty(hpkg, "one", "one 1234");
1682 MsiSetProperty(hpkg, "two", "4");
1683 r = MsiEvaluateCondition(hpkg, "one >> two");
1684 ok( r == MSICONDITION_TRUE, "wrong return val\n");
1686 MsiSetProperty(hpkg, "MsiNetAssemblySupport", NULL); /* make sure it's empty */
1688 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1689 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1691 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport > \"1.1.4322\"");
1692 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1694 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport >= \"1.1.4322\"");
1695 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1697 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <= \"1.1.4322\"");
1698 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1700 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport <> \"1.1.4322\"");
1701 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1703 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport ~< \"1.1.4322\"");
1704 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1706 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"abcd\"");
1707 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1709 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a1.1.4322\"");
1710 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1712 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322a\"");
1713 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1715 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0000001.1.4322\"");
1716 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1718 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1\"");
1719 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1721 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322.1.1\"");
1722 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1724 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1");
1725 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1727 r = MsiEvaluateCondition(hpkg, "\"2\" < \"1.1\"");
1728 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1730 r = MsiEvaluateCondition(hpkg, "\"2\" < \"12.1\"");
1731 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1733 r = MsiEvaluateCondition(hpkg, "\"02.1\" < \"2.11\"");
1734 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1736 r = MsiEvaluateCondition(hpkg, "\"02.1.1\" < \"2.1\"");
1737 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1739 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1740 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1742 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1743 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1745 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"0\"");
1746 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1748 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"-1\"");
1749 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1751 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a\"");
1752 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1754 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1755 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1757 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"!\"");
1758 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1760 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"/\"");
1761 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1763 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \" \"");
1764 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1766 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"azAZ_\"");
1767 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1769 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]\"");
1770 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1772 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a[a]a\"");
1773 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1775 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]\"");
1776 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1778 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a]a\"");
1779 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1781 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a}\"");
1782 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1784 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"{a\"");
1785 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1787 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"[a\"");
1788 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1790 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a{\"");
1791 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1793 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"a]\"");
1794 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1796 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"A\"");
1797 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1799 MsiSetProperty(hpkg, "MsiNetAssemblySupport", "1.1.4322");
1800 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.4322\"");
1801 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1803 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.14322\"");
1804 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1806 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1.5\"");
1807 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1809 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1.1\"");
1810 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1812 r = MsiEvaluateCondition(hpkg, "MsiNetAssemblySupport < \"1\"");
1813 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1815 MsiSetProperty(hpkg, "one", "1");
1816 r = MsiEvaluateCondition(hpkg, "one < \"1\"");
1817 ok( r == MSICONDITION_FALSE, "wrong return val\n");
1819 MsiSetProperty(hpkg, "X", "5.0");
1821 r = MsiEvaluateCondition(hpkg, "X != \"\"");
1822 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1824 r = MsiEvaluateCondition(hpkg, "X =\"5.0\"");
1825 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1827 r = MsiEvaluateCondition(hpkg, "X =\"5.1\"");
1828 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1830 r = MsiEvaluateCondition(hpkg, "X =\"6.0\"");
1831 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1833 r = MsiEvaluateCondition(hpkg, "X =\"5.0\" or X =\"5.1\" or X =\"6.0\"");
1834 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1836 r = MsiEvaluateCondition(hpkg, "(X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1837 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1839 r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
1840 ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
1842 /* feature doesn't exist */
1843 r = MsiEvaluateCondition(hpkg, "&nofeature");
1844 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1846 MsiSetProperty(hpkg, "A", "2");
1847 MsiSetProperty(hpkg, "X", "50");
1849 r = MsiEvaluateCondition(hpkg, "2 <= X");
1850 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1852 r = MsiEvaluateCondition(hpkg, "A <= X");
1853 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1855 r = MsiEvaluateCondition(hpkg, "A <= 50");
1856 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1858 MsiSetProperty(hpkg, "X", "50val");
1860 r = MsiEvaluateCondition(hpkg, "2 <= X");
1861 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1863 r = MsiEvaluateCondition(hpkg, "A <= X");
1864 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1866 MsiSetProperty(hpkg, "A", "7");
1867 MsiSetProperty(hpkg, "X", "50");
1869 r = MsiEvaluateCondition(hpkg, "7 <= X");
1870 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1872 r = MsiEvaluateCondition(hpkg, "A <= X");
1873 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1875 r = MsiEvaluateCondition(hpkg, "A <= 50");
1876 ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
1878 MsiSetProperty(hpkg, "X", "50val");
1880 r = MsiEvaluateCondition(hpkg, "2 <= X");
1881 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1883 r = MsiEvaluateCondition(hpkg, "A <= X");
1884 ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
1886 MsiCloseHandle( hpkg );
1887 DeleteFile(msifile);
1890 static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop)
1892 UINT r;
1893 DWORD sz;
1894 char buffer[2];
1896 sz = sizeof buffer;
1897 strcpy(buffer,"x");
1898 r = MsiGetProperty( hpkg, prop, buffer, &sz );
1899 return r == ERROR_SUCCESS && buffer[0] == 0 && sz == 0;
1902 static void test_props(void)
1904 MSIHANDLE hpkg, hdb;
1905 UINT r;
1906 DWORD sz;
1907 char buffer[0x100];
1909 hdb = create_package_db();
1910 r = run_query( hdb,
1911 "CREATE TABLE `Property` ( "
1912 "`Property` CHAR(255) NOT NULL, "
1913 "`Value` CHAR(255) "
1914 "PRIMARY KEY `Property`)" );
1915 ok( r == ERROR_SUCCESS , "Failed\n" );
1917 r = run_query(hdb,
1918 "INSERT INTO `Property` "
1919 "(`Property`, `Value`) "
1920 "VALUES( 'MetadataCompName', 'Photoshop.dll' )");
1921 ok( r == ERROR_SUCCESS , "Failed\n" );
1923 r = package_from_db( hdb, &hpkg );
1924 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
1926 skip("Not enough rights to perform tests\n");
1927 DeleteFile(msifile);
1928 return;
1930 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
1932 /* test invalid values */
1933 r = MsiGetProperty( 0, NULL, NULL, NULL );
1934 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1936 r = MsiGetProperty( hpkg, NULL, NULL, NULL );
1937 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1939 r = MsiGetProperty( hpkg, "boo", NULL, NULL );
1940 ok( r == ERROR_SUCCESS, "wrong return val\n");
1942 r = MsiGetProperty( hpkg, "boo", buffer, NULL );
1943 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1945 /* test retrieving an empty/nonexistent property */
1946 sz = sizeof buffer;
1947 r = MsiGetProperty( hpkg, "boo", NULL, &sz );
1948 ok( r == ERROR_SUCCESS, "wrong return val\n");
1949 ok( sz == 0, "wrong size returned\n");
1951 check_prop_empty( hpkg, "boo");
1952 sz = 0;
1953 strcpy(buffer,"x");
1954 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1955 ok( r == ERROR_MORE_DATA, "wrong return val\n");
1956 ok( !strcmp(buffer,"x"), "buffer was changed\n");
1957 ok( sz == 0, "wrong size returned\n");
1959 sz = 1;
1960 strcpy(buffer,"x");
1961 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
1962 ok( r == ERROR_SUCCESS, "wrong return val\n");
1963 ok( buffer[0] == 0, "buffer was not changed\n");
1964 ok( sz == 0, "wrong size returned\n");
1966 /* set the property to something */
1967 r = MsiSetProperty( 0, NULL, NULL );
1968 ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
1970 r = MsiSetProperty( hpkg, NULL, NULL );
1971 ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
1973 r = MsiSetProperty( hpkg, "", NULL );
1974 ok( r == ERROR_SUCCESS, "wrong return val\n");
1976 /* try set and get some illegal property identifiers */
1977 r = MsiSetProperty( hpkg, "", "asdf" );
1978 ok( r == ERROR_FUNCTION_FAILED, "wrong return val\n");
1980 r = MsiSetProperty( hpkg, "=", "asdf" );
1981 ok( r == ERROR_SUCCESS, "wrong return val\n");
1983 r = MsiSetProperty( hpkg, " ", "asdf" );
1984 ok( r == ERROR_SUCCESS, "wrong return val\n");
1986 r = MsiSetProperty( hpkg, "'", "asdf" );
1987 ok( r == ERROR_SUCCESS, "wrong return val\n");
1989 sz = sizeof buffer;
1990 buffer[0]=0;
1991 r = MsiGetProperty( hpkg, "'", buffer, &sz );
1992 ok( r == ERROR_SUCCESS, "wrong return val\n");
1993 ok( !strcmp(buffer,"asdf"), "buffer was not changed\n");
1995 /* set empty values */
1996 r = MsiSetProperty( hpkg, "boo", NULL );
1997 ok( r == ERROR_SUCCESS, "wrong return val\n");
1998 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2000 r = MsiSetProperty( hpkg, "boo", "" );
2001 ok( r == ERROR_SUCCESS, "wrong return val\n");
2002 ok( check_prop_empty( hpkg, "boo"), "prop wasn't empty\n");
2004 /* set a non-empty value */
2005 r = MsiSetProperty( hpkg, "boo", "xyz" );
2006 ok( r == ERROR_SUCCESS, "wrong return val\n");
2008 sz = 1;
2009 strcpy(buffer,"x");
2010 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2011 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2012 ok( buffer[0] == 0, "buffer was not changed\n");
2013 ok( sz == 3, "wrong size returned\n");
2015 sz = 4;
2016 strcpy(buffer,"x");
2017 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2018 ok( r == ERROR_SUCCESS, "wrong return val\n");
2019 ok( !strcmp(buffer,"xyz"), "buffer was not changed\n");
2020 ok( sz == 3, "wrong size returned\n");
2022 sz = 3;
2023 strcpy(buffer,"x");
2024 r = MsiGetProperty( hpkg, "boo", buffer, &sz );
2025 ok( r == ERROR_MORE_DATA, "wrong return val\n");
2026 ok( !strcmp(buffer,"xy"), "buffer was not changed\n");
2027 ok( sz == 3, "wrong size returned\n");
2029 r = MsiSetProperty(hpkg, "SourceDir", "foo");
2030 ok( r == ERROR_SUCCESS, "wrong return val\n");
2032 sz = 4;
2033 r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
2034 ok( r == ERROR_SUCCESS, "wrong return val\n");
2035 ok( !strcmp(buffer,""), "buffer wrong\n");
2036 ok( sz == 0, "wrong size returned\n");
2038 sz = 4;
2039 r = MsiGetProperty(hpkg, "SOMERANDOMNAME", buffer, &sz);
2040 ok( r == ERROR_SUCCESS, "wrong return val\n");
2041 ok( !strcmp(buffer,""), "buffer wrong\n");
2042 ok( sz == 0, "wrong size returned\n");
2044 sz = 4;
2045 r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
2046 ok( r == ERROR_SUCCESS, "wrong return val\n");
2047 ok( !strcmp(buffer,"foo"), "buffer wrong\n");
2048 ok( sz == 3, "wrong size returned\n");
2050 r = MsiSetProperty(hpkg, "MetadataCompName", "Photoshop.dll");
2051 ok( r == ERROR_SUCCESS, "wrong return val\n");
2053 sz = 0;
2054 r = MsiGetProperty(hpkg, "MetadataCompName", NULL, &sz );
2055 ok( r == ERROR_SUCCESS, "return wrong\n");
2056 ok( sz == 13, "size wrong (%d)\n", sz);
2058 sz = 13;
2059 r = MsiGetProperty(hpkg, "MetadataCompName", buffer, &sz );
2060 ok( r == ERROR_MORE_DATA, "return wrong\n");
2061 ok( !strcmp(buffer,"Photoshop.dl"), "buffer wrong\n");
2063 r = MsiSetProperty(hpkg, "property", "value");
2064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2066 sz = 6;
2067 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2068 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2069 ok( !strcmp(buffer, "value"), "Expected value, got %s\n", buffer);
2071 r = MsiSetProperty(hpkg, "property", NULL);
2072 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2074 sz = 6;
2075 r = MsiGetProperty(hpkg, "property", buffer, &sz);
2076 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2077 ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
2079 MsiCloseHandle( hpkg );
2080 DeleteFile(msifile);
2083 static BOOL find_prop_in_property(MSIHANDLE hdb, LPCSTR prop, LPCSTR val)
2085 MSIHANDLE hview, hrec;
2086 BOOL found;
2087 CHAR buffer[MAX_PATH];
2088 DWORD sz;
2089 UINT r;
2091 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
2092 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2093 r = MsiViewExecute(hview, 0);
2094 ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
2096 found = FALSE;
2097 while (r == ERROR_SUCCESS && !found)
2099 r = MsiViewFetch(hview, &hrec);
2100 if (r != ERROR_SUCCESS) break;
2102 sz = MAX_PATH;
2103 r = MsiRecordGetString(hrec, 1, buffer, &sz);
2104 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, prop))
2106 sz = MAX_PATH;
2107 r = MsiRecordGetString(hrec, 2, buffer, &sz);
2108 if (r == ERROR_SUCCESS && !lstrcmpA(buffer, val))
2109 found = TRUE;
2112 MsiCloseHandle(hrec);
2115 MsiViewClose(hview);
2116 MsiCloseHandle(hview);
2118 return found;
2121 static void test_property_table(void)
2123 const char *query;
2124 UINT r;
2125 MSIHANDLE hpkg, hdb, hrec;
2126 char buffer[MAX_PATH], package[10];
2127 DWORD sz;
2128 BOOL found;
2130 hdb = create_package_db();
2131 ok( hdb, "failed to create package\n");
2133 r = package_from_db(hdb, &hpkg);
2134 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2136 skip("Not enough rights to perform tests\n");
2137 DeleteFile(msifile);
2138 return;
2140 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2142 MsiCloseHandle(hdb);
2144 hdb = MsiGetActiveDatabase(hpkg);
2146 query = "CREATE TABLE `_Property` ( "
2147 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2148 r = run_query(hdb, query);
2149 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2151 MsiCloseHandle(hdb);
2152 MsiCloseHandle(hpkg);
2153 DeleteFile(msifile);
2155 hdb = create_package_db();
2156 ok( hdb, "failed to create package\n");
2158 query = "CREATE TABLE `_Property` ( "
2159 "`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
2160 r = run_query(hdb, query);
2161 ok(r == ERROR_SUCCESS, "failed to create table\n");
2163 query = "ALTER `_Property` ADD `foo` INTEGER";
2164 r = run_query(hdb, query);
2165 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2167 query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
2168 r = run_query(hdb, query);
2169 ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
2171 query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
2172 r = run_query(hdb, query);
2173 ok(r == ERROR_SUCCESS, "failed to add column\n");
2175 sprintf(package, "#%i", hdb);
2176 r = MsiOpenPackage(package, &hpkg);
2177 todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n");
2178 if (r == ERROR_SUCCESS)
2179 MsiCloseHandle(hpkg);
2181 r = MsiCloseHandle(hdb);
2182 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
2184 hdb = create_package_db();
2185 ok (hdb, "failed to create package database\n");
2187 r = create_property_table(hdb);
2188 ok(r == ERROR_SUCCESS, "cannot create Property table: %d\n", r);
2190 r = add_property_entry(hdb, "'prop', 'val'");
2191 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2193 r = package_from_db(hdb, &hpkg);
2194 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
2196 MsiCloseHandle(hdb);
2198 sz = MAX_PATH;
2199 r = MsiGetProperty(hpkg, "prop", buffer, &sz);
2200 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2201 ok(!lstrcmp(buffer, "val"), "Expected val, got %s\n", buffer);
2203 hdb = MsiGetActiveDatabase(hpkg);
2205 found = find_prop_in_property(hdb, "prop", "val");
2206 ok(found, "prop should be in the _Property table\n");
2208 r = add_property_entry(hdb, "'dantes', 'mercedes'");
2209 ok(r == ERROR_SUCCESS, "cannot add property: %d\n", r);
2211 query = "SELECT * FROM `_Property` WHERE `Property` = 'dantes'";
2212 r = do_query(hdb, query, &hrec);
2213 ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
2215 found = find_prop_in_property(hdb, "dantes", "mercedes");
2216 ok(found == FALSE, "dantes should not be in the _Property table\n");
2218 sz = MAX_PATH;
2219 lstrcpy(buffer, "aaa");
2220 r = MsiGetProperty(hpkg, "dantes", buffer, &sz);
2221 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2222 ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
2224 r = MsiSetProperty(hpkg, "dantes", "mercedes");
2225 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2227 found = find_prop_in_property(hdb, "dantes", "mercedes");
2228 ok(found == TRUE, "dantes should be in the _Property table\n");
2230 MsiCloseHandle(hdb);
2231 MsiCloseHandle(hpkg);
2232 DeleteFile(msifile);
2235 static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
2237 MSIHANDLE htab = 0;
2238 UINT res;
2240 res = MsiDatabaseOpenView( hdb, szQuery, &htab );
2241 if( res == ERROR_SUCCESS )
2243 UINT r;
2245 r = MsiViewExecute( htab, hrec );
2246 if( r != ERROR_SUCCESS )
2248 res = r;
2249 fprintf(stderr,"MsiViewExecute failed %08x\n", res);
2252 r = MsiViewClose( htab );
2253 if( r != ERROR_SUCCESS )
2254 res = r;
2256 r = MsiCloseHandle( htab );
2257 if( r != ERROR_SUCCESS )
2258 res = r;
2260 return res;
2263 static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
2265 return try_query_param( hdb, szQuery, 0 );
2268 static void set_summary_str(MSIHANDLE hdb, DWORD pid, LPCSTR value)
2270 MSIHANDLE summary;
2271 UINT r;
2273 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2274 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2276 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_LPSTR, 0, NULL, value);
2277 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2279 r = MsiSummaryInfoPersist(summary);
2280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2282 MsiCloseHandle(summary);
2285 static void set_summary_dword(MSIHANDLE hdb, DWORD pid, DWORD value)
2287 MSIHANDLE summary;
2288 UINT r;
2290 r = MsiGetSummaryInformationA(hdb, NULL, 1, &summary);
2291 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2293 r = MsiSummaryInfoSetPropertyA(summary, pid, VT_I4, value, NULL, NULL);
2294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2296 r = MsiSummaryInfoPersist(summary);
2297 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2299 MsiCloseHandle(summary);
2302 static void test_msipackage(void)
2304 MSIHANDLE hdb = 0, hpack = 100;
2305 UINT r;
2306 const char *query;
2307 char name[10];
2309 /* NULL szPackagePath */
2310 r = MsiOpenPackage(NULL, &hpack);
2311 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2313 /* empty szPackagePath */
2314 r = MsiOpenPackage("", &hpack);
2315 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2317 skip("Not enough rights to perform tests\n");
2318 return;
2320 todo_wine
2322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2325 if (r == ERROR_SUCCESS)
2326 MsiCloseHandle(hpack);
2328 /* nonexistent szPackagePath */
2329 r = MsiOpenPackage("nonexistent", &hpack);
2330 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
2332 /* NULL hProduct */
2333 r = MsiOpenPackage(msifile, NULL);
2334 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2336 name[0]='#';
2337 name[1]=0;
2338 r = MsiOpenPackage(name, &hpack);
2339 ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r);
2341 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2344 /* database exists, but is emtpy */
2345 sprintf(name, "#%d", hdb);
2346 r = MsiOpenPackage(name, &hpack);
2347 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2348 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2350 query = "CREATE TABLE `Property` ( "
2351 "`Property` CHAR(72), `Value` CHAR(0) "
2352 "PRIMARY KEY `Property`)";
2353 r = try_query(hdb, query);
2354 ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
2356 query = "CREATE TABLE `InstallExecuteSequence` ("
2357 "`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
2358 "PRIMARY KEY `Action`)";
2359 r = try_query(hdb, query);
2360 ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
2362 /* a few key tables exist */
2363 sprintf(name, "#%d", hdb);
2364 r = MsiOpenPackage(name, &hpack);
2365 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2366 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2368 MsiCloseHandle(hdb);
2369 DeleteFile(msifile);
2371 /* start with a clean database to show what constitutes a valid package */
2372 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
2373 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2375 sprintf(name, "#%d", hdb);
2377 /* The following summary information props must exist:
2378 * - PID_REVNUMBER
2379 * - PID_PAGECOUNT
2382 set_summary_dword(hdb, PID_PAGECOUNT, 100);
2383 r = MsiOpenPackage(name, &hpack);
2384 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
2385 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
2387 set_summary_str(hdb, PID_REVNUMBER, "{004757CD-5092-49c2-AD20-28E1CE0DF5F2}");
2388 r = MsiOpenPackage(name, &hpack);
2389 ok(r == ERROR_SUCCESS,
2390 "Expected ERROR_SUCCESS, got %d\n", r);
2392 MsiCloseHandle(hpack);
2393 MsiCloseHandle(hdb);
2394 DeleteFile(msifile);
2397 static void test_formatrecord2(void)
2399 MSIHANDLE hpkg, hrec ;
2400 char buffer[0x100];
2401 DWORD sz;
2402 UINT r;
2404 r = package_from_db(create_package_db(), &hpkg);
2405 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2407 skip("Not enough rights to perform tests\n");
2408 DeleteFile(msifile);
2409 return;
2411 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r);
2413 r = MsiSetProperty(hpkg, "Manufacturer", " " );
2414 ok( r == ERROR_SUCCESS, "set property failed\n");
2416 hrec = MsiCreateRecord(2);
2417 ok(hrec, "create record failed\n");
2419 r = MsiRecordSetString( hrec, 0, "[ProgramFilesFolder][Manufacturer]\\asdf");
2420 ok( r == ERROR_SUCCESS, "format record failed\n");
2422 buffer[0] = 0;
2423 sz = sizeof buffer;
2424 r = MsiFormatRecord( hpkg, hrec, buffer, &sz );
2426 r = MsiRecordSetString(hrec, 0, "[foo][1]");
2427 r = MsiRecordSetString(hrec, 1, "hoo");
2428 sz = sizeof buffer;
2429 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2430 ok( sz == 3, "size wrong\n");
2431 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2432 ok( r == ERROR_SUCCESS, "format failed\n");
2434 r = MsiRecordSetString(hrec, 0, "x[~]x");
2435 sz = sizeof buffer;
2436 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2437 ok( sz == 3, "size wrong\n");
2438 ok( 0 == strcmp(buffer,"x"), "wrong output %s\n",buffer);
2439 ok( r == ERROR_SUCCESS, "format failed\n");
2441 r = MsiRecordSetString(hrec, 0, "[foo.$%}][1]");
2442 r = MsiRecordSetString(hrec, 1, "hoo");
2443 sz = sizeof buffer;
2444 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2445 ok( sz == 3, "size wrong\n");
2446 ok( 0 == strcmp(buffer,"hoo"), "wrong output %s\n",buffer);
2447 ok( r == ERROR_SUCCESS, "format failed\n");
2449 r = MsiRecordSetString(hrec, 0, "[\\[]");
2450 sz = sizeof buffer;
2451 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2452 ok( sz == 1, "size wrong\n");
2453 ok( 0 == strcmp(buffer,"["), "wrong output %s\n",buffer);
2454 ok( r == ERROR_SUCCESS, "format failed\n");
2456 SetEnvironmentVariable("FOO", "BAR");
2457 r = MsiRecordSetString(hrec, 0, "[%FOO]");
2458 sz = sizeof buffer;
2459 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2460 ok( sz == 3, "size wrong\n");
2461 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2462 ok( r == ERROR_SUCCESS, "format failed\n");
2464 r = MsiRecordSetString(hrec, 0, "[[1]]");
2465 r = MsiRecordSetString(hrec, 1, "%FOO");
2466 sz = sizeof buffer;
2467 r = MsiFormatRecord(hpkg, hrec, buffer, &sz);
2468 ok( sz == 3, "size wrong\n");
2469 ok( 0 == strcmp(buffer,"BAR"), "wrong output %s\n",buffer);
2470 ok( r == ERROR_SUCCESS, "format failed\n");
2472 MsiCloseHandle( hrec );
2473 MsiCloseHandle( hpkg );
2474 DeleteFile(msifile);
2477 static void test_states(void)
2479 MSIHANDLE hpkg;
2480 UINT r;
2481 MSIHANDLE hdb;
2482 INSTALLSTATE state, action;
2484 static const CHAR msifile2[] = "winetest2-package.msi";
2485 static const CHAR msifile3[] = "winetest3-package.msi";
2486 static const CHAR msifile4[] = "winetest4-package.msi";
2488 if (is_process_limited())
2490 skip("process is limited\n");
2491 return;
2494 hdb = create_package_db();
2495 ok ( hdb, "failed to create package database\n" );
2497 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
2498 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
2500 r = create_property_table( hdb );
2501 ok( r == ERROR_SUCCESS, "cannot create Property table: %d\n", r );
2503 r = add_property_entry( hdb, "'ProductCode', '{7262AC98-EEBD-4364-8CE3-D654F6A425B9}'" );
2504 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2506 r = add_property_entry( hdb, "'ProductLanguage', '1033'" );
2507 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2509 r = add_property_entry( hdb, "'ProductName', 'MSITEST'" );
2510 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2512 r = add_property_entry( hdb, "'ProductVersion', '1.1.1'" );
2513 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2515 r = add_property_entry( hdb, "'MSIFASTINSTALL', '1'" );
2516 ok( r == ERROR_SUCCESS, "cannot add property entry: %d\n", r );
2518 r = create_install_execute_sequence_table( hdb );
2519 ok( r == ERROR_SUCCESS, "cannot create InstallExecuteSequence table: %d\n", r );
2521 r = add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" );
2522 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2524 r = add_install_execute_sequence_entry( hdb, "'FileCost', '', '900'" );
2525 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2527 r = add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
2528 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2530 r = add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1400'" );
2531 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2533 r = add_install_execute_sequence_entry( hdb, "'InstallInitialize', '', '1500'" );
2534 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2536 r = add_install_execute_sequence_entry( hdb, "'ProcessComponents', '', '1600'" );
2537 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2539 r = add_install_execute_sequence_entry( hdb, "'UnpublishFeatures', '', '1800'" );
2540 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2542 r = add_install_execute_sequence_entry( hdb, "'RegisterProduct', '', '6100'" );
2543 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2545 r = add_install_execute_sequence_entry( hdb, "'PublishFeatures', '', '6300'" );
2546 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2548 r = add_install_execute_sequence_entry( hdb, "'PublishProduct', '', '6400'" );
2549 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2551 r = add_install_execute_sequence_entry( hdb, "'InstallFinalize', '', '6600'" );
2552 ok( r == ERROR_SUCCESS, "cannot add install execute sequence entry: %d\n", r );
2554 r = create_media_table( hdb );
2555 ok( r == ERROR_SUCCESS, "cannot create media table: %d\n", r );
2557 r = add_media_entry( hdb, "'1', '3', '', '', 'DISK1', ''");
2558 ok( r == ERROR_SUCCESS, "cannot add media entry: %d\n", r );
2560 r = create_feature_table( hdb );
2561 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
2563 r = create_component_table( hdb );
2564 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
2566 /* msidbFeatureAttributesFavorLocal */
2567 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
2568 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2570 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
2571 r = add_component_entry( hdb, "'alpha', '{467EC132-739D-4784-A37B-677AA43DBC94}', 'TARGETDIR', 0, '', 'alpha_file'" );
2572 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2574 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
2575 r = add_component_entry( hdb, "'beta', '{2C1F189C-24A6-4C34-B26B-994A6C026506}', 'TARGETDIR', 1, '', 'beta_file'" );
2576 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2578 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
2579 r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" );
2580 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2582 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */
2583 r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" );
2584 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2586 /* msidbFeatureAttributesFavorSource */
2587 r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" );
2588 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2590 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
2591 r = add_component_entry( hdb, "'delta', '{938FD4F2-C648-4259-A03C-7AA3B45643F3}', 'TARGETDIR', 0, '', 'delta_file'" );
2592 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2594 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2595 r = add_component_entry( hdb, "'epsilon', '{D59713B6-C11D-47F2-A395-1E5321781190}', 'TARGETDIR', 1, '', 'epsilon_file'" );
2596 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2598 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
2599 r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" );
2600 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2602 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */
2603 r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" );
2604 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2606 /* msidbFeatureAttributesFavorSource */
2607 r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
2608 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2610 /* msidbFeatureAttributesFavorLocal */
2611 r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
2612 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2614 /* disabled */
2615 r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
2616 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2618 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
2619 r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
2620 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2622 /* no feature parent:msidbComponentAttributesLocalOnly */
2623 r = add_component_entry( hdb, "'kappa', '{D6B93DC3-8DA5-4769-9888-42BFE156BB8B}', 'TARGETDIR', 1, '', 'kappa_file'" );
2624 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2626 /* msidbFeatureAttributesFavorLocal:removed */
2627 r = add_feature_entry( hdb, "'six', '', '', '', 2, 1, '', 0" );
2628 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2630 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesLocalOnly */
2631 r = add_component_entry( hdb, "'lambda', '{6528C5E4-02A4-4636-A214-7A66A6C35B64}', 'TARGETDIR', 0, '', 'lambda_file'" );
2632 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2634 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSourceOnly */
2635 r = add_component_entry( hdb, "'mu', '{97014BAB-6C56-4013-9A63-2BF913B42519}', 'TARGETDIR', 1, '', 'mu_file'" );
2636 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2638 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesOptional */
2639 r = add_component_entry( hdb, "'nu', '{943DD0D8-5808-4954-8526-3B8493FEDDCD}', 'TARGETDIR', 2, '', 'nu_file'" );
2640 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2642 /* msidbFeatureAttributesFavorLocal:removed:msidbComponentAttributesSharedDllRefCount */
2643 r = add_component_entry( hdb, "'xi', '{D6CF9EF7-6FCF-4930-B34B-F938AEFF9BDB}', 'TARGETDIR', 8, '', 'xi_file'" );
2644 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2646 /* msidbFeatureAttributesFavorSource:removed */
2647 r = add_feature_entry( hdb, "'seven', '', '', '', 2, 1, '', 1" );
2648 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2650 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesLocalOnly */
2651 r = add_component_entry( hdb, "'omicron', '{7B57521D-15DB-4141-9AA6-01D934A4433F}', 'TARGETDIR', 0, '', 'omicron_file'" );
2652 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2654 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSourceOnly */
2655 r = add_component_entry( hdb, "'pi', '{FB85346B-378E-4492-8769-792305471C81}', 'TARGETDIR', 1, '', 'pi_file'" );
2656 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2658 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesOptional */
2659 r = add_component_entry( hdb, "'rho', '{798F2047-7B0C-4783-8BB0-D703E554114B}', 'TARGETDIR', 2, '', 'rho_file'" );
2660 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2662 /* msidbFeatureAttributesFavorSource:removed:msidbComponentAttributesSharedDllRefCount */
2663 r = add_component_entry( hdb, "'sigma', '{5CE9DDA8-B67B-4736-9D93-99D61C5B93E7}', 'TARGETDIR', 8, '', 'sigma_file'" );
2664 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2666 /* msidbFeatureAttributesFavorLocal */
2667 r = add_feature_entry( hdb, "'eight', '', '', '', 2, 1, '', 0" );
2668 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2670 r = add_component_entry( hdb, "'tau', '{07DEB510-677C-4A6F-A0A6-7CD8EFEA77ED}', 'TARGETDIR', 1, '', 'tau_file'" );
2671 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2673 /* msidbFeatureAttributesFavorSource */
2674 r = add_feature_entry( hdb, "'nine', '', '', '', 2, 1, '', 1" );
2675 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2677 r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
2678 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2680 /* msidbFeatureAttributesFavorAdvertise */
2681 r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
2682 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2684 r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
2685 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2687 /* msidbFeatureAttributesUIDisallowAbsent */
2688 r = add_feature_entry( hdb, "'eleven', '', '', '', 2, 1, '', 16" );
2689 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
2691 r = add_component_entry( hdb, "'psi', '{A06B23B5-746B-427A-8A6E-FD6AC8F46A95}', 'TARGETDIR', 1, '', 'psi_file'" );
2692 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
2694 r = create_feature_components_table( hdb );
2695 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
2697 r = add_feature_components_entry( hdb, "'one', 'alpha'" );
2698 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2700 r = add_feature_components_entry( hdb, "'one', 'beta'" );
2701 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2703 r = add_feature_components_entry( hdb, "'one', 'gamma'" );
2704 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2706 r = add_feature_components_entry( hdb, "'one', 'theta'" );
2707 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2709 r = add_feature_components_entry( hdb, "'two', 'delta'" );
2710 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2712 r = add_feature_components_entry( hdb, "'two', 'epsilon'" );
2713 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2715 r = add_feature_components_entry( hdb, "'two', 'zeta'" );
2716 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2718 r = add_feature_components_entry( hdb, "'two', 'iota'" );
2719 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2721 r = add_feature_components_entry( hdb, "'three', 'eta'" );
2722 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2724 r = add_feature_components_entry( hdb, "'four', 'eta'" );
2725 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2727 r = add_feature_components_entry( hdb, "'five', 'eta'" );
2728 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2730 r = add_feature_components_entry( hdb, "'six', 'lambda'" );
2731 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2733 r = add_feature_components_entry( hdb, "'six', 'mu'" );
2734 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2736 r = add_feature_components_entry( hdb, "'six', 'nu'" );
2737 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2739 r = add_feature_components_entry( hdb, "'six', 'xi'" );
2740 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2742 r = add_feature_components_entry( hdb, "'seven', 'omicron'" );
2743 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2745 r = add_feature_components_entry( hdb, "'seven', 'pi'" );
2746 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2748 r = add_feature_components_entry( hdb, "'seven', 'rho'" );
2749 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2751 r = add_feature_components_entry( hdb, "'seven', 'sigma'" );
2752 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2754 r = add_feature_components_entry( hdb, "'eight', 'tau'" );
2755 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2757 r = add_feature_components_entry( hdb, "'nine', 'phi'" );
2758 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2760 r = add_feature_components_entry( hdb, "'ten', 'chi'" );
2761 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2763 r = add_feature_components_entry( hdb, "'eleven', 'psi'" );
2764 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
2766 r = create_file_table( hdb );
2767 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
2769 r = add_file_entry( hdb, "'alpha_file', 'alpha', 'alpha.txt', 100, '', '1033', 8192, 1" );
2770 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2772 r = add_file_entry( hdb, "'beta_file', 'beta', 'beta.txt', 0, '', '1033', 8192, 1" );
2773 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2775 r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" );
2776 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2778 r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" );
2779 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2781 r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" );
2782 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2784 r = add_file_entry( hdb, "'epsilon_file', 'epsilon', 'epsilon.txt', 0, '', '1033', 8192, 1" );
2785 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2787 r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" );
2788 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2790 r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" );
2791 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2793 /* compressed file */
2794 r = add_file_entry( hdb, "'eta_file', 'eta', 'eta.txt', 0, '', '1033', 16384, 1" );
2795 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2797 r = add_file_entry( hdb, "'kappa_file', 'kappa', 'kappa.txt', 0, '', '1033', 8192, 1" );
2798 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2800 r = add_file_entry( hdb, "'lambda_file', 'lambda', 'lambda.txt', 100, '', '1033', 8192, 1" );
2801 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2803 r = add_file_entry( hdb, "'mu_file', 'mu', 'mu.txt', 100, '', '1033', 8192, 1" );
2804 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2806 r = add_file_entry( hdb, "'nu_file', 'nu', 'nu.txt', 100, '', '1033', 8192, 1" );
2807 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2809 r = add_file_entry( hdb, "'xi_file', 'xi', 'xi.txt', 100, '', '1033', 8192, 1" );
2810 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2812 r = add_file_entry( hdb, "'omicron_file', 'omicron', 'omicron.txt', 100, '', '1033', 8192, 1" );
2813 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2815 r = add_file_entry( hdb, "'pi_file', 'pi', 'pi.txt', 100, '', '1033', 8192, 1" );
2816 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2818 r = add_file_entry( hdb, "'rho_file', 'rho', 'rho.txt', 100, '', '1033', 8192, 1" );
2819 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2821 r = add_file_entry( hdb, "'sigma_file', 'sigma', 'sigma.txt', 100, '', '1033', 8192, 1" );
2822 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2824 r = add_file_entry( hdb, "'tau_file', 'tau', 'tau.txt', 100, '', '1033', 8192, 1" );
2825 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2827 r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
2828 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2830 r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
2831 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2833 r = add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
2834 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
2836 MsiDatabaseCommit(hdb);
2838 /* these properties must not be in the saved msi file */
2839 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
2840 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2842 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
2843 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2845 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
2846 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2848 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
2849 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2851 r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
2852 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
2854 r = package_from_db( hdb, &hpkg );
2855 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2857 skip("Not enough rights to perform tests\n");
2858 DeleteFile(msifile);
2859 return;
2861 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
2863 MsiCloseHandle(hdb);
2865 CopyFileA(msifile, msifile2, FALSE);
2866 CopyFileA(msifile, msifile3, FALSE);
2867 CopyFileA(msifile, msifile4, FALSE);
2869 state = 0xdeadbee;
2870 action = 0xdeadbee;
2871 r = MsiGetFeatureState(hpkg, "one", &state, &action);
2872 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2876 state = 0xdeadbee;
2877 action = 0xdeadbee;
2878 r = MsiGetFeatureState(hpkg, "two", &state, &action);
2879 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2883 state = 0xdeadbee;
2884 action = 0xdeadbee;
2885 r = MsiGetFeatureState(hpkg, "three", &state, &action);
2886 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2890 state = 0xdeadbee;
2891 action = 0xdeadbee;
2892 r = MsiGetFeatureState(hpkg, "four", &state, &action);
2893 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2897 state = 0xdeadbee;
2898 action = 0xdeadbee;
2899 r = MsiGetFeatureState(hpkg, "five", &state, &action);
2900 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2904 state = 0xdeadbee;
2905 action = 0xdeadbee;
2906 r = MsiGetFeatureState(hpkg, "six", &state, &action);
2907 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2911 state = 0xdeadbee;
2912 action = 0xdeadbee;
2913 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
2914 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2918 state = 0xdeadbee;
2919 action = 0xdeadbee;
2920 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
2921 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2925 state = 0xdeadbee;
2926 action = 0xdeadbee;
2927 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
2928 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2932 state = 0xdeadbee;
2933 action = 0xdeadbee;
2934 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
2935 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2939 state = 0xdeadbee;
2940 action = 0xdeadbee;
2941 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
2942 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
2943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2946 state = 0xdeadbee;
2947 action = 0xdeadbee;
2948 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
2949 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2953 state = 0xdeadbee;
2954 action = 0xdeadbee;
2955 r = MsiGetComponentState(hpkg, "beta", &state, &action);
2956 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2960 state = 0xdeadbee;
2961 action = 0xdeadbee;
2962 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
2963 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2967 state = 0xdeadbee;
2968 action = 0xdeadbee;
2969 r = MsiGetComponentState(hpkg, "theta", &state, &action);
2970 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2971 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2972 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2974 state = 0xdeadbee;
2975 action = 0xdeadbee;
2976 r = MsiGetComponentState(hpkg, "delta", &state, &action);
2977 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2978 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2979 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2981 state = 0xdeadbee;
2982 action = 0xdeadbee;
2983 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
2984 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2985 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2986 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2988 state = 0xdeadbee;
2989 action = 0xdeadbee;
2990 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
2991 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2992 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
2993 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
2995 state = 0xdeadbee;
2996 action = 0xdeadbee;
2997 r = MsiGetComponentState(hpkg, "iota", &state, &action);
2998 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
2999 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3000 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3002 state = 0xdeadbee;
3003 action = 0xdeadbee;
3004 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3005 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3006 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3007 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3009 state = 0xdeadbee;
3010 action = 0xdeadbee;
3011 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3012 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3013 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3014 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3016 state = 0xdeadbee;
3017 action = 0xdeadbee;
3018 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3019 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3020 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3021 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3023 state = 0xdeadbee;
3024 action = 0xdeadbee;
3025 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3026 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3027 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3028 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3030 state = 0xdeadbee;
3031 action = 0xdeadbee;
3032 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3033 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3034 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3035 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3037 state = 0xdeadbee;
3038 action = 0xdeadbee;
3039 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3040 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3041 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3042 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3044 state = 0xdeadbee;
3045 action = 0xdeadbee;
3046 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3047 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3048 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3049 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3051 state = 0xdeadbee;
3052 action = 0xdeadbee;
3053 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3054 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3055 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3056 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3058 state = 0xdeadbee;
3059 action = 0xdeadbee;
3060 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3061 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3062 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3063 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3065 state = 0xdeadbee;
3066 action = 0xdeadbee;
3067 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3068 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3069 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3070 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3072 state = 0xdeadbee;
3073 action = 0xdeadbee;
3074 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3075 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3076 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3077 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3079 state = 0xdeadbee;
3080 action = 0xdeadbee;
3081 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3082 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3083 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3084 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3086 state = 0xdeadbee;
3087 action = 0xdeadbee;
3088 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3089 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3090 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3091 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3093 state = 0xdeadbee;
3094 action = 0xdeadbee;
3095 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3096 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3097 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3098 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3100 r = MsiDoAction( hpkg, "CostInitialize");
3101 ok( r == ERROR_SUCCESS, "cost init failed\n");
3103 state = 0xdeadbee;
3104 action = 0xdeadbee;
3105 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3110 state = 0xdeadbee;
3111 action = 0xdeadbee;
3112 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3117 state = 0xdeadbee;
3118 action = 0xdeadbee;
3119 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3124 state = 0xdeadbee;
3125 action = 0xdeadbee;
3126 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3131 state = 0xdeadbee;
3132 action = 0xdeadbee;
3133 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3138 state = 0xdeadbee;
3139 action = 0xdeadbee;
3140 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3145 state = 0xdeadbee;
3146 action = 0xdeadbee;
3147 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3152 state = 0xdeadbee;
3153 action = 0xdeadbee;
3154 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3159 state = 0xdeadbee;
3160 action = 0xdeadbee;
3161 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3166 state = 0xdeadbee;
3167 action = 0xdeadbee;
3168 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3173 state = 0xdeadbee;
3174 action = 0xdeadbee;
3175 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3180 state = 0xdeadbee;
3181 action = 0xdeadbee;
3182 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3187 state = 0xdeadbee;
3188 action = 0xdeadbee;
3189 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3190 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3191 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3194 state = 0xdeadbee;
3195 action = 0xdeadbee;
3196 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3197 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3198 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3199 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3201 state = 0xdeadbee;
3202 action = 0xdeadbee;
3203 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3204 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3205 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3206 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3208 state = 0xdeadbee;
3209 action = 0xdeadbee;
3210 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3211 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3212 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3213 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3215 state = 0xdeadbee;
3216 action = 0xdeadbee;
3217 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3219 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3220 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3222 state = 0xdeadbee;
3223 action = 0xdeadbee;
3224 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3226 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3227 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3229 state = 0xdeadbee;
3230 action = 0xdeadbee;
3231 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3233 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3234 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3236 state = 0xdeadbee;
3237 action = 0xdeadbee;
3238 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3240 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3241 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3243 state = 0xdeadbee;
3244 action = 0xdeadbee;
3245 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3247 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3250 state = 0xdeadbee;
3251 action = 0xdeadbee;
3252 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3253 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3254 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3255 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3257 state = 0xdeadbee;
3258 action = 0xdeadbee;
3259 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3260 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3261 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3262 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3264 state = 0xdeadbee;
3265 action = 0xdeadbee;
3266 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3267 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3268 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3269 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3271 state = 0xdeadbee;
3272 action = 0xdeadbee;
3273 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3274 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3275 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3276 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3278 state = 0xdeadbee;
3279 action = 0xdeadbee;
3280 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3281 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3282 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3283 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3285 state = 0xdeadbee;
3286 action = 0xdeadbee;
3287 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3288 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3289 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3290 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3292 state = 0xdeadbee;
3293 action = 0xdeadbee;
3294 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3295 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3296 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3297 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3299 state = 0xdeadbee;
3300 action = 0xdeadbee;
3301 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3302 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3303 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3304 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3306 state = 0xdeadbee;
3307 action = 0xdeadbee;
3308 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3309 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3310 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3311 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3313 state = 0xdeadbee;
3314 action = 0xdeadbee;
3315 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3316 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3317 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3318 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3320 state = 0xdeadbee;
3321 action = 0xdeadbee;
3322 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3323 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3324 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3325 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3327 state = 0xdeadbee;
3328 action = 0xdeadbee;
3329 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3330 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3331 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3332 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3334 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3336 r = MsiDoAction( hpkg, "FileCost");
3337 ok( r == ERROR_SUCCESS, "file cost failed\n");
3339 r = MsiGetFeatureState(hpkg, "one", NULL, NULL);
3340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3342 action = 0xdeadbee;
3343 r = MsiGetFeatureState(hpkg, "one", NULL, &action);
3344 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3345 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3347 state = 0xdeadbee;
3348 r = MsiGetFeatureState( hpkg, "one", &state, NULL);
3349 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3350 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3352 state = 0xdeadbee;
3353 action = 0xdeadbee;
3354 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3355 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3356 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3357 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3359 state = 0xdeadbee;
3360 action = 0xdeadbee;
3361 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3362 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3363 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3364 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3366 state = 0xdeadbee;
3367 action = 0xdeadbee;
3368 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3369 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3370 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3371 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3373 state = 0xdeadbee;
3374 action = 0xdeadbee;
3375 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3376 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3377 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3378 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3380 state = 0xdeadbee;
3381 action = 0xdeadbee;
3382 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3383 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3384 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3385 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3387 state = 0xdeadbee;
3388 action = 0xdeadbee;
3389 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3390 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3391 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3392 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3394 state = 0xdeadbee;
3395 action = 0xdeadbee;
3396 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3397 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3398 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3399 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3401 state = 0xdeadbee;
3402 action = 0xdeadbee;
3403 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3404 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3405 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3406 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3408 state = 0xdeadbee;
3409 action = 0xdeadbee;
3410 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3411 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3412 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3413 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3415 state = 0xdeadbee;
3416 action = 0xdeadbee;
3417 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3418 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3419 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3420 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3422 state = 0xdeadbee;
3423 action = 0xdeadbee;
3424 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3425 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3426 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3427 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3429 state = 0xdeadbee;
3430 action = 0xdeadbee;
3431 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3432 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3433 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3434 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3436 state = 0xdeadbee;
3437 action = 0xdeadbee;
3438 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3439 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3440 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3441 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3443 state = 0xdeadbee;
3444 action = 0xdeadbee;
3445 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3446 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3447 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3448 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3450 state = 0xdeadbee;
3451 action = 0xdeadbee;
3452 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3453 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3454 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3455 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3457 state = 0xdeadbee;
3458 action = 0xdeadbee;
3459 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3460 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3461 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3462 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3464 state = 0xdeadbee;
3465 action = 0xdeadbee;
3466 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3467 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3468 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3469 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3471 state = 0xdeadbee;
3472 action = 0xdeadbee;
3473 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3474 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3475 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3476 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3478 state = 0xdeadbee;
3479 action = 0xdeadbee;
3480 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3481 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3482 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3483 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3485 state = 0xdeadbee;
3486 action = 0xdeadbee;
3487 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3488 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3489 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3490 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3492 state = 0xdeadbee;
3493 action = 0xdeadbee;
3494 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3495 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3496 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3497 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3499 state = 0xdeadbee;
3500 action = 0xdeadbee;
3501 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3502 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3503 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3504 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3506 state = 0xdeadbee;
3507 action = 0xdeadbee;
3508 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3509 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3510 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3511 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3513 state = 0xdeadbee;
3514 action = 0xdeadbee;
3515 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3516 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3517 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3518 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3520 state = 0xdeadbee;
3521 action = 0xdeadbee;
3522 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3523 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3524 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3525 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3527 state = 0xdeadbee;
3528 action = 0xdeadbee;
3529 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3530 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3531 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3532 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3534 state = 0xdeadbee;
3535 action = 0xdeadbee;
3536 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3538 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3539 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3541 state = 0xdeadbee;
3542 action = 0xdeadbee;
3543 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3545 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3546 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3548 state = 0xdeadbee;
3549 action = 0xdeadbee;
3550 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3552 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3553 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3555 state = 0xdeadbee;
3556 action = 0xdeadbee;
3557 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3559 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3560 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3562 state = 0xdeadbee;
3563 action = 0xdeadbee;
3564 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3565 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3566 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3567 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3569 state = 0xdeadbee;
3570 action = 0xdeadbee;
3571 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3573 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3574 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3576 state = 0xdeadbee;
3577 action = 0xdeadbee;
3578 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3580 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3581 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3583 r = MsiDoAction( hpkg, "CostFinalize");
3584 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
3586 state = 0xdeadbee;
3587 action = 0xdeadbee;
3588 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3589 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3590 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3591 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3593 state = 0xdeadbee;
3594 action = 0xdeadbee;
3595 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3596 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3597 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3598 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3600 state = 0xdeadbee;
3601 action = 0xdeadbee;
3602 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3603 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3604 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3605 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3607 state = 0xdeadbee;
3608 action = 0xdeadbee;
3609 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3610 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3611 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3612 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3614 state = 0xdeadbee;
3615 action = 0xdeadbee;
3616 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3617 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3618 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3619 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3621 state = 0xdeadbee;
3622 action = 0xdeadbee;
3623 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3624 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3625 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3626 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3628 state = 0xdeadbee;
3629 action = 0xdeadbee;
3630 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3631 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3632 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3633 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3635 state = 0xdeadbee;
3636 action = 0xdeadbee;
3637 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3638 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3639 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3640 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3642 state = 0xdeadbee;
3643 action = 0xdeadbee;
3644 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3645 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3646 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3647 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3649 state = 0xdeadbee;
3650 action = 0xdeadbee;
3651 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3652 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3653 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3654 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3656 state = 0xdeadbee;
3657 action = 0xdeadbee;
3658 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3659 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3660 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3661 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3663 state = 0xdeadbee;
3664 action = 0xdeadbee;
3665 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3666 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3667 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3668 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3670 state = 0xdeadbee;
3671 action = 0xdeadbee;
3672 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3673 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3674 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3675 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3677 state = 0xdeadbee;
3678 action = 0xdeadbee;
3679 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3680 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3681 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3682 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3684 state = 0xdeadbee;
3685 action = 0xdeadbee;
3686 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3687 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3688 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3689 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3691 state = 0xdeadbee;
3692 action = 0xdeadbee;
3693 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3694 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3695 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3696 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3698 state = 0xdeadbee;
3699 action = 0xdeadbee;
3700 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3701 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3702 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3703 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3705 state = 0xdeadbee;
3706 action = 0xdeadbee;
3707 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3708 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3709 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3710 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
3712 state = 0xdeadbee;
3713 action = 0xdeadbee;
3714 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3715 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3716 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3717 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3719 state = 0xdeadbee;
3720 action = 0xdeadbee;
3721 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3722 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3723 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3724 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
3726 state = 0xdeadbee;
3727 action = 0xdeadbee;
3728 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3729 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3730 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3731 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3733 state = 0xdeadbee;
3734 action = 0xdeadbee;
3735 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3736 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3737 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3738 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3740 state = 0xdeadbee;
3741 action = 0xdeadbee;
3742 r = MsiGetComponentState(hpkg, "mu", &state, &action);
3743 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3744 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3745 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3747 state = 0xdeadbee;
3748 action = 0xdeadbee;
3749 r = MsiGetComponentState(hpkg, "nu", &state, &action);
3750 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3751 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3752 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3754 state = 0xdeadbee;
3755 action = 0xdeadbee;
3756 r = MsiGetComponentState(hpkg, "xi", &state, &action);
3757 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3758 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3759 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3761 state = 0xdeadbee;
3762 action = 0xdeadbee;
3763 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
3764 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3765 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3766 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3768 state = 0xdeadbee;
3769 action = 0xdeadbee;
3770 r = MsiGetComponentState(hpkg, "pi", &state, &action);
3771 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3772 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3773 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3775 state = 0xdeadbee;
3776 action = 0xdeadbee;
3777 r = MsiGetComponentState(hpkg, "rho", &state, &action);
3778 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3779 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3780 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3782 state = 0xdeadbee;
3783 action = 0xdeadbee;
3784 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
3785 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3786 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3787 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3789 state = 0xdeadbee;
3790 action = 0xdeadbee;
3791 r = MsiGetComponentState(hpkg, "tau", &state, &action);
3792 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3793 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3794 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3796 state = 0xdeadbee;
3797 action = 0xdeadbee;
3798 r = MsiGetComponentState(hpkg, "phi", &state, &action);
3799 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3800 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3801 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3803 state = 0xdeadbee;
3804 action = 0xdeadbee;
3805 r = MsiGetComponentState(hpkg, "chi", &state, &action);
3806 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3807 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3808 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3810 state = 0xdeadbee;
3811 action = 0xdeadbee;
3812 r = MsiGetComponentState(hpkg, "psi", &state, &action);
3813 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
3814 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
3815 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
3817 MsiCloseHandle( hpkg );
3819 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3821 /* publish the features and components */
3822 r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
3823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3825 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
3826 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
3828 /* these properties must not be in the saved msi file */
3829 r = add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
3830 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3832 r = add_property_entry( hdb, "'ADDSOURCE', 'two,three'");
3833 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3835 r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
3836 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3838 r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
3839 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
3841 r = package_from_db( hdb, &hpkg );
3842 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
3844 MsiCloseHandle(hdb);
3846 state = 0xdeadbee;
3847 action = 0xdeadbee;
3848 r = MsiGetFeatureState(hpkg, "one", &state, &action);
3849 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3850 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3851 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3853 state = 0xdeadbee;
3854 action = 0xdeadbee;
3855 r = MsiGetFeatureState(hpkg, "two", &state, &action);
3856 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3857 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3858 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3860 state = 0xdeadbee;
3861 action = 0xdeadbee;
3862 r = MsiGetFeatureState(hpkg, "three", &state, &action);
3863 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3864 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3865 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3867 state = 0xdeadbee;
3868 action = 0xdeadbee;
3869 r = MsiGetFeatureState(hpkg, "four", &state, &action);
3870 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3871 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3872 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3874 state = 0xdeadbee;
3875 action = 0xdeadbee;
3876 r = MsiGetFeatureState(hpkg, "five", &state, &action);
3877 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3878 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3879 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3881 state = 0xdeadbee;
3882 action = 0xdeadbee;
3883 r = MsiGetFeatureState(hpkg, "six", &state, &action);
3884 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3885 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3886 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3888 state = 0xdeadbee;
3889 action = 0xdeadbee;
3890 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
3891 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3892 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3893 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3895 state = 0xdeadbee;
3896 action = 0xdeadbee;
3897 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
3898 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3899 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3900 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3902 state = 0xdeadbee;
3903 action = 0xdeadbee;
3904 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
3905 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3906 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3907 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3909 state = 0xdeadbee;
3910 action = 0xdeadbee;
3911 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
3912 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3913 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3914 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3916 state = 0xdeadbee;
3917 action = 0xdeadbee;
3918 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
3919 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
3920 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3921 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3923 state = 0xdeadbee;
3924 action = 0xdeadbee;
3925 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
3926 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3927 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3928 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3930 state = 0xdeadbee;
3931 action = 0xdeadbee;
3932 r = MsiGetComponentState(hpkg, "beta", &state, &action);
3933 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3934 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3935 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3937 state = 0xdeadbee;
3938 action = 0xdeadbee;
3939 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
3940 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3941 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3942 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3944 state = 0xdeadbee;
3945 action = 0xdeadbee;
3946 r = MsiGetComponentState(hpkg, "theta", &state, &action);
3947 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3948 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3949 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3951 state = 0xdeadbee;
3952 action = 0xdeadbee;
3953 r = MsiGetComponentState(hpkg, "delta", &state, &action);
3954 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3955 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3956 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3958 state = 0xdeadbee;
3959 action = 0xdeadbee;
3960 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
3961 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3962 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3963 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3965 state = 0xdeadbee;
3966 action = 0xdeadbee;
3967 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
3968 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3969 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3970 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3972 state = 0xdeadbee;
3973 action = 0xdeadbee;
3974 r = MsiGetComponentState(hpkg, "iota", &state, &action);
3975 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3976 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3977 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3979 state = 0xdeadbee;
3980 action = 0xdeadbee;
3981 r = MsiGetComponentState(hpkg, "eta", &state, &action);
3982 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3983 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3984 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3986 state = 0xdeadbee;
3987 action = 0xdeadbee;
3988 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
3989 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3990 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3991 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
3993 state = 0xdeadbee;
3994 action = 0xdeadbee;
3995 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
3996 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
3997 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
3998 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4000 state = 0xdeadbee;
4001 action = 0xdeadbee;
4002 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4003 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4004 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4005 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4007 state = 0xdeadbee;
4008 action = 0xdeadbee;
4009 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4010 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4011 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4012 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4014 state = 0xdeadbee;
4015 action = 0xdeadbee;
4016 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4017 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4018 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4019 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4021 state = 0xdeadbee;
4022 action = 0xdeadbee;
4023 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4024 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4025 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4026 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4028 state = 0xdeadbee;
4029 action = 0xdeadbee;
4030 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4031 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4032 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4033 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4035 state = 0xdeadbee;
4036 action = 0xdeadbee;
4037 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4038 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4039 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4040 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4042 state = 0xdeadbee;
4043 action = 0xdeadbee;
4044 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4045 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4046 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4047 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4049 state = 0xdeadbee;
4050 action = 0xdeadbee;
4051 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4052 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4053 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4054 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4056 state = 0xdeadbee;
4057 action = 0xdeadbee;
4058 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4059 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4060 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4061 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4063 state = 0xdeadbee;
4064 action = 0xdeadbee;
4065 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4066 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4067 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4068 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4070 state = 0xdeadbee;
4071 action = 0xdeadbee;
4072 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4073 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4074 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4075 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4077 r = MsiDoAction( hpkg, "CostInitialize");
4078 ok( r == ERROR_SUCCESS, "cost init failed\n");
4080 state = 0xdeadbee;
4081 action = 0xdeadbee;
4082 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4083 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4084 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4085 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4087 state = 0xdeadbee;
4088 action = 0xdeadbee;
4089 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4090 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4091 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4092 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4094 state = 0xdeadbee;
4095 action = 0xdeadbee;
4096 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4097 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4098 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4099 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4101 state = 0xdeadbee;
4102 action = 0xdeadbee;
4103 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4104 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4105 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4106 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4108 state = 0xdeadbee;
4109 action = 0xdeadbee;
4110 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4111 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4112 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4113 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4115 state = 0xdeadbee;
4116 action = 0xdeadbee;
4117 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4118 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4119 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4120 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4122 state = 0xdeadbee;
4123 action = 0xdeadbee;
4124 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4125 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4126 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4127 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4129 state = 0xdeadbee;
4130 action = 0xdeadbee;
4131 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4132 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4133 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4134 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4136 state = 0xdeadbee;
4137 action = 0xdeadbee;
4138 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4139 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4140 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4141 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4143 state = 0xdeadbee;
4144 action = 0xdeadbee;
4145 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4146 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4147 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4148 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4150 state = 0xdeadbee;
4151 action = 0xdeadbee;
4152 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4153 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4154 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4155 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4157 state = 0xdeadbee;
4158 action = 0xdeadbee;
4159 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4160 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4161 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4162 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4164 state = 0xdeadbee;
4165 action = 0xdeadbee;
4166 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4167 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4168 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4169 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4171 state = 0xdeadbee;
4172 action = 0xdeadbee;
4173 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4174 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4175 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4176 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4178 state = 0xdeadbee;
4179 action = 0xdeadbee;
4180 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4181 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4182 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4183 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4185 state = 0xdeadbee;
4186 action = 0xdeadbee;
4187 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4188 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4189 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4190 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4192 state = 0xdeadbee;
4193 action = 0xdeadbee;
4194 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4195 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4196 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4197 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4199 state = 0xdeadbee;
4200 action = 0xdeadbee;
4201 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4202 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4203 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4204 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4206 state = 0xdeadbee;
4207 action = 0xdeadbee;
4208 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4213 state = 0xdeadbee;
4214 action = 0xdeadbee;
4215 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4220 state = 0xdeadbee;
4221 action = 0xdeadbee;
4222 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4227 state = 0xdeadbee;
4228 action = 0xdeadbee;
4229 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4234 state = 0xdeadbee;
4235 action = 0xdeadbee;
4236 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4241 state = 0xdeadbee;
4242 action = 0xdeadbee;
4243 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4248 state = 0xdeadbee;
4249 action = 0xdeadbee;
4250 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4255 state = 0xdeadbee;
4256 action = 0xdeadbee;
4257 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4262 state = 0xdeadbee;
4263 action = 0xdeadbee;
4264 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4269 state = 0xdeadbee;
4270 action = 0xdeadbee;
4271 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4276 state = 0xdeadbee;
4277 action = 0xdeadbee;
4278 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4283 state = 0xdeadbee;
4284 action = 0xdeadbee;
4285 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4287 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4288 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4290 state = 0xdeadbee;
4291 action = 0xdeadbee;
4292 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4293 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4294 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4295 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4297 state = 0xdeadbee;
4298 action = 0xdeadbee;
4299 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4300 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4301 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4302 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4304 state = 0xdeadbee;
4305 action = 0xdeadbee;
4306 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4307 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4308 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4309 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4311 r = MsiDoAction( hpkg, "FileCost");
4312 ok( r == ERROR_SUCCESS, "file cost failed\n");
4314 state = 0xdeadbee;
4315 action = 0xdeadbee;
4316 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4317 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4318 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4319 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4321 state = 0xdeadbee;
4322 action = 0xdeadbee;
4323 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4324 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4325 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4326 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4328 state = 0xdeadbee;
4329 action = 0xdeadbee;
4330 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4331 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4332 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4333 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4335 state = 0xdeadbee;
4336 action = 0xdeadbee;
4337 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4338 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4339 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4340 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4342 state = 0xdeadbee;
4343 action = 0xdeadbee;
4344 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4345 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4346 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4347 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4349 state = 0xdeadbee;
4350 action = 0xdeadbee;
4351 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4352 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4353 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4354 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4356 state = 0xdeadbee;
4357 action = 0xdeadbee;
4358 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4359 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4360 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4361 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4363 state = 0xdeadbee;
4364 action = 0xdeadbee;
4365 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4366 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4367 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4368 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4370 state = 0xdeadbee;
4371 action = 0xdeadbee;
4372 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4373 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4374 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4375 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4377 state = 0xdeadbee;
4378 action = 0xdeadbee;
4379 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4380 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4381 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4382 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4384 state = 0xdeadbee;
4385 action = 0xdeadbee;
4386 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4387 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4388 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4389 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4391 state = 0xdeadbee;
4392 action = 0xdeadbee;
4393 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4394 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4395 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4396 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4398 state = 0xdeadbee;
4399 action = 0xdeadbee;
4400 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4401 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4402 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4403 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4405 state = 0xdeadbee;
4406 action = 0xdeadbee;
4407 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4408 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4409 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4410 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4412 state = 0xdeadbee;
4413 action = 0xdeadbee;
4414 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4415 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4416 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4417 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4419 state = 0xdeadbee;
4420 action = 0xdeadbee;
4421 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4422 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4423 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4424 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4426 state = 0xdeadbee;
4427 action = 0xdeadbee;
4428 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4429 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4430 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4431 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4433 state = 0xdeadbee;
4434 action = 0xdeadbee;
4435 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4436 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4437 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4438 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4440 state = 0xdeadbee;
4441 action = 0xdeadbee;
4442 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4444 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4445 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4447 state = 0xdeadbee;
4448 action = 0xdeadbee;
4449 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4451 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4452 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4454 state = 0xdeadbee;
4455 action = 0xdeadbee;
4456 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4458 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4459 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4461 state = 0xdeadbee;
4462 action = 0xdeadbee;
4463 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4465 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4466 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4468 state = 0xdeadbee;
4469 action = 0xdeadbee;
4470 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4472 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4473 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4475 state = 0xdeadbee;
4476 action = 0xdeadbee;
4477 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4479 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4480 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4482 state = 0xdeadbee;
4483 action = 0xdeadbee;
4484 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4486 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4487 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4489 state = 0xdeadbee;
4490 action = 0xdeadbee;
4491 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4493 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4494 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4496 state = 0xdeadbee;
4497 action = 0xdeadbee;
4498 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4500 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4501 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4503 state = 0xdeadbee;
4504 action = 0xdeadbee;
4505 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4507 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4508 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4510 state = 0xdeadbee;
4511 action = 0xdeadbee;
4512 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4514 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4515 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4517 state = 0xdeadbee;
4518 action = 0xdeadbee;
4519 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4520 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4521 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4522 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4524 state = 0xdeadbee;
4525 action = 0xdeadbee;
4526 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4527 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4528 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4529 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4531 r = MsiDoAction( hpkg, "CostFinalize");
4532 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
4534 state = 0xdeadbee;
4535 action = 0xdeadbee;
4536 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4537 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4538 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4539 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4541 state = 0xdeadbee;
4542 action = 0xdeadbee;
4543 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4544 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4545 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4546 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4548 state = 0xdeadbee;
4549 action = 0xdeadbee;
4550 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4551 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4552 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4553 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4555 state = 0xdeadbee;
4556 action = 0xdeadbee;
4557 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4558 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4559 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4560 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4562 state = 0xdeadbee;
4563 action = 0xdeadbee;
4564 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4565 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4566 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4567 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4569 state = 0xdeadbee;
4570 action = 0xdeadbee;
4571 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4572 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4573 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4574 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4576 state = 0xdeadbee;
4577 action = 0xdeadbee;
4578 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4579 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4580 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4581 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4583 state = 0xdeadbee;
4584 action = 0xdeadbee;
4585 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4586 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4587 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4588 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4590 state = 0xdeadbee;
4591 action = 0xdeadbee;
4592 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4593 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4594 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4595 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4597 state = 0xdeadbee;
4598 action = 0xdeadbee;
4599 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4600 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4601 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4602 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4604 state = 0xdeadbee;
4605 action = 0xdeadbee;
4606 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4607 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4608 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4609 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4611 state = 0xdeadbee;
4612 action = 0xdeadbee;
4613 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4614 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4615 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4616 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4618 state = 0xdeadbee;
4619 action = 0xdeadbee;
4620 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4621 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4622 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4623 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
4625 state = 0xdeadbee;
4626 action = 0xdeadbee;
4627 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4628 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4629 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4630 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4632 state = 0xdeadbee;
4633 action = 0xdeadbee;
4634 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4635 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4636 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4637 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4639 state = 0xdeadbee;
4640 action = 0xdeadbee;
4641 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4642 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4643 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4644 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4646 state = 0xdeadbee;
4647 action = 0xdeadbee;
4648 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4649 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4650 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4651 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4653 state = 0xdeadbee;
4654 action = 0xdeadbee;
4655 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4657 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
4658 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4660 state = 0xdeadbee;
4661 action = 0xdeadbee;
4662 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4663 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4664 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4665 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4667 state = 0xdeadbee;
4668 action = 0xdeadbee;
4669 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4670 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4671 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4672 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
4674 state = 0xdeadbee;
4675 action = 0xdeadbee;
4676 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4677 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4678 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4679 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4681 state = 0xdeadbee;
4682 action = 0xdeadbee;
4683 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4684 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4685 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4686 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4688 state = 0xdeadbee;
4689 action = 0xdeadbee;
4690 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4691 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4692 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4693 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4695 state = 0xdeadbee;
4696 action = 0xdeadbee;
4697 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4698 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4699 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4700 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4702 state = 0xdeadbee;
4703 action = 0xdeadbee;
4704 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4705 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4706 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4707 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4709 state = 0xdeadbee;
4710 action = 0xdeadbee;
4711 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4712 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4713 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4714 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4716 state = 0xdeadbee;
4717 action = 0xdeadbee;
4718 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4719 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4720 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4721 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4723 state = 0xdeadbee;
4724 action = 0xdeadbee;
4725 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4726 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4727 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4728 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4730 state = 0xdeadbee;
4731 action = 0xdeadbee;
4732 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4733 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4734 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4735 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4737 state = 0xdeadbee;
4738 action = 0xdeadbee;
4739 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4740 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4741 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4742 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4744 state = 0xdeadbee;
4745 action = 0xdeadbee;
4746 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4747 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4748 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4749 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4751 state = 0xdeadbee;
4752 action = 0xdeadbee;
4753 r = MsiGetComponentState(hpkg, "chi", &state, &action);
4754 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4755 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4756 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4758 state = 0xdeadbee;
4759 action = 0xdeadbee;
4760 r = MsiGetComponentState(hpkg, "psi", &state, &action);
4761 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
4762 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
4763 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4765 MsiCloseHandle(hpkg);
4767 /* uninstall the product */
4768 r = MsiInstallProduct(msifile, "REMOVE=ALL");
4769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4771 /* all features installed locally */
4772 r = MsiInstallProduct(msifile2, "ADDLOCAL=ALL");
4773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4775 r = MsiOpenDatabase(msifile2, MSIDBOPEN_DIRECT, &hdb);
4776 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
4778 /* these properties must not be in the saved msi file */
4779 r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
4780 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
4782 r = package_from_db( hdb, &hpkg );
4783 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
4785 state = 0xdeadbee;
4786 action = 0xdeadbee;
4787 r = MsiGetFeatureState(hpkg, "one", &state, &action);
4788 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4789 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4790 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4792 state = 0xdeadbee;
4793 action = 0xdeadbee;
4794 r = MsiGetFeatureState(hpkg, "two", &state, &action);
4795 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4796 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4797 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4799 state = 0xdeadbee;
4800 action = 0xdeadbee;
4801 r = MsiGetFeatureState(hpkg, "three", &state, &action);
4802 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4803 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4804 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4806 state = 0xdeadbee;
4807 action = 0xdeadbee;
4808 r = MsiGetFeatureState(hpkg, "four", &state, &action);
4809 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4810 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4811 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4813 state = 0xdeadbee;
4814 action = 0xdeadbee;
4815 r = MsiGetFeatureState(hpkg, "five", &state, &action);
4816 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4817 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4818 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4820 state = 0xdeadbee;
4821 action = 0xdeadbee;
4822 r = MsiGetFeatureState(hpkg, "six", &state, &action);
4823 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4824 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4825 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4827 state = 0xdeadbee;
4828 action = 0xdeadbee;
4829 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
4830 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4831 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4832 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4834 state = 0xdeadbee;
4835 action = 0xdeadbee;
4836 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
4837 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4838 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4839 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4841 state = 0xdeadbee;
4842 action = 0xdeadbee;
4843 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
4844 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4845 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4846 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4848 state = 0xdeadbee;
4849 action = 0xdeadbee;
4850 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
4851 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4855 state = 0xdeadbee;
4856 action = 0xdeadbee;
4857 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
4858 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
4859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4862 state = 0xdeadbee;
4863 action = 0xdeadbee;
4864 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
4865 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4869 state = 0xdeadbee;
4870 action = 0xdeadbee;
4871 r = MsiGetComponentState(hpkg, "beta", &state, &action);
4872 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4876 state = 0xdeadbee;
4877 action = 0xdeadbee;
4878 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
4879 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4883 state = 0xdeadbee;
4884 action = 0xdeadbee;
4885 r = MsiGetComponentState(hpkg, "theta", &state, &action);
4886 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4890 state = 0xdeadbee;
4891 action = 0xdeadbee;
4892 r = MsiGetComponentState(hpkg, "delta", &state, &action);
4893 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4897 state = 0xdeadbee;
4898 action = 0xdeadbee;
4899 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
4900 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4904 state = 0xdeadbee;
4905 action = 0xdeadbee;
4906 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
4907 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4911 state = 0xdeadbee;
4912 action = 0xdeadbee;
4913 r = MsiGetComponentState(hpkg, "iota", &state, &action);
4914 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4918 state = 0xdeadbee;
4919 action = 0xdeadbee;
4920 r = MsiGetComponentState(hpkg, "eta", &state, &action);
4921 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4922 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4923 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4925 state = 0xdeadbee;
4926 action = 0xdeadbee;
4927 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
4928 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4929 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4930 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4932 state = 0xdeadbee;
4933 action = 0xdeadbee;
4934 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
4935 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4936 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4937 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4939 state = 0xdeadbee;
4940 action = 0xdeadbee;
4941 r = MsiGetComponentState(hpkg, "mu", &state, &action);
4942 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4943 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4944 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4946 state = 0xdeadbee;
4947 action = 0xdeadbee;
4948 r = MsiGetComponentState(hpkg, "nu", &state, &action);
4949 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4950 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4951 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4953 state = 0xdeadbee;
4954 action = 0xdeadbee;
4955 r = MsiGetComponentState(hpkg, "xi", &state, &action);
4956 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4957 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4958 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4960 state = 0xdeadbee;
4961 action = 0xdeadbee;
4962 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
4963 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4964 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4965 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4967 state = 0xdeadbee;
4968 action = 0xdeadbee;
4969 r = MsiGetComponentState(hpkg, "pi", &state, &action);
4970 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4971 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4972 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4974 state = 0xdeadbee;
4975 action = 0xdeadbee;
4976 r = MsiGetComponentState(hpkg, "rho", &state, &action);
4977 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4978 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4979 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4981 state = 0xdeadbee;
4982 action = 0xdeadbee;
4983 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
4984 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4985 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4986 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4988 state = 0xdeadbee;
4989 action = 0xdeadbee;
4990 r = MsiGetComponentState(hpkg, "tau", &state, &action);
4991 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4992 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
4993 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
4995 state = 0xdeadbee;
4996 action = 0xdeadbee;
4997 r = MsiGetComponentState(hpkg, "phi", &state, &action);
4998 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
4999 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5000 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5002 state = 0xdeadbee;
5003 action = 0xdeadbee;
5004 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5005 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5006 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5007 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5009 state = 0xdeadbee;
5010 action = 0xdeadbee;
5011 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5012 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5013 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5014 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5016 r = MsiDoAction( hpkg, "CostInitialize");
5017 ok( r == ERROR_SUCCESS, "cost init failed\n");
5019 state = 0xdeadbee;
5020 action = 0xdeadbee;
5021 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5026 state = 0xdeadbee;
5027 action = 0xdeadbee;
5028 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5033 state = 0xdeadbee;
5034 action = 0xdeadbee;
5035 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5040 state = 0xdeadbee;
5041 action = 0xdeadbee;
5042 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5047 state = 0xdeadbee;
5048 action = 0xdeadbee;
5049 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5054 state = 0xdeadbee;
5055 action = 0xdeadbee;
5056 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5061 state = 0xdeadbee;
5062 action = 0xdeadbee;
5063 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5068 state = 0xdeadbee;
5069 action = 0xdeadbee;
5070 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5075 state = 0xdeadbee;
5076 action = 0xdeadbee;
5077 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5082 state = 0xdeadbee;
5083 action = 0xdeadbee;
5084 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5089 state = 0xdeadbee;
5090 action = 0xdeadbee;
5091 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5096 state = 0xdeadbee;
5097 action = 0xdeadbee;
5098 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5103 state = 0xdeadbee;
5104 action = 0xdeadbee;
5105 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5110 state = 0xdeadbee;
5111 action = 0xdeadbee;
5112 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5117 state = 0xdeadbee;
5118 action = 0xdeadbee;
5119 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5124 state = 0xdeadbee;
5125 action = 0xdeadbee;
5126 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5131 state = 0xdeadbee;
5132 action = 0xdeadbee;
5133 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5138 state = 0xdeadbee;
5139 action = 0xdeadbee;
5140 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5145 state = 0xdeadbee;
5146 action = 0xdeadbee;
5147 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5152 state = 0xdeadbee;
5153 action = 0xdeadbee;
5154 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5155 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5156 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5157 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5159 state = 0xdeadbee;
5160 action = 0xdeadbee;
5161 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5162 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5163 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5164 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5166 state = 0xdeadbee;
5167 action = 0xdeadbee;
5168 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5169 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5170 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5171 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5173 state = 0xdeadbee;
5174 action = 0xdeadbee;
5175 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5176 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5177 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5178 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5180 state = 0xdeadbee;
5181 action = 0xdeadbee;
5182 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5183 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5184 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5185 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5187 state = 0xdeadbee;
5188 action = 0xdeadbee;
5189 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5190 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5191 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5192 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5194 state = 0xdeadbee;
5195 action = 0xdeadbee;
5196 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5197 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5198 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5199 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5201 state = 0xdeadbee;
5202 action = 0xdeadbee;
5203 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5204 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5205 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5206 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5208 state = 0xdeadbee;
5209 action = 0xdeadbee;
5210 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5211 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5212 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5213 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5215 state = 0xdeadbee;
5216 action = 0xdeadbee;
5217 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5218 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5219 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5220 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5222 state = 0xdeadbee;
5223 action = 0xdeadbee;
5224 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5225 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5226 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5227 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5229 state = 0xdeadbee;
5230 action = 0xdeadbee;
5231 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5232 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5233 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5234 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5236 state = 0xdeadbee;
5237 action = 0xdeadbee;
5238 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5239 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5240 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5241 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5243 state = 0xdeadbee;
5244 action = 0xdeadbee;
5245 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5246 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5247 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5248 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5250 r = MsiDoAction( hpkg, "FileCost");
5251 ok( r == ERROR_SUCCESS, "file cost failed\n");
5253 state = 0xdeadbee;
5254 action = 0xdeadbee;
5255 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5260 state = 0xdeadbee;
5261 action = 0xdeadbee;
5262 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5267 state = 0xdeadbee;
5268 action = 0xdeadbee;
5269 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5274 state = 0xdeadbee;
5275 action = 0xdeadbee;
5276 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5281 state = 0xdeadbee;
5282 action = 0xdeadbee;
5283 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5288 state = 0xdeadbee;
5289 action = 0xdeadbee;
5290 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5295 state = 0xdeadbee;
5296 action = 0xdeadbee;
5297 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5302 state = 0xdeadbee;
5303 action = 0xdeadbee;
5304 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5309 state = 0xdeadbee;
5310 action = 0xdeadbee;
5311 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5316 state = 0xdeadbee;
5317 action = 0xdeadbee;
5318 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5323 state = 0xdeadbee;
5324 action = 0xdeadbee;
5325 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5330 state = 0xdeadbee;
5331 action = 0xdeadbee;
5332 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5337 state = 0xdeadbee;
5338 action = 0xdeadbee;
5339 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5344 state = 0xdeadbee;
5345 action = 0xdeadbee;
5346 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5351 state = 0xdeadbee;
5352 action = 0xdeadbee;
5353 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5358 state = 0xdeadbee;
5359 action = 0xdeadbee;
5360 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5362 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5365 state = 0xdeadbee;
5366 action = 0xdeadbee;
5367 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5372 state = 0xdeadbee;
5373 action = 0xdeadbee;
5374 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5376 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5379 state = 0xdeadbee;
5380 action = 0xdeadbee;
5381 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5383 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5386 state = 0xdeadbee;
5387 action = 0xdeadbee;
5388 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5389 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5390 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5391 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5393 state = 0xdeadbee;
5394 action = 0xdeadbee;
5395 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5396 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5397 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5398 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5400 state = 0xdeadbee;
5401 action = 0xdeadbee;
5402 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5403 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5404 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5405 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5407 state = 0xdeadbee;
5408 action = 0xdeadbee;
5409 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5410 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5411 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5412 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5414 state = 0xdeadbee;
5415 action = 0xdeadbee;
5416 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5417 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5418 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5419 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5421 state = 0xdeadbee;
5422 action = 0xdeadbee;
5423 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5424 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5425 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5426 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5428 state = 0xdeadbee;
5429 action = 0xdeadbee;
5430 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5431 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5432 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5433 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5435 state = 0xdeadbee;
5436 action = 0xdeadbee;
5437 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5438 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5439 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5440 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5442 state = 0xdeadbee;
5443 action = 0xdeadbee;
5444 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5445 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5446 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5447 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5449 state = 0xdeadbee;
5450 action = 0xdeadbee;
5451 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5452 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5453 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5454 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5456 state = 0xdeadbee;
5457 action = 0xdeadbee;
5458 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5459 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5460 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5461 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5463 state = 0xdeadbee;
5464 action = 0xdeadbee;
5465 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5466 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5467 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5468 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5470 state = 0xdeadbee;
5471 action = 0xdeadbee;
5472 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5473 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5474 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5475 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5477 state = 0xdeadbee;
5478 action = 0xdeadbee;
5479 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5480 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5481 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5482 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5484 r = MsiDoAction( hpkg, "CostFinalize");
5485 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
5487 state = 0xdeadbee;
5488 action = 0xdeadbee;
5489 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5491 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5492 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5494 state = 0xdeadbee;
5495 action = 0xdeadbee;
5496 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5498 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5499 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5501 state = 0xdeadbee;
5502 action = 0xdeadbee;
5503 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5505 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5506 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5508 state = 0xdeadbee;
5509 action = 0xdeadbee;
5510 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5512 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5513 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5515 state = 0xdeadbee;
5516 action = 0xdeadbee;
5517 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5519 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5520 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5522 state = 0xdeadbee;
5523 action = 0xdeadbee;
5524 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5526 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5527 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5529 state = 0xdeadbee;
5530 action = 0xdeadbee;
5531 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5533 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5534 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5536 state = 0xdeadbee;
5537 action = 0xdeadbee;
5538 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5540 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5541 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5543 state = 0xdeadbee;
5544 action = 0xdeadbee;
5545 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5547 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5548 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5550 state = 0xdeadbee;
5551 action = 0xdeadbee;
5552 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5554 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5555 todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5557 state = 0xdeadbee;
5558 action = 0xdeadbee;
5559 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5561 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5562 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5564 state = 0xdeadbee;
5565 action = 0xdeadbee;
5566 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5568 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5569 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5571 state = 0xdeadbee;
5572 action = 0xdeadbee;
5573 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5575 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5576 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5578 state = 0xdeadbee;
5579 action = 0xdeadbee;
5580 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5582 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5583 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5585 state = 0xdeadbee;
5586 action = 0xdeadbee;
5587 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5589 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5590 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5592 state = 0xdeadbee;
5593 action = 0xdeadbee;
5594 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5596 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5597 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5599 state = 0xdeadbee;
5600 action = 0xdeadbee;
5601 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5603 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5604 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5606 state = 0xdeadbee;
5607 action = 0xdeadbee;
5608 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5610 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5611 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5613 state = 0xdeadbee;
5614 action = 0xdeadbee;
5615 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5617 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5618 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5620 state = 0xdeadbee;
5621 action = 0xdeadbee;
5622 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5623 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5624 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5625 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5627 state = 0xdeadbee;
5628 action = 0xdeadbee;
5629 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5630 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5631 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
5632 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5634 state = 0xdeadbee;
5635 action = 0xdeadbee;
5636 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5637 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5638 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5639 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5641 state = 0xdeadbee;
5642 action = 0xdeadbee;
5643 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5644 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5645 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5646 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5648 state = 0xdeadbee;
5649 action = 0xdeadbee;
5650 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5652 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5653 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5655 state = 0xdeadbee;
5656 action = 0xdeadbee;
5657 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5658 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5659 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5660 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5662 state = 0xdeadbee;
5663 action = 0xdeadbee;
5664 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5666 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5667 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5669 state = 0xdeadbee;
5670 action = 0xdeadbee;
5671 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5673 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5674 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
5676 state = 0xdeadbee;
5677 action = 0xdeadbee;
5678 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5680 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5681 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5683 state = 0xdeadbee;
5684 action = 0xdeadbee;
5685 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5687 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
5688 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
5690 state = 0xdeadbee;
5691 action = 0xdeadbee;
5692 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5694 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5695 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5697 state = 0xdeadbee;
5698 action = 0xdeadbee;
5699 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5701 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5702 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5704 state = 0xdeadbee;
5705 action = 0xdeadbee;
5706 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5708 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5709 todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5711 state = 0xdeadbee;
5712 action = 0xdeadbee;
5713 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5715 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
5716 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5718 MsiCloseHandle(hpkg);
5720 /* uninstall the product */
5721 r = MsiInstallProduct(msifile2, "REMOVE=ALL");
5722 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5724 /* all features installed from source */
5725 r = MsiInstallProduct(msifile3, "ADDSOURCE=ALL");
5726 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5728 r = MsiOpenDatabase(msifile3, MSIDBOPEN_DIRECT, &hdb);
5729 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
5731 /* this property must not be in the saved msi file */
5732 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
5733 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
5735 r = package_from_db( hdb, &hpkg );
5736 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
5738 state = 0xdeadbee;
5739 action = 0xdeadbee;
5740 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5741 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5742 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5743 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5745 state = 0xdeadbee;
5746 action = 0xdeadbee;
5747 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5748 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5749 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5750 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5752 state = 0xdeadbee;
5753 action = 0xdeadbee;
5754 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5755 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5756 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5757 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5759 state = 0xdeadbee;
5760 action = 0xdeadbee;
5761 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5762 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5763 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5764 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5766 state = 0xdeadbee;
5767 action = 0xdeadbee;
5768 r = MsiGetFeatureState(hpkg, "five", &state, &action);
5769 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5770 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5771 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5773 state = 0xdeadbee;
5774 action = 0xdeadbee;
5775 r = MsiGetFeatureState(hpkg, "six", &state, &action);
5776 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5777 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5778 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5780 state = 0xdeadbee;
5781 action = 0xdeadbee;
5782 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
5783 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5784 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5785 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5787 state = 0xdeadbee;
5788 action = 0xdeadbee;
5789 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
5790 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5791 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5792 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5794 state = 0xdeadbee;
5795 action = 0xdeadbee;
5796 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
5797 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5798 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5799 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5801 state = 0xdeadbee;
5802 action = 0xdeadbee;
5803 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
5804 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5805 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5806 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5808 state = 0xdeadbee;
5809 action = 0xdeadbee;
5810 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
5811 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
5812 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5813 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5815 state = 0xdeadbee;
5816 action = 0xdeadbee;
5817 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
5818 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5819 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5820 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5822 state = 0xdeadbee;
5823 action = 0xdeadbee;
5824 r = MsiGetComponentState(hpkg, "beta", &state, &action);
5825 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5826 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5827 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5829 state = 0xdeadbee;
5830 action = 0xdeadbee;
5831 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
5832 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5833 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5834 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5836 state = 0xdeadbee;
5837 action = 0xdeadbee;
5838 r = MsiGetComponentState(hpkg, "theta", &state, &action);
5839 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5840 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5841 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5843 state = 0xdeadbee;
5844 action = 0xdeadbee;
5845 r = MsiGetComponentState(hpkg, "delta", &state, &action);
5846 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5847 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5848 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5850 state = 0xdeadbee;
5851 action = 0xdeadbee;
5852 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
5853 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5854 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5855 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5857 state = 0xdeadbee;
5858 action = 0xdeadbee;
5859 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
5860 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5861 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5862 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5864 state = 0xdeadbee;
5865 action = 0xdeadbee;
5866 r = MsiGetComponentState(hpkg, "iota", &state, &action);
5867 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5868 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5869 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5871 state = 0xdeadbee;
5872 action = 0xdeadbee;
5873 r = MsiGetComponentState(hpkg, "eta", &state, &action);
5874 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5875 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5876 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5878 state = 0xdeadbee;
5879 action = 0xdeadbee;
5880 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
5881 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5882 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5883 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5885 state = 0xdeadbee;
5886 action = 0xdeadbee;
5887 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
5888 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5889 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5890 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5892 state = 0xdeadbee;
5893 action = 0xdeadbee;
5894 r = MsiGetComponentState(hpkg, "mu", &state, &action);
5895 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5896 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5897 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5899 state = 0xdeadbee;
5900 action = 0xdeadbee;
5901 r = MsiGetComponentState(hpkg, "nu", &state, &action);
5902 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5903 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5904 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5906 state = 0xdeadbee;
5907 action = 0xdeadbee;
5908 r = MsiGetComponentState(hpkg, "xi", &state, &action);
5909 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5910 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5911 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5913 state = 0xdeadbee;
5914 action = 0xdeadbee;
5915 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
5916 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5917 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5918 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5920 state = 0xdeadbee;
5921 action = 0xdeadbee;
5922 r = MsiGetComponentState(hpkg, "pi", &state, &action);
5923 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5924 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5925 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5927 state = 0xdeadbee;
5928 action = 0xdeadbee;
5929 r = MsiGetComponentState(hpkg, "rho", &state, &action);
5930 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5931 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5932 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5934 state = 0xdeadbee;
5935 action = 0xdeadbee;
5936 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
5937 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5938 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5939 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5941 state = 0xdeadbee;
5942 action = 0xdeadbee;
5943 r = MsiGetComponentState(hpkg, "tau", &state, &action);
5944 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5945 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5946 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5948 state = 0xdeadbee;
5949 action = 0xdeadbee;
5950 r = MsiGetComponentState(hpkg, "phi", &state, &action);
5951 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5952 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5953 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5955 state = 0xdeadbee;
5956 action = 0xdeadbee;
5957 r = MsiGetComponentState(hpkg, "chi", &state, &action);
5958 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5959 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5960 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5962 state = 0xdeadbee;
5963 action = 0xdeadbee;
5964 r = MsiGetComponentState(hpkg, "psi", &state, &action);
5965 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
5966 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
5967 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
5969 r = MsiDoAction( hpkg, "CostInitialize");
5970 ok( r == ERROR_SUCCESS, "cost init failed\n");
5972 state = 0xdeadbee;
5973 action = 0xdeadbee;
5974 r = MsiGetFeatureState(hpkg, "one", &state, &action);
5975 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5976 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5977 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5979 state = 0xdeadbee;
5980 action = 0xdeadbee;
5981 r = MsiGetFeatureState(hpkg, "two", &state, &action);
5982 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5983 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5984 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5986 state = 0xdeadbee;
5987 action = 0xdeadbee;
5988 r = MsiGetFeatureState(hpkg, "three", &state, &action);
5989 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5990 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5991 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
5993 state = 0xdeadbee;
5994 action = 0xdeadbee;
5995 r = MsiGetFeatureState(hpkg, "four", &state, &action);
5996 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
5997 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
5998 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6000 state = 0xdeadbee;
6001 action = 0xdeadbee;
6002 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6003 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6004 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6005 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6007 state = 0xdeadbee;
6008 action = 0xdeadbee;
6009 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6010 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6011 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6012 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6014 state = 0xdeadbee;
6015 action = 0xdeadbee;
6016 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6017 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6018 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6019 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6021 state = 0xdeadbee;
6022 action = 0xdeadbee;
6023 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6024 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6025 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6026 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6028 state = 0xdeadbee;
6029 action = 0xdeadbee;
6030 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6031 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6032 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6033 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6035 state = 0xdeadbee;
6036 action = 0xdeadbee;
6037 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6038 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6039 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6040 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6042 state = 0xdeadbee;
6043 action = 0xdeadbee;
6044 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6045 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6046 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6047 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6049 state = 0xdeadbee;
6050 action = 0xdeadbee;
6051 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6052 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6053 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6054 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6056 state = 0xdeadbee;
6057 action = 0xdeadbee;
6058 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6059 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6060 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6061 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6063 state = 0xdeadbee;
6064 action = 0xdeadbee;
6065 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6066 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6067 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6068 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6070 state = 0xdeadbee;
6071 action = 0xdeadbee;
6072 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6073 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6074 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6075 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6077 state = 0xdeadbee;
6078 action = 0xdeadbee;
6079 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6080 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6081 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6082 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6084 state = 0xdeadbee;
6085 action = 0xdeadbee;
6086 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6087 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6088 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6089 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6091 state = 0xdeadbee;
6092 action = 0xdeadbee;
6093 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6094 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6095 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6096 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6098 state = 0xdeadbee;
6099 action = 0xdeadbee;
6100 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6101 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6102 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6103 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6105 state = 0xdeadbee;
6106 action = 0xdeadbee;
6107 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6108 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6109 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6110 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6112 state = 0xdeadbee;
6113 action = 0xdeadbee;
6114 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6115 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6116 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6117 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6119 state = 0xdeadbee;
6120 action = 0xdeadbee;
6121 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6122 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6123 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6124 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6126 state = 0xdeadbee;
6127 action = 0xdeadbee;
6128 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6129 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6130 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6131 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6133 state = 0xdeadbee;
6134 action = 0xdeadbee;
6135 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6136 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6137 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6138 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6140 state = 0xdeadbee;
6141 action = 0xdeadbee;
6142 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6143 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6144 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6145 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6147 state = 0xdeadbee;
6148 action = 0xdeadbee;
6149 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6150 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6151 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6152 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6154 state = 0xdeadbee;
6155 action = 0xdeadbee;
6156 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6157 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6158 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6159 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6161 state = 0xdeadbee;
6162 action = 0xdeadbee;
6163 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6164 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6165 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6166 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6168 state = 0xdeadbee;
6169 action = 0xdeadbee;
6170 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6171 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6172 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6173 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6175 state = 0xdeadbee;
6176 action = 0xdeadbee;
6177 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6178 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6179 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6180 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6182 state = 0xdeadbee;
6183 action = 0xdeadbee;
6184 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6185 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6186 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6187 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6189 state = 0xdeadbee;
6190 action = 0xdeadbee;
6191 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6192 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6193 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6194 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6196 state = 0xdeadbee;
6197 action = 0xdeadbee;
6198 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6199 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6200 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6201 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6203 r = MsiDoAction( hpkg, "FileCost");
6204 ok( r == ERROR_SUCCESS, "file cost failed\n");
6206 state = 0xdeadbee;
6207 action = 0xdeadbee;
6208 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6209 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6210 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6211 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6213 state = 0xdeadbee;
6214 action = 0xdeadbee;
6215 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6216 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6217 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6218 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6220 state = 0xdeadbee;
6221 action = 0xdeadbee;
6222 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6223 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6224 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6225 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6227 state = 0xdeadbee;
6228 action = 0xdeadbee;
6229 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6230 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6231 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6232 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6234 state = 0xdeadbee;
6235 action = 0xdeadbee;
6236 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6237 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6238 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6239 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6241 state = 0xdeadbee;
6242 action = 0xdeadbee;
6243 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6244 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6245 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6246 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6248 state = 0xdeadbee;
6249 action = 0xdeadbee;
6250 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6251 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6252 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6253 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6255 state = 0xdeadbee;
6256 action = 0xdeadbee;
6257 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6258 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6259 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6260 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6262 state = 0xdeadbee;
6263 action = 0xdeadbee;
6264 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6265 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6266 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6267 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6269 state = 0xdeadbee;
6270 action = 0xdeadbee;
6271 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6272 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6273 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6274 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6276 state = 0xdeadbee;
6277 action = 0xdeadbee;
6278 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6279 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6280 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6281 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6283 state = 0xdeadbee;
6284 action = 0xdeadbee;
6285 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6286 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6287 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6288 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6290 state = 0xdeadbee;
6291 action = 0xdeadbee;
6292 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6293 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6294 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6295 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6297 state = 0xdeadbee;
6298 action = 0xdeadbee;
6299 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6300 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6301 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6302 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6304 state = 0xdeadbee;
6305 action = 0xdeadbee;
6306 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6307 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6308 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6309 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6311 state = 0xdeadbee;
6312 action = 0xdeadbee;
6313 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6314 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6315 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6316 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6318 state = 0xdeadbee;
6319 action = 0xdeadbee;
6320 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6321 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6322 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6323 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6325 state = 0xdeadbee;
6326 action = 0xdeadbee;
6327 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6328 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6329 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6330 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6332 state = 0xdeadbee;
6333 action = 0xdeadbee;
6334 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6335 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6336 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6337 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6339 state = 0xdeadbee;
6340 action = 0xdeadbee;
6341 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6342 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6343 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6344 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6346 state = 0xdeadbee;
6347 action = 0xdeadbee;
6348 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6349 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6350 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6351 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6353 state = 0xdeadbee;
6354 action = 0xdeadbee;
6355 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6356 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6357 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6358 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6360 state = 0xdeadbee;
6361 action = 0xdeadbee;
6362 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6363 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6364 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6365 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6367 state = 0xdeadbee;
6368 action = 0xdeadbee;
6369 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6370 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6371 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6372 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6374 state = 0xdeadbee;
6375 action = 0xdeadbee;
6376 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6377 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6378 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6379 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6381 state = 0xdeadbee;
6382 action = 0xdeadbee;
6383 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6384 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6385 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6386 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6388 state = 0xdeadbee;
6389 action = 0xdeadbee;
6390 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6391 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6392 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6393 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6395 state = 0xdeadbee;
6396 action = 0xdeadbee;
6397 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6398 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6399 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6400 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6402 state = 0xdeadbee;
6403 action = 0xdeadbee;
6404 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6405 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6406 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6407 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6409 state = 0xdeadbee;
6410 action = 0xdeadbee;
6411 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6412 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6413 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6414 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6416 state = 0xdeadbee;
6417 action = 0xdeadbee;
6418 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6419 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6420 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6421 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6423 state = 0xdeadbee;
6424 action = 0xdeadbee;
6425 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6426 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6427 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6428 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6430 state = 0xdeadbee;
6431 action = 0xdeadbee;
6432 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6433 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6434 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6435 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6437 r = MsiDoAction( hpkg, "CostFinalize");
6438 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
6440 state = 0xdeadbee;
6441 action = 0xdeadbee;
6442 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6443 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6444 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6445 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6447 state = 0xdeadbee;
6448 action = 0xdeadbee;
6449 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6450 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6451 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6452 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6454 state = 0xdeadbee;
6455 action = 0xdeadbee;
6456 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6457 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6458 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6459 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6461 state = 0xdeadbee;
6462 action = 0xdeadbee;
6463 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6464 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6465 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6466 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6468 state = 0xdeadbee;
6469 action = 0xdeadbee;
6470 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6471 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6472 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6473 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6475 state = 0xdeadbee;
6476 action = 0xdeadbee;
6477 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6478 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6479 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6480 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6482 state = 0xdeadbee;
6483 action = 0xdeadbee;
6484 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6485 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6486 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6487 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6489 state = 0xdeadbee;
6490 action = 0xdeadbee;
6491 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6492 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6493 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6494 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6496 state = 0xdeadbee;
6497 action = 0xdeadbee;
6498 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6499 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6500 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6501 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6503 state = 0xdeadbee;
6504 action = 0xdeadbee;
6505 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6506 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6507 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6508 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
6510 state = 0xdeadbee;
6511 action = 0xdeadbee;
6512 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6513 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6514 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6515 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6517 state = 0xdeadbee;
6518 action = 0xdeadbee;
6519 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6520 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6521 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6522 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6524 state = 0xdeadbee;
6525 action = 0xdeadbee;
6526 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6527 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6528 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6529 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6531 state = 0xdeadbee;
6532 action = 0xdeadbee;
6533 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6534 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6535 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6536 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6538 state = 0xdeadbee;
6539 action = 0xdeadbee;
6540 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6541 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6542 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6543 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6545 state = 0xdeadbee;
6546 action = 0xdeadbee;
6547 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6548 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6549 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6550 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6552 state = 0xdeadbee;
6553 action = 0xdeadbee;
6554 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6555 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6556 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6557 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6559 state = 0xdeadbee;
6560 action = 0xdeadbee;
6561 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6562 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6563 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6564 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6566 state = 0xdeadbee;
6567 action = 0xdeadbee;
6568 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6569 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6570 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6571 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6573 state = 0xdeadbee;
6574 action = 0xdeadbee;
6575 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6576 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6577 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6578 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6580 state = 0xdeadbee;
6581 action = 0xdeadbee;
6582 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6583 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6584 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
6585 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6587 state = 0xdeadbee;
6588 action = 0xdeadbee;
6589 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6590 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6591 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6592 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6594 state = 0xdeadbee;
6595 action = 0xdeadbee;
6596 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6597 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6598 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6599 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6601 state = 0xdeadbee;
6602 action = 0xdeadbee;
6603 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6604 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6605 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6606 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6608 state = 0xdeadbee;
6609 action = 0xdeadbee;
6610 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6611 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6612 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6613 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6615 state = 0xdeadbee;
6616 action = 0xdeadbee;
6617 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6618 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6619 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6620 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6622 state = 0xdeadbee;
6623 action = 0xdeadbee;
6624 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6625 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6626 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6627 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6629 state = 0xdeadbee;
6630 action = 0xdeadbee;
6631 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6632 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6633 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6634 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6636 state = 0xdeadbee;
6637 action = 0xdeadbee;
6638 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6639 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6640 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6641 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
6643 state = 0xdeadbee;
6644 action = 0xdeadbee;
6645 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6646 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6647 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6648 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6650 state = 0xdeadbee;
6651 action = 0xdeadbee;
6652 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6653 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6654 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6655 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6657 state = 0xdeadbee;
6658 action = 0xdeadbee;
6659 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6660 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6661 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6662 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6664 state = 0xdeadbee;
6665 action = 0xdeadbee;
6666 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6667 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6668 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
6669 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6671 MsiCloseHandle(hpkg);
6673 /* reinstall the product */
6674 r = MsiInstallProduct(msifile3, "REINSTALL=ALL");
6675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6677 r = MsiOpenDatabase(msifile4, MSIDBOPEN_DIRECT, &hdb);
6678 ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
6680 /* this property must not be in the saved msi file */
6681 r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
6682 ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
6684 r = package_from_db( hdb, &hpkg );
6685 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
6687 state = 0xdeadbee;
6688 action = 0xdeadbee;
6689 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6690 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6691 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6692 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6694 state = 0xdeadbee;
6695 action = 0xdeadbee;
6696 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6697 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6698 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6699 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6701 state = 0xdeadbee;
6702 action = 0xdeadbee;
6703 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6704 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6705 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6706 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6708 state = 0xdeadbee;
6709 action = 0xdeadbee;
6710 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6711 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6712 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6713 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6715 state = 0xdeadbee;
6716 action = 0xdeadbee;
6717 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6718 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6719 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6720 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6722 state = 0xdeadbee;
6723 action = 0xdeadbee;
6724 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6725 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6726 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6727 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6729 state = 0xdeadbee;
6730 action = 0xdeadbee;
6731 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6732 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6733 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6734 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6736 state = 0xdeadbee;
6737 action = 0xdeadbee;
6738 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6739 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6740 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6741 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6743 state = 0xdeadbee;
6744 action = 0xdeadbee;
6745 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6746 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6747 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6748 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6750 state = 0xdeadbee;
6751 action = 0xdeadbee;
6752 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6753 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6754 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6755 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6757 state = 0xdeadbee;
6758 action = 0xdeadbee;
6759 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6760 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
6761 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6762 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6764 state = 0xdeadbee;
6765 action = 0xdeadbee;
6766 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
6767 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6768 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6769 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6771 state = 0xdeadbee;
6772 action = 0xdeadbee;
6773 r = MsiGetComponentState(hpkg, "beta", &state, &action);
6774 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6775 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6776 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6778 state = 0xdeadbee;
6779 action = 0xdeadbee;
6780 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
6781 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6782 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6783 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6785 state = 0xdeadbee;
6786 action = 0xdeadbee;
6787 r = MsiGetComponentState(hpkg, "theta", &state, &action);
6788 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6789 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6790 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6792 state = 0xdeadbee;
6793 action = 0xdeadbee;
6794 r = MsiGetComponentState(hpkg, "delta", &state, &action);
6795 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6796 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6797 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6799 state = 0xdeadbee;
6800 action = 0xdeadbee;
6801 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
6802 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6803 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6804 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6806 state = 0xdeadbee;
6807 action = 0xdeadbee;
6808 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
6809 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6810 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6811 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6813 state = 0xdeadbee;
6814 action = 0xdeadbee;
6815 r = MsiGetComponentState(hpkg, "iota", &state, &action);
6816 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6817 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6818 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6820 state = 0xdeadbee;
6821 action = 0xdeadbee;
6822 r = MsiGetComponentState(hpkg, "eta", &state, &action);
6823 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6824 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6825 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6827 state = 0xdeadbee;
6828 action = 0xdeadbee;
6829 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
6830 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6831 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6832 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6834 state = 0xdeadbee;
6835 action = 0xdeadbee;
6836 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
6837 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6838 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6839 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6841 state = 0xdeadbee;
6842 action = 0xdeadbee;
6843 r = MsiGetComponentState(hpkg, "mu", &state, &action);
6844 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6845 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6846 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6848 state = 0xdeadbee;
6849 action = 0xdeadbee;
6850 r = MsiGetComponentState(hpkg, "nu", &state, &action);
6851 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6852 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6853 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6855 state = 0xdeadbee;
6856 action = 0xdeadbee;
6857 r = MsiGetComponentState(hpkg, "xi", &state, &action);
6858 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6859 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6860 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6862 state = 0xdeadbee;
6863 action = 0xdeadbee;
6864 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
6865 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6866 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6867 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6869 state = 0xdeadbee;
6870 action = 0xdeadbee;
6871 r = MsiGetComponentState(hpkg, "pi", &state, &action);
6872 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6873 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6874 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6876 state = 0xdeadbee;
6877 action = 0xdeadbee;
6878 r = MsiGetComponentState(hpkg, "rho", &state, &action);
6879 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6880 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6881 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6883 state = 0xdeadbee;
6884 action = 0xdeadbee;
6885 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
6886 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6887 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6888 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6890 state = 0xdeadbee;
6891 action = 0xdeadbee;
6892 r = MsiGetComponentState(hpkg, "tau", &state, &action);
6893 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6894 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6895 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6897 state = 0xdeadbee;
6898 action = 0xdeadbee;
6899 r = MsiGetComponentState(hpkg, "phi", &state, &action);
6900 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6901 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6902 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6904 state = 0xdeadbee;
6905 action = 0xdeadbee;
6906 r = MsiGetComponentState(hpkg, "chi", &state, &action);
6907 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6908 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6909 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6911 state = 0xdeadbee;
6912 action = 0xdeadbee;
6913 r = MsiGetComponentState(hpkg, "psi", &state, &action);
6914 ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
6915 ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
6916 ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
6918 r = MsiDoAction( hpkg, "CostInitialize");
6919 ok( r == ERROR_SUCCESS, "cost init failed\n");
6921 state = 0xdeadbee;
6922 action = 0xdeadbee;
6923 r = MsiGetFeatureState(hpkg, "one", &state, &action);
6924 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6925 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6926 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6928 state = 0xdeadbee;
6929 action = 0xdeadbee;
6930 r = MsiGetFeatureState(hpkg, "two", &state, &action);
6931 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6932 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6933 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6935 state = 0xdeadbee;
6936 action = 0xdeadbee;
6937 r = MsiGetFeatureState(hpkg, "three", &state, &action);
6938 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6939 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6940 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6942 state = 0xdeadbee;
6943 action = 0xdeadbee;
6944 r = MsiGetFeatureState(hpkg, "four", &state, &action);
6945 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6946 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6947 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6949 state = 0xdeadbee;
6950 action = 0xdeadbee;
6951 r = MsiGetFeatureState(hpkg, "five", &state, &action);
6952 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6953 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6954 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6956 state = 0xdeadbee;
6957 action = 0xdeadbee;
6958 r = MsiGetFeatureState(hpkg, "six", &state, &action);
6959 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6960 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6961 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6963 state = 0xdeadbee;
6964 action = 0xdeadbee;
6965 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
6966 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6967 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6968 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6970 state = 0xdeadbee;
6971 action = 0xdeadbee;
6972 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
6973 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6974 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6975 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6977 state = 0xdeadbee;
6978 action = 0xdeadbee;
6979 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
6980 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6981 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6982 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6984 state = 0xdeadbee;
6985 action = 0xdeadbee;
6986 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
6987 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6988 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6989 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6991 state = 0xdeadbee;
6992 action = 0xdeadbee;
6993 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
6994 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
6995 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6996 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
6998 state = 0xdeadbee;
6999 action = 0xdeadbee;
7000 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7001 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7002 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7003 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7005 state = 0xdeadbee;
7006 action = 0xdeadbee;
7007 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7008 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7009 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7010 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7012 state = 0xdeadbee;
7013 action = 0xdeadbee;
7014 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7015 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7016 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7017 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7019 state = 0xdeadbee;
7020 action = 0xdeadbee;
7021 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7022 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7023 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7024 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7026 state = 0xdeadbee;
7027 action = 0xdeadbee;
7028 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7029 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7030 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7031 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7033 state = 0xdeadbee;
7034 action = 0xdeadbee;
7035 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7036 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7037 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7038 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7040 state = 0xdeadbee;
7041 action = 0xdeadbee;
7042 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7043 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7044 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7045 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7047 state = 0xdeadbee;
7048 action = 0xdeadbee;
7049 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7050 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7051 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7052 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7054 state = 0xdeadbee;
7055 action = 0xdeadbee;
7056 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7057 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7058 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7059 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7061 state = 0xdeadbee;
7062 action = 0xdeadbee;
7063 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7064 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7065 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7066 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7068 state = 0xdeadbee;
7069 action = 0xdeadbee;
7070 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7071 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7072 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7073 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7075 state = 0xdeadbee;
7076 action = 0xdeadbee;
7077 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7078 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7079 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7080 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7082 state = 0xdeadbee;
7083 action = 0xdeadbee;
7084 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7085 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7086 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7087 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7089 state = 0xdeadbee;
7090 action = 0xdeadbee;
7091 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7092 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7093 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7094 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7096 state = 0xdeadbee;
7097 action = 0xdeadbee;
7098 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7099 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7100 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7101 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7103 state = 0xdeadbee;
7104 action = 0xdeadbee;
7105 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7106 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7107 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7108 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7110 state = 0xdeadbee;
7111 action = 0xdeadbee;
7112 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7113 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7114 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7115 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7117 state = 0xdeadbee;
7118 action = 0xdeadbee;
7119 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7120 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7121 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7122 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7124 state = 0xdeadbee;
7125 action = 0xdeadbee;
7126 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7127 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7128 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7129 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7131 state = 0xdeadbee;
7132 action = 0xdeadbee;
7133 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7134 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7135 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7136 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7138 state = 0xdeadbee;
7139 action = 0xdeadbee;
7140 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7141 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7142 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7143 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7145 state = 0xdeadbee;
7146 action = 0xdeadbee;
7147 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7148 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7149 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7150 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7152 r = MsiDoAction( hpkg, "FileCost");
7153 ok( r == ERROR_SUCCESS, "file cost failed\n");
7155 state = 0xdeadbee;
7156 action = 0xdeadbee;
7157 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7158 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7159 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7160 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7162 state = 0xdeadbee;
7163 action = 0xdeadbee;
7164 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7165 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7166 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7167 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7169 state = 0xdeadbee;
7170 action = 0xdeadbee;
7171 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7172 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7173 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7174 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7176 state = 0xdeadbee;
7177 action = 0xdeadbee;
7178 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7179 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7180 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7181 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7183 state = 0xdeadbee;
7184 action = 0xdeadbee;
7185 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7186 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7187 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7188 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7190 state = 0xdeadbee;
7191 action = 0xdeadbee;
7192 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7193 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7194 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7195 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7197 state = 0xdeadbee;
7198 action = 0xdeadbee;
7199 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7200 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7201 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7202 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7204 state = 0xdeadbee;
7205 action = 0xdeadbee;
7206 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7207 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7208 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7209 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7211 state = 0xdeadbee;
7212 action = 0xdeadbee;
7213 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7214 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7215 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7216 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7218 state = 0xdeadbee;
7219 action = 0xdeadbee;
7220 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7221 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7222 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7223 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7225 state = 0xdeadbee;
7226 action = 0xdeadbee;
7227 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7228 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7229 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7230 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7232 state = 0xdeadbee;
7233 action = 0xdeadbee;
7234 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7235 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7236 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7237 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7239 state = 0xdeadbee;
7240 action = 0xdeadbee;
7241 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7242 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7243 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7244 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7246 state = 0xdeadbee;
7247 action = 0xdeadbee;
7248 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7249 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7250 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7251 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7253 state = 0xdeadbee;
7254 action = 0xdeadbee;
7255 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7256 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7257 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7258 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7260 state = 0xdeadbee;
7261 action = 0xdeadbee;
7262 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7263 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7264 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7265 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7267 state = 0xdeadbee;
7268 action = 0xdeadbee;
7269 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7270 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7271 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7272 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7274 state = 0xdeadbee;
7275 action = 0xdeadbee;
7276 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7277 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7278 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7279 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7281 state = 0xdeadbee;
7282 action = 0xdeadbee;
7283 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7284 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7285 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7286 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7288 state = 0xdeadbee;
7289 action = 0xdeadbee;
7290 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7291 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7292 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7293 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7295 state = 0xdeadbee;
7296 action = 0xdeadbee;
7297 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7298 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7299 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7300 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7302 state = 0xdeadbee;
7303 action = 0xdeadbee;
7304 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7305 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7306 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7307 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7309 state = 0xdeadbee;
7310 action = 0xdeadbee;
7311 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7312 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7313 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7314 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7316 state = 0xdeadbee;
7317 action = 0xdeadbee;
7318 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7319 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7320 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7321 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7323 state = 0xdeadbee;
7324 action = 0xdeadbee;
7325 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7326 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7327 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7328 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7330 state = 0xdeadbee;
7331 action = 0xdeadbee;
7332 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7333 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7334 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7335 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7337 state = 0xdeadbee;
7338 action = 0xdeadbee;
7339 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7340 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7341 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7342 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7344 state = 0xdeadbee;
7345 action = 0xdeadbee;
7346 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7347 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7348 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7349 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7351 state = 0xdeadbee;
7352 action = 0xdeadbee;
7353 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7354 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7355 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7356 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7358 state = 0xdeadbee;
7359 action = 0xdeadbee;
7360 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7361 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7362 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7363 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7365 state = 0xdeadbee;
7366 action = 0xdeadbee;
7367 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7368 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7369 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7370 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7372 state = 0xdeadbee;
7373 action = 0xdeadbee;
7374 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7375 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7376 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7377 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7379 state = 0xdeadbee;
7380 action = 0xdeadbee;
7381 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7382 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7383 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
7384 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7386 r = MsiDoAction( hpkg, "CostFinalize");
7387 ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
7389 state = 0xdeadbee;
7390 action = 0xdeadbee;
7391 r = MsiGetFeatureState(hpkg, "one", &state, &action);
7392 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7393 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7394 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7396 state = 0xdeadbee;
7397 action = 0xdeadbee;
7398 r = MsiGetFeatureState(hpkg, "two", &state, &action);
7399 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7400 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7401 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7403 state = 0xdeadbee;
7404 action = 0xdeadbee;
7405 r = MsiGetFeatureState(hpkg, "three", &state, &action);
7406 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7407 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7408 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7410 state = 0xdeadbee;
7411 action = 0xdeadbee;
7412 r = MsiGetFeatureState(hpkg, "four", &state, &action);
7413 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7414 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7415 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7417 state = 0xdeadbee;
7418 action = 0xdeadbee;
7419 r = MsiGetFeatureState(hpkg, "five", &state, &action);
7420 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7421 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7422 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7424 state = 0xdeadbee;
7425 action = 0xdeadbee;
7426 r = MsiGetFeatureState(hpkg, "six", &state, &action);
7427 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7428 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7429 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7431 state = 0xdeadbee;
7432 action = 0xdeadbee;
7433 r = MsiGetFeatureState(hpkg, "seven", &state, &action);
7434 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7435 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7436 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7438 state = 0xdeadbee;
7439 action = 0xdeadbee;
7440 r = MsiGetFeatureState(hpkg, "eight", &state, &action);
7441 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7442 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7443 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7445 state = 0xdeadbee;
7446 action = 0xdeadbee;
7447 r = MsiGetFeatureState(hpkg, "nine", &state, &action);
7448 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7449 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7450 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7452 state = 0xdeadbee;
7453 action = 0xdeadbee;
7454 r = MsiGetFeatureState(hpkg, "ten", &state, &action);
7455 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7456 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7457 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
7459 state = 0xdeadbee;
7460 action = 0xdeadbee;
7461 r = MsiGetFeatureState(hpkg, "eleven", &state, &action);
7462 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7463 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7464 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7466 state = 0xdeadbee;
7467 action = 0xdeadbee;
7468 r = MsiGetComponentState(hpkg, "alpha", &state, &action);
7469 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7470 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7471 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7473 state = 0xdeadbee;
7474 action = 0xdeadbee;
7475 r = MsiGetComponentState(hpkg, "beta", &state, &action);
7476 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7477 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7478 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7480 state = 0xdeadbee;
7481 action = 0xdeadbee;
7482 r = MsiGetComponentState(hpkg, "gamma", &state, &action);
7483 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7484 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7485 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7487 state = 0xdeadbee;
7488 action = 0xdeadbee;
7489 r = MsiGetComponentState(hpkg, "theta", &state, &action);
7490 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7491 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7492 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7494 state = 0xdeadbee;
7495 action = 0xdeadbee;
7496 r = MsiGetComponentState(hpkg, "delta", &state, &action);
7497 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7498 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7499 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7501 state = 0xdeadbee;
7502 action = 0xdeadbee;
7503 r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
7504 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7505 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7506 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7508 state = 0xdeadbee;
7509 action = 0xdeadbee;
7510 r = MsiGetComponentState(hpkg, "zeta", &state, &action);
7511 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7512 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7513 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7515 state = 0xdeadbee;
7516 action = 0xdeadbee;
7517 r = MsiGetComponentState(hpkg, "iota", &state, &action);
7518 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7519 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7520 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7522 state = 0xdeadbee;
7523 action = 0xdeadbee;
7524 r = MsiGetComponentState(hpkg, "eta", &state, &action);
7525 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7526 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7527 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7529 state = 0xdeadbee;
7530 action = 0xdeadbee;
7531 r = MsiGetComponentState(hpkg, "kappa", &state, &action);
7532 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7533 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
7534 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7536 state = 0xdeadbee;
7537 action = 0xdeadbee;
7538 r = MsiGetComponentState(hpkg, "lambda", &state, &action);
7539 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7540 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7541 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7543 state = 0xdeadbee;
7544 action = 0xdeadbee;
7545 r = MsiGetComponentState(hpkg, "mu", &state, &action);
7546 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7547 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7548 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7550 state = 0xdeadbee;
7551 action = 0xdeadbee;
7552 r = MsiGetComponentState(hpkg, "nu", &state, &action);
7553 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7554 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7555 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7557 state = 0xdeadbee;
7558 action = 0xdeadbee;
7559 r = MsiGetComponentState(hpkg, "xi", &state, &action);
7560 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7561 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7562 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7564 state = 0xdeadbee;
7565 action = 0xdeadbee;
7566 r = MsiGetComponentState(hpkg, "omicron", &state, &action);
7567 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7568 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7569 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7571 state = 0xdeadbee;
7572 action = 0xdeadbee;
7573 r = MsiGetComponentState(hpkg, "pi", &state, &action);
7574 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7575 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7576 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7578 state = 0xdeadbee;
7579 action = 0xdeadbee;
7580 r = MsiGetComponentState(hpkg, "rho", &state, &action);
7581 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7582 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7583 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7585 state = 0xdeadbee;
7586 action = 0xdeadbee;
7587 r = MsiGetComponentState(hpkg, "sigma", &state, &action);
7588 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7589 ok( state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
7590 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
7592 state = 0xdeadbee;
7593 action = 0xdeadbee;
7594 r = MsiGetComponentState(hpkg, "tau", &state, &action);
7595 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7596 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7597 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7599 state = 0xdeadbee;
7600 action = 0xdeadbee;
7601 r = MsiGetComponentState(hpkg, "phi", &state, &action);
7602 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7603 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7604 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7606 state = 0xdeadbee;
7607 action = 0xdeadbee;
7608 r = MsiGetComponentState(hpkg, "chi", &state, &action);
7609 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7610 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7611 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7613 state = 0xdeadbee;
7614 action = 0xdeadbee;
7615 r = MsiGetComponentState(hpkg, "psi", &state, &action);
7616 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
7617 ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
7618 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
7620 MsiCloseHandle(hpkg);
7622 /* uninstall the product */
7623 r = MsiInstallProduct(msifile4, "REMOVE=ALL");
7624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7626 DeleteFileA(msifile);
7627 DeleteFileA(msifile2);
7628 DeleteFileA(msifile3);
7629 DeleteFileA(msifile4);
7632 static void test_getproperty(void)
7634 MSIHANDLE hPackage = 0;
7635 char prop[100];
7636 static CHAR empty[] = "";
7637 DWORD size;
7638 UINT r;
7640 r = package_from_db(create_package_db(), &hPackage);
7641 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7643 skip("Not enough rights to perform tests\n");
7644 DeleteFile(msifile);
7645 return;
7647 ok( r == ERROR_SUCCESS, "Failed to create package %u\n", r );
7649 /* set the property */
7650 r = MsiSetProperty(hPackage, "Name", "Value");
7651 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7653 /* retrieve the size, NULL pointer */
7654 size = 0;
7655 r = MsiGetProperty(hPackage, "Name", NULL, &size);
7656 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7657 ok( size == 5, "Expected 5, got %d\n", size);
7659 /* retrieve the size, empty string */
7660 size = 0;
7661 r = MsiGetProperty(hPackage, "Name", empty, &size);
7662 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7663 ok( size == 5, "Expected 5, got %d\n", size);
7665 /* don't change size */
7666 r = MsiGetProperty(hPackage, "Name", prop, &size);
7667 ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
7668 ok( size == 5, "Expected 5, got %d\n", size);
7669 ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop);
7671 /* increase the size by 1 */
7672 size++;
7673 r = MsiGetProperty(hPackage, "Name", prop, &size);
7674 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7675 ok( size == 5, "Expected 5, got %d\n", size);
7676 ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop);
7678 r = MsiCloseHandle( hPackage);
7679 ok( r == ERROR_SUCCESS , "Failed to close package\n" );
7680 DeleteFile(msifile);
7683 static void test_removefiles(void)
7685 MSIHANDLE hpkg;
7686 UINT r;
7687 MSIHANDLE hdb;
7689 hdb = create_package_db();
7690 ok ( hdb, "failed to create package database\n" );
7692 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
7693 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
7695 r = create_feature_table( hdb );
7696 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
7698 r = create_component_table( hdb );
7699 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
7701 r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" );
7702 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
7704 r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" );
7705 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7707 r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" );
7708 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7710 r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" );
7711 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7713 r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" );
7714 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7716 r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" );
7717 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7719 r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" );
7720 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
7722 r = create_feature_components_table( hdb );
7723 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
7725 r = add_feature_components_entry( hdb, "'one', 'hydrogen'" );
7726 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7728 r = add_feature_components_entry( hdb, "'one', 'helium'" );
7729 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7731 r = add_feature_components_entry( hdb, "'one', 'lithium'" );
7732 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7734 r = add_feature_components_entry( hdb, "'one', 'beryllium'" );
7735 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7737 r = add_feature_components_entry( hdb, "'one', 'boron'" );
7738 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7740 r = add_feature_components_entry( hdb, "'one', 'carbon'" );
7741 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
7743 r = create_file_table( hdb );
7744 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
7746 r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" );
7747 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7749 r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" );
7750 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7752 r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" );
7753 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7755 r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" );
7756 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7758 r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" );
7759 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7761 r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" );
7762 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
7764 r = create_remove_file_table( hdb );
7765 ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r);
7767 r = package_from_db( hdb, &hpkg );
7768 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7770 skip("Not enough rights to perform tests\n");
7771 DeleteFile(msifile);
7772 return;
7774 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7776 MsiCloseHandle( hdb );
7778 create_test_file( "hydrogen.txt" );
7779 create_test_file( "helium.txt" );
7780 create_test_file( "lithium.txt" );
7781 create_test_file( "beryllium.txt" );
7782 create_test_file( "boron.txt" );
7783 create_test_file( "carbon.txt" );
7785 r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR );
7786 ok( r == ERROR_SUCCESS, "set property failed\n");
7788 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7790 r = MsiDoAction( hpkg, "CostInitialize");
7791 ok( r == ERROR_SUCCESS, "cost init failed\n");
7793 r = MsiDoAction( hpkg, "FileCost");
7794 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7796 r = MsiDoAction( hpkg, "CostFinalize");
7797 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7799 r = MsiDoAction( hpkg, "InstallValidate");
7800 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
7802 r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT );
7803 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7805 r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL );
7806 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7808 r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE );
7809 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7811 r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT );
7812 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7814 r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL );
7815 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7817 r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE );
7818 ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r);
7820 r = MsiDoAction( hpkg, "RemoveFiles");
7821 ok( r == ERROR_SUCCESS, "remove files failed\n");
7823 ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
7824 ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
7825 ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
7826 ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
7827 ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
7828 ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n");
7830 MsiCloseHandle( hpkg );
7831 DeleteFileA(msifile);
7834 static void test_appsearch(void)
7836 MSIHANDLE hpkg;
7837 UINT r;
7838 MSIHANDLE hdb;
7839 CHAR prop[MAX_PATH];
7840 DWORD size;
7842 hdb = create_package_db();
7843 ok ( hdb, "failed to create package database\n" );
7845 r = create_appsearch_table( hdb );
7846 ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r );
7848 r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" );
7849 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7851 r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" );
7852 ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r );
7854 r = create_reglocator_table( hdb );
7855 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7857 r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 );
7858 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7860 r = create_drlocator_table( hdb );
7861 ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r );
7863 r = add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" );
7864 ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r );
7866 r = create_signature_table( hdb );
7867 ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r );
7869 r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" );
7870 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7872 r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" );
7873 ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r );
7875 r = package_from_db( hdb, &hpkg );
7876 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7878 skip("Not enough rights to perform tests\n");
7879 DeleteFile(msifile);
7880 return;
7882 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
7883 MsiCloseHandle( hdb );
7884 if (r != ERROR_SUCCESS)
7885 goto done;
7887 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7889 r = MsiDoAction( hpkg, "AppSearch" );
7890 ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r);
7892 size = sizeof(prop);
7893 r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size );
7894 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7895 todo_wine
7897 ok( lstrlenA(prop) != 0, "Expected non-zero length\n");
7900 size = sizeof(prop);
7901 r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size );
7902 ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
7904 done:
7905 MsiCloseHandle( hpkg );
7906 DeleteFileA(msifile);
7909 static void test_appsearch_complocator(void)
7911 MSIHANDLE hpkg, hdb;
7912 CHAR path[MAX_PATH];
7913 CHAR prop[MAX_PATH];
7914 LPSTR usersid;
7915 DWORD size;
7916 UINT r;
7918 if (!get_user_sid(&usersid))
7919 return;
7921 if (is_process_limited())
7923 skip("process is limited\n");
7924 return;
7927 create_test_file("FileName1");
7928 create_test_file("FileName4");
7929 set_component_path("FileName1", MSIINSTALLCONTEXT_MACHINE,
7930 "{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", NULL, FALSE);
7932 create_test_file("FileName2");
7933 set_component_path("FileName2", MSIINSTALLCONTEXT_USERUNMANAGED,
7934 "{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", usersid, FALSE);
7936 create_test_file("FileName3");
7937 set_component_path("FileName3", MSIINSTALLCONTEXT_USERMANAGED,
7938 "{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}", usersid, FALSE);
7940 create_test_file("FileName5");
7941 set_component_path("FileName5", MSIINSTALLCONTEXT_MACHINE,
7942 "{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}", NULL, TRUE);
7944 create_test_file("FileName6");
7945 set_component_path("FileName6", MSIINSTALLCONTEXT_MACHINE,
7946 "{C0ECD96F-7898-4410-9667-194BD8C1B648}", NULL, TRUE);
7948 create_test_file("FileName7");
7949 set_component_path("FileName7", MSIINSTALLCONTEXT_MACHINE,
7950 "{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}", NULL, FALSE);
7952 /* dir is FALSE, but we're pretending it's a directory */
7953 set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE,
7954 "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE);
7956 create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7957 set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE,
7958 "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE);
7960 create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4));
7961 set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE,
7962 "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE);
7964 create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3));
7965 set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE,
7966 "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE);
7968 hdb = create_package_db();
7969 ok(hdb, "Expected a valid database handle\n");
7971 r = create_appsearch_table(hdb);
7972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7974 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
7975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7977 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
7978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7980 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
7981 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7983 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
7984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7986 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
7987 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7989 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
7990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7992 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
7993 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7995 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
7996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
7998 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
7999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8001 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8004 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8007 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8008 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8010 r = create_complocator_table(hdb);
8011 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8013 /* published component, machine, file, signature, misdbLocatorTypeFile */
8014 r = add_complocator_entry(hdb, "'NewSignature1', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 1");
8015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8017 /* published component, user-unmanaged, file, signature, misdbLocatorTypeFile */
8018 r = add_complocator_entry(hdb, "'NewSignature2', '{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}', 1");
8019 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8021 /* published component, user-managed, file, signature, misdbLocatorTypeFile */
8022 r = add_complocator_entry(hdb, "'NewSignature3', '{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}', 1");
8023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8025 /* published component, machine, file, signature, misdbLocatorTypeDirectory */
8026 r = add_complocator_entry(hdb, "'NewSignature4', '{A8AE6692-96BA-4198-8399-145D7D1D0D0E}', 0");
8027 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8029 /* published component, machine, dir, signature, misdbLocatorTypeDirectory */
8030 r = add_complocator_entry(hdb, "'NewSignature5', '{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}', 0");
8031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8033 /* published component, machine, dir, no signature, misdbLocatorTypeDirectory */
8034 r = add_complocator_entry(hdb, "'NewSignature6', '{C0ECD96F-7898-4410-9667-194BD8C1B648}', 0");
8035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8037 /* published component, machine, file, no signature, misdbLocatorTypeFile */
8038 r = add_complocator_entry(hdb, "'NewSignature7', '{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}', 1");
8039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8041 /* unpublished component, no signature, misdbLocatorTypeDir */
8042 r = add_complocator_entry(hdb, "'NewSignature8', '{FB671D5B-5083-4048-90E0-481C48D8F3A5}', 0");
8043 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8045 /* published component, no signature, dir does not exist misdbLocatorTypeDir */
8046 r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0");
8047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8049 /* published component, signature w/ ver, misdbLocatorTypeFile */
8050 r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1");
8051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8053 /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */
8054 r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1");
8055 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8057 /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */
8058 r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1");
8059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8061 r = create_signature_table(hdb);
8062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8064 r = add_signature_entry(hdb, "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''");
8065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8067 r = add_signature_entry(hdb, "'NewSignature2', 'FileName2', '', '', '', '', '', '', ''");
8068 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8070 r = add_signature_entry(hdb, "'NewSignature3', 'FileName3', '', '', '', '', '', '', ''");
8071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8073 r = add_signature_entry(hdb, "'NewSignature4', 'FileName4', '', '', '', '', '', '', ''");
8074 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8076 r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''");
8077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8079 r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8082 r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8085 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
8086 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8088 r = package_from_db(hdb, &hpkg);
8089 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8091 skip("Not enough rights to perform tests\n");
8092 goto error;
8094 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8096 r = MsiSetPropertyA(hpkg, "SIGPROP8", "october");
8097 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8099 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8101 r = MsiDoAction(hpkg, "AppSearch");
8102 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8104 size = MAX_PATH;
8105 sprintf(path, "%s\\FileName1", CURR_DIR);
8106 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8108 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8110 size = MAX_PATH;
8111 sprintf(path, "%s\\FileName2", CURR_DIR);
8112 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8114 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8116 size = MAX_PATH;
8117 sprintf(path, "%s\\FileName3", CURR_DIR);
8118 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8120 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8122 size = MAX_PATH;
8123 sprintf(path, "%s\\FileName4", CURR_DIR);
8124 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
8125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8126 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8128 size = MAX_PATH;
8129 sprintf(path, "%s\\FileName5", CURR_DIR);
8130 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8132 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8134 size = MAX_PATH;
8135 sprintf(path, "%s\\", CURR_DIR);
8136 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8137 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8138 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8140 size = MAX_PATH;
8141 sprintf(path, "%s\\", CURR_DIR);
8142 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8143 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8144 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8146 size = MAX_PATH;
8147 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8148 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8149 ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop);
8151 size = MAX_PATH;
8152 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8154 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8156 size = MAX_PATH;
8157 sprintf(path, "%s\\FileName8.dll", CURR_DIR);
8158 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8160 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8162 size = MAX_PATH;
8163 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8164 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8165 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8167 size = MAX_PATH;
8168 sprintf(path, "%s\\FileName10.dll", CURR_DIR);
8169 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8170 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8171 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8173 delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}",
8174 MSIINSTALLCONTEXT_MACHINE, NULL);
8175 delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}",
8176 MSIINSTALLCONTEXT_USERUNMANAGED, usersid);
8177 delete_component_path("{19E0B999-85F5-4973-A61B-DBE4D66ECB1D}",
8178 MSIINSTALLCONTEXT_USERMANAGED, usersid);
8179 delete_component_path("{F0CCA976-27A3-4808-9DDD-1A6FD50A0D5A}",
8180 MSIINSTALLCONTEXT_MACHINE, NULL);
8181 delete_component_path("{C0ECD96F-7898-4410-9667-194BD8C1B648}",
8182 MSIINSTALLCONTEXT_MACHINE, NULL);
8183 delete_component_path("{DB20F535-9C26-4127-9C2B-CC45A8B51DA1}",
8184 MSIINSTALLCONTEXT_MACHINE, NULL);
8185 delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}",
8186 MSIINSTALLCONTEXT_MACHINE, NULL);
8187 delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}",
8188 MSIINSTALLCONTEXT_MACHINE, NULL);
8189 delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}",
8190 MSIINSTALLCONTEXT_MACHINE, NULL);
8191 delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}",
8192 MSIINSTALLCONTEXT_MACHINE, NULL);
8194 MsiCloseHandle(hpkg);
8196 error:
8197 DeleteFileA("FileName1");
8198 DeleteFileA("FileName2");
8199 DeleteFileA("FileName3");
8200 DeleteFileA("FileName4");
8201 DeleteFileA("FileName5");
8202 DeleteFileA("FileName6");
8203 DeleteFileA("FileName7");
8204 DeleteFileA("FileName8.dll");
8205 DeleteFileA("FileName9.dll");
8206 DeleteFileA("FileName10.dll");
8207 DeleteFileA(msifile);
8208 LocalFree(usersid);
8211 static void test_appsearch_reglocator(void)
8213 MSIHANDLE hpkg, hdb;
8214 CHAR path[MAX_PATH], prop[MAX_PATH];
8215 DWORD binary[2], size, val;
8216 BOOL space, version, is_64bit = sizeof(void *) > sizeof(int);
8217 HKEY hklm, classes, hkcu, users;
8218 LPSTR pathdata, pathvar, ptr;
8219 LPCSTR str;
8220 LONG res;
8221 UINT r, type = 0;
8223 version = TRUE;
8224 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8225 version = FALSE;
8227 DeleteFileA("test.dll");
8229 res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes);
8230 if (res == ERROR_ACCESS_DENIED)
8232 skip("Not enough rights to perform tests\n");
8233 return;
8235 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8237 res = RegSetValueExA(classes, "Value1", 0, REG_SZ,
8238 (const BYTE *)"regszdata", 10);
8239 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8241 res = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine", &hkcu);
8242 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8244 res = RegSetValueExA(hkcu, "Value1", 0, REG_SZ,
8245 (const BYTE *)"regszdata", 10);
8246 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8248 users = 0;
8249 res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
8250 ok(res == ERROR_SUCCESS ||
8251 broken(res == ERROR_INVALID_PARAMETER),
8252 "Expected ERROR_SUCCESS, got %d\n", res);
8254 if (res == ERROR_SUCCESS)
8256 res = RegSetValueExA(users, "Value1", 0, REG_SZ,
8257 (const BYTE *)"regszdata", 10);
8258 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8261 res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm);
8262 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8264 res = RegSetValueA(hklm, NULL, REG_SZ, "defvalue", 8);
8265 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8267 res = RegSetValueExA(hklm, "Value1", 0, REG_SZ,
8268 (const BYTE *)"regszdata", 10);
8269 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8271 val = 42;
8272 res = RegSetValueExA(hklm, "Value2", 0, REG_DWORD,
8273 (const BYTE *)&val, sizeof(DWORD));
8274 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8276 val = -42;
8277 res = RegSetValueExA(hklm, "Value3", 0, REG_DWORD,
8278 (const BYTE *)&val, sizeof(DWORD));
8279 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8281 res = RegSetValueExA(hklm, "Value4", 0, REG_EXPAND_SZ,
8282 (const BYTE *)"%PATH%", 7);
8283 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8285 res = RegSetValueExA(hklm, "Value5", 0, REG_EXPAND_SZ,
8286 (const BYTE *)"my%NOVAR%", 10);
8287 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8289 res = RegSetValueExA(hklm, "Value6", 0, REG_MULTI_SZ,
8290 (const BYTE *)"one\0two\0", 9);
8291 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8293 binary[0] = 0x1234abcd;
8294 binary[1] = 0x567890ef;
8295 res = RegSetValueExA(hklm, "Value7", 0, REG_BINARY,
8296 (const BYTE *)binary, sizeof(binary));
8297 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8299 res = RegSetValueExA(hklm, "Value8", 0, REG_SZ,
8300 (const BYTE *)"#regszdata", 11);
8301 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8303 create_test_file("FileName1");
8304 sprintf(path, "%s\\FileName1", CURR_DIR);
8305 res = RegSetValueExA(hklm, "Value9", 0, REG_SZ,
8306 (const BYTE *)path, lstrlenA(path) + 1);
8307 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8309 sprintf(path, "%s\\FileName2", CURR_DIR);
8310 res = RegSetValueExA(hklm, "Value10", 0, REG_SZ,
8311 (const BYTE *)path, lstrlenA(path) + 1);
8312 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8314 lstrcpyA(path, CURR_DIR);
8315 res = RegSetValueExA(hklm, "Value11", 0, REG_SZ,
8316 (const BYTE *)path, lstrlenA(path) + 1);
8317 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8319 res = RegSetValueExA(hklm, "Value12", 0, REG_SZ,
8320 (const BYTE *)"", 1);
8321 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8323 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8324 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8325 res = RegSetValueExA(hklm, "Value13", 0, REG_SZ,
8326 (const BYTE *)path, lstrlenA(path) + 1);
8327 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8329 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8330 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8331 res = RegSetValueExA(hklm, "Value14", 0, REG_SZ,
8332 (const BYTE *)path, lstrlenA(path) + 1);
8333 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8335 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8336 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8337 res = RegSetValueExA(hklm, "Value15", 0, REG_SZ,
8338 (const BYTE *)path, lstrlenA(path) + 1);
8339 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8341 sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR);
8342 res = RegSetValueExA(hklm, "value16", 0, REG_SZ,
8343 (const BYTE *)path, lstrlenA(path) + 1);
8345 space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE;
8346 sprintf(path, "%s\\FileName1 -option", CURR_DIR);
8347 res = RegSetValueExA(hklm, "value17", 0, REG_SZ,
8348 (const BYTE *)path, lstrlenA(path) + 1);
8350 hdb = create_package_db();
8351 ok(hdb, "Expected a valid database handle\n");
8353 r = create_appsearch_table(hdb);
8354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8356 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8359 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8360 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8362 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8365 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8368 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8371 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8372 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8374 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8377 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8378 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8380 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8383 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8386 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8389 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8392 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
8393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8395 r = add_appsearch_entry(hdb, "'SIGPROP14', 'NewSignature14'");
8396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8398 r = add_appsearch_entry(hdb, "'SIGPROP15', 'NewSignature15'");
8399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8401 r = add_appsearch_entry(hdb, "'SIGPROP16', 'NewSignature16'");
8402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8404 r = add_appsearch_entry(hdb, "'SIGPROP17', 'NewSignature17'");
8405 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8407 r = add_appsearch_entry(hdb, "'SIGPROP18', 'NewSignature18'");
8408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8410 r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'");
8411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8413 r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'");
8414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8416 r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'");
8417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8419 r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'");
8420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8422 r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'");
8423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8425 r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'");
8426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8428 r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'");
8429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8431 r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'");
8432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8434 r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'");
8435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8437 r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'");
8438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8440 r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'");
8441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8443 r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'");
8444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8446 r = create_reglocator_table(hdb);
8447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8449 type = msidbLocatorTypeRawValue;
8450 if (is_64bit)
8451 type |= msidbLocatorType64bit;
8453 /* HKLM, msidbLocatorTypeRawValue, REG_SZ */
8454 r = add_reglocator_entry(hdb, "NewSignature1", 2, "Software\\Wine", "Value1", type);
8455 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8457 /* HKLM, msidbLocatorTypeRawValue, positive DWORD */
8458 r = add_reglocator_entry(hdb, "NewSignature2", 2, "Software\\Wine", "Value2", type);
8459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8461 /* HKLM, msidbLocatorTypeRawValue, negative DWORD */
8462 r = add_reglocator_entry(hdb, "NewSignature3", 2, "Software\\Wine", "Value3", type);
8463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8465 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8466 r = add_reglocator_entry(hdb, "NewSignature4", 2, "Software\\Wine", "Value4", type);
8467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8469 /* HKLM, msidbLocatorTypeRawValue, REG_EXPAND_SZ */
8470 r = add_reglocator_entry(hdb, "NewSignature5", 2, "Software\\Wine", "Value5", type);
8471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8473 /* HKLM, msidbLocatorTypeRawValue, REG_MULTI_SZ */
8474 r = add_reglocator_entry(hdb, "NewSignature6", 2, "Software\\Wine", "Value6", type);
8475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8477 /* HKLM, msidbLocatorTypeRawValue, REG_BINARY */
8478 r = add_reglocator_entry(hdb, "NewSignature7", 2, "Software\\Wine", "Value7", type);
8479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8481 /* HKLM, msidbLocatorTypeRawValue, REG_SZ first char is # */
8482 r = add_reglocator_entry(hdb, "NewSignature8", 2, "Software\\Wine", "Value8", type);
8483 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8485 type = msidbLocatorTypeFileName;
8486 if (is_64bit)
8487 type |= msidbLocatorType64bit;
8489 /* HKLM, msidbLocatorTypeFileName, signature, file exists */
8490 r = add_reglocator_entry(hdb, "NewSignature9", 2, "Software\\Wine", "Value9", type);
8491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8493 /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */
8494 r = add_reglocator_entry(hdb, "NewSignature10", 2, "Software\\Wine", "Value10", type);
8495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8497 /* HKLM, msidbLocatorTypeFileName, no signature */
8498 r = add_reglocator_entry(hdb, "NewSignature11", 2, "Software\\Wine", "Value9", type);
8499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8501 type = msidbLocatorTypeDirectory;
8502 if (is_64bit)
8503 type |= msidbLocatorType64bit;
8505 /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */
8506 r = add_reglocator_entry(hdb, "NewSignature12", 2, "Software\\Wine", "Value9", type);
8507 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8509 /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */
8510 r = add_reglocator_entry(hdb, "NewSignature13", 2, "Software\\Wine", "Value11", type);
8511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8513 /* HKLM, msidbLocatorTypeDirectory, signature, file exists */
8514 r = add_reglocator_entry(hdb, "NewSignature14", 2, "Software\\Wine", "Value9", type);
8515 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8517 type = msidbLocatorTypeRawValue;
8518 if (is_64bit)
8519 type |= msidbLocatorType64bit;
8521 /* HKCR, msidbLocatorTypeRawValue, REG_SZ */
8522 r = add_reglocator_entry(hdb, "NewSignature15", 0, "Software\\Wine", "Value1", type);
8523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8525 /* HKCU, msidbLocatorTypeRawValue, REG_SZ */
8526 r = add_reglocator_entry(hdb, "NewSignature16", 1, "Software\\Wine", "Value1", type);
8527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8529 /* HKU, msidbLocatorTypeRawValue, REG_SZ */
8530 r = add_reglocator_entry(hdb, "NewSignature17", 3, "S-1-5-18\\Software\\Wine", "Value1", type);
8531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8533 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, NULL Name */
8534 r = add_reglocator_entry(hdb, "NewSignature18", 2, "Software\\Wine", "", type);
8535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8537 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, key does not exist */
8538 r = add_reglocator_entry(hdb, "NewSignature19", 2, "Software\\IDontExist", "", type);
8539 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8541 /* HKLM, msidbLocatorTypeRawValue, REG_SZ, value is empty */
8542 r = add_reglocator_entry(hdb, "NewSignature20", 2, "Software\\Wine", "Value12", type);
8543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8545 type = msidbLocatorTypeFileName;
8546 if (is_64bit)
8547 type |= msidbLocatorType64bit;
8549 /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */
8550 r = add_reglocator_entry(hdb, "NewSignature21", 2, "Software\\Wine", "Value13", type);
8551 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8553 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */
8554 r = add_reglocator_entry(hdb, "NewSignature22", 2, "Software\\Wine", "Value14", type);
8555 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8557 /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */
8558 r = add_reglocator_entry(hdb, "NewSignature23", 2, "Software\\Wine", "Value15", type);
8559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8561 /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */
8562 r = add_reglocator_entry(hdb, "NewSignature24", 2, "Software\\Wine", "Value11", type);
8563 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8565 /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */
8566 r = add_reglocator_entry(hdb, "NewSignature25", 2, "Software\\Wine", "Value10", type);
8567 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8569 type = msidbLocatorTypeDirectory;
8570 if (is_64bit)
8571 type |= msidbLocatorType64bit;
8573 /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */
8574 r = add_reglocator_entry(hdb, "NewSignature26", 2, "Software\\Wine", "Value11", type);
8575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8577 /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */
8578 r = add_reglocator_entry(hdb, "NewSignature27", 2, "Software\\Wine", "Value10", type);
8579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8581 /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */
8582 r = add_reglocator_entry(hdb, "NewSignature28", 2, "Software\\Wine", "Value10", type);
8583 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8585 type = msidbLocatorTypeFileName;
8586 if (is_64bit)
8587 type |= msidbLocatorType64bit;
8589 /* HKLM, msidbLocatorTypeFile, file exists, in quotes */
8590 r = add_reglocator_entry(hdb, "NewSignature29", 2, "Software\\Wine", "Value16", type);
8591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8593 /* HKLM, msidbLocatorTypeFile, file exists, no quotes */
8594 r = add_reglocator_entry(hdb, "NewSignature30", 2, "Software\\Wine", "Value17", type);
8595 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8597 r = create_signature_table(hdb);
8598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8600 str = "'NewSignature9', 'FileName1', '', '', '', '', '', '', ''";
8601 r = add_signature_entry(hdb, str);
8602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8604 str = "'NewSignature10', 'FileName2', '', '', '', '', '', '', ''";
8605 r = add_signature_entry(hdb, str);
8606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8608 str = "'NewSignature14', 'FileName1', '', '', '', '', '', '', ''";
8609 r = add_signature_entry(hdb, str);
8610 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8612 str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8613 r = add_signature_entry(hdb, str);
8614 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8616 str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8617 r = add_signature_entry(hdb, str);
8618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8620 str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
8621 r = add_signature_entry(hdb, str);
8622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8624 ptr = strrchr(CURR_DIR, '\\') + 1;
8625 sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr);
8626 r = add_signature_entry(hdb, path);
8627 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8629 str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''";
8630 r = add_signature_entry(hdb, str);
8631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8633 str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''";
8634 r = add_signature_entry(hdb, str);
8635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8637 str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''";
8638 r = add_signature_entry(hdb, str);
8639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8641 r = package_from_db(hdb, &hpkg);
8642 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
8644 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8646 r = MsiDoAction(hpkg, "AppSearch");
8647 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8649 size = MAX_PATH;
8650 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
8651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8652 ok(!lstrcmpA(prop, "regszdata"),
8653 "Expected \"regszdata\", got \"%s\"\n", prop);
8655 size = MAX_PATH;
8656 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
8657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8658 ok(!lstrcmpA(prop, "#42"), "Expected \"#42\", got \"%s\"\n", prop);
8660 size = MAX_PATH;
8661 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
8662 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8663 ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
8665 size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
8666 if (size == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
8668 /* Workaround for Win95 */
8669 CHAR tempbuf[1];
8670 size = ExpandEnvironmentStringsA("%PATH%", tempbuf, 0);
8672 pathvar = HeapAlloc(GetProcessHeap(), 0, size);
8673 ExpandEnvironmentStringsA("%PATH%", pathvar, size);
8675 size = 0;
8676 r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size);
8677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8679 pathdata = HeapAlloc(GetProcessHeap(), 0, ++size);
8680 r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size);
8681 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8682 ok(!lstrcmpA(pathdata, pathvar),
8683 "Expected \"%s\", got \"%s\"\n", pathvar, pathdata);
8685 HeapFree(GetProcessHeap(), 0, pathvar);
8686 HeapFree(GetProcessHeap(), 0, pathdata);
8688 size = MAX_PATH;
8689 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
8690 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8691 ok(!lstrcmpA(prop,
8692 "my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
8694 size = MAX_PATH;
8695 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
8696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8697 todo_wine
8699 ok(!memcmp(prop, "\0one\0two\0\0", 10),
8700 "Expected \"\\0one\\0two\\0\\0\"\n");
8703 size = MAX_PATH;
8704 lstrcpyA(path, "#xCDAB3412EF907856");
8705 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
8706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8707 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8709 size = MAX_PATH;
8710 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
8711 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8712 ok(!lstrcmpA(prop, "##regszdata"),
8713 "Expected \"##regszdata\", got \"%s\"\n", prop);
8715 size = MAX_PATH;
8716 sprintf(path, "%s\\FileName1", CURR_DIR);
8717 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
8718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8719 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8721 size = MAX_PATH;
8722 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
8723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8724 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8726 size = MAX_PATH;
8727 sprintf(path, "%s\\", CURR_DIR);
8728 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
8729 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8730 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8732 size = MAX_PATH;
8733 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
8734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8735 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8737 size = MAX_PATH;
8738 sprintf(path, "%s\\", CURR_DIR);
8739 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
8740 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8741 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8743 size = MAX_PATH;
8744 r = MsiGetPropertyA(hpkg, "SIGPROP14", prop, &size);
8745 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8746 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8748 size = MAX_PATH;
8749 r = MsiGetPropertyA(hpkg, "SIGPROP15", prop, &size);
8750 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8751 ok(!lstrcmpA(prop, "regszdata"),
8752 "Expected \"regszdata\", got \"%s\"\n", prop);
8754 size = MAX_PATH;
8755 r = MsiGetPropertyA(hpkg, "SIGPROP16", prop, &size);
8756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8757 ok(!lstrcmpA(prop, "regszdata"),
8758 "Expected \"regszdata\", got \"%s\"\n", prop);
8760 if (users)
8762 size = MAX_PATH;
8763 r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size);
8764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8765 ok(!lstrcmpA(prop, "regszdata"),
8766 "Expected \"regszdata\", got \"%s\"\n", prop);
8769 size = MAX_PATH;
8770 r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size);
8771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8772 ok(!lstrcmpA(prop, "defvalue"),
8773 "Expected \"defvalue\", got \"%s\"\n", prop);
8775 size = MAX_PATH;
8776 r = MsiGetPropertyA(hpkg, "SIGPROP19", prop, &size);
8777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8778 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8780 size = MAX_PATH;
8781 r = MsiGetPropertyA(hpkg, "SIGPROP20", prop, &size);
8782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8783 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8785 if (version)
8787 size = MAX_PATH;
8788 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8789 r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size);
8790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8791 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8793 size = MAX_PATH;
8794 r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size);
8795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8796 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8798 size = MAX_PATH;
8799 sprintf(path, "%s\\FileName5.dll", CURR_DIR);
8800 r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size);
8801 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8802 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8805 size = MAX_PATH;
8806 lstrcpyA(path, CURR_DIR);
8807 ptr = strrchr(path, '\\') + 1;
8808 *ptr = '\0';
8809 r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
8810 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8811 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8813 size = MAX_PATH;
8814 sprintf(path, "%s\\", CURR_DIR);
8815 r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
8816 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8817 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8819 size = MAX_PATH;
8820 r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
8821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8822 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8824 size = MAX_PATH;
8825 r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size);
8826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8827 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8829 size = MAX_PATH;
8830 r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size);
8831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8832 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8834 size = MAX_PATH;
8835 sprintf(path, "%s\\FileName1", CURR_DIR);
8836 r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size);
8837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8838 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8840 size = MAX_PATH;
8841 sprintf(path, "%s\\FileName1", CURR_DIR);
8842 r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size);
8843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8844 if (space)
8845 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
8846 else
8847 todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
8849 RegSetValueA(hklm, NULL, REG_SZ, "", 0);
8850 RegDeleteValueA(hklm, "Value1");
8851 RegDeleteValueA(hklm, "Value2");
8852 RegDeleteValueA(hklm, "Value3");
8853 RegDeleteValueA(hklm, "Value4");
8854 RegDeleteValueA(hklm, "Value5");
8855 RegDeleteValueA(hklm, "Value6");
8856 RegDeleteValueA(hklm, "Value7");
8857 RegDeleteValueA(hklm, "Value8");
8858 RegDeleteValueA(hklm, "Value9");
8859 RegDeleteValueA(hklm, "Value10");
8860 RegDeleteValueA(hklm, "Value11");
8861 RegDeleteValueA(hklm, "Value12");
8862 RegDeleteValueA(hklm, "Value13");
8863 RegDeleteValueA(hklm, "Value14");
8864 RegDeleteValueA(hklm, "Value15");
8865 RegDeleteValueA(hklm, "Value16");
8866 RegDeleteValueA(hklm, "Value17");
8867 RegDeleteKey(hklm, "");
8868 RegCloseKey(hklm);
8870 RegDeleteValueA(classes, "Value1");
8871 RegDeleteKeyA(classes, "");
8872 RegCloseKey(classes);
8874 RegDeleteValueA(hkcu, "Value1");
8875 RegDeleteKeyA(hkcu, "");
8876 RegCloseKey(hkcu);
8878 RegDeleteValueA(users, "Value1");
8879 RegDeleteKeyA(users, "");
8880 RegCloseKey(users);
8882 DeleteFileA("FileName1");
8883 DeleteFileA("FileName3.dll");
8884 DeleteFileA("FileName4.dll");
8885 DeleteFileA("FileName5.dll");
8886 MsiCloseHandle(hpkg);
8887 DeleteFileA(msifile);
8890 static void delete_win_ini(LPCSTR file)
8892 CHAR path[MAX_PATH];
8894 GetWindowsDirectoryA(path, MAX_PATH);
8895 lstrcatA(path, "\\");
8896 lstrcatA(path, file);
8898 DeleteFileA(path);
8901 static void test_appsearch_inilocator(void)
8903 MSIHANDLE hpkg, hdb;
8904 CHAR path[MAX_PATH];
8905 CHAR prop[MAX_PATH];
8906 BOOL version;
8907 LPCSTR str;
8908 LPSTR ptr;
8909 DWORD size;
8910 UINT r;
8912 version = TRUE;
8913 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
8914 version = FALSE;
8916 DeleteFileA("test.dll");
8918 WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini");
8920 create_test_file("FileName1");
8921 sprintf(path, "%s\\FileName1", CURR_DIR);
8922 WritePrivateProfileStringA("Section", "Key2", path, "IniFile.ini");
8924 WritePrivateProfileStringA("Section", "Key3", CURR_DIR, "IniFile.ini");
8926 sprintf(path, "%s\\IDontExist", CURR_DIR);
8927 WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini");
8929 create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8930 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
8931 WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini");
8933 create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4));
8934 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
8935 WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini");
8937 create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3));
8938 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
8939 WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini");
8941 hdb = create_package_db();
8942 ok(hdb, "Expected a valid database handle\n");
8944 r = create_appsearch_table(hdb);
8945 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8947 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
8948 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8950 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
8951 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8953 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
8954 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8956 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
8957 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8959 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
8960 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8962 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
8963 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8965 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
8966 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8968 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
8969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8971 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
8972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8974 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
8975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8977 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
8978 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8980 r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'");
8981 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8983 r = create_inilocator_table(hdb);
8984 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8986 /* msidbLocatorTypeRawValue, field 1 */
8987 str = "'NewSignature1', 'IniFile.ini', 'Section', 'Key', 1, 2";
8988 r = add_inilocator_entry(hdb, str);
8989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8991 /* msidbLocatorTypeRawValue, field 2 */
8992 str = "'NewSignature2', 'IniFile.ini', 'Section', 'Key', 2, 2";
8993 r = add_inilocator_entry(hdb, str);
8994 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8996 /* msidbLocatorTypeRawValue, entire field */
8997 str = "'NewSignature3', 'IniFile.ini', 'Section', 'Key', 0, 2";
8998 r = add_inilocator_entry(hdb, str);
8999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9001 /* msidbLocatorTypeFile */
9002 str = "'NewSignature4', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9003 r = add_inilocator_entry(hdb, str);
9004 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9006 /* msidbLocatorTypeDirectory, file */
9007 str = "'NewSignature5', 'IniFile.ini', 'Section', 'Key2', 1, 0";
9008 r = add_inilocator_entry(hdb, str);
9009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9011 /* msidbLocatorTypeDirectory, directory */
9012 str = "'NewSignature6', 'IniFile.ini', 'Section', 'Key3', 1, 0";
9013 r = add_inilocator_entry(hdb, str);
9014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9016 /* msidbLocatorTypeFile, file, no signature */
9017 str = "'NewSignature7', 'IniFile.ini', 'Section', 'Key2', 1, 1";
9018 r = add_inilocator_entry(hdb, str);
9019 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9021 /* msidbLocatorTypeFile, dir, no signature */
9022 str = "'NewSignature8', 'IniFile.ini', 'Section', 'Key3', 1, 1";
9023 r = add_inilocator_entry(hdb, str);
9024 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9026 /* msidbLocatorTypeFile, file does not exist */
9027 str = "'NewSignature9', 'IniFile.ini', 'Section', 'Key4', 1, 1";
9028 r = add_inilocator_entry(hdb, str);
9029 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9031 /* msidbLocatorTypeFile, signature with version */
9032 str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1";
9033 r = add_inilocator_entry(hdb, str);
9034 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9036 /* msidbLocatorTypeFile, signature with version, ver > max */
9037 str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1";
9038 r = add_inilocator_entry(hdb, str);
9039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9041 /* msidbLocatorTypeFile, signature with version, sig->name ignored */
9042 str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1";
9043 r = add_inilocator_entry(hdb, str);
9044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9046 r = create_signature_table(hdb);
9047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9049 r = add_signature_entry(hdb, "'NewSignature4', 'FileName1', '', '', '', '', '', '', ''");
9050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9052 r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''");
9053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9055 r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9058 r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9059 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9061 r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''");
9062 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9064 r = package_from_db(hdb, &hpkg);
9065 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9067 skip("Not enough rights to perform tests\n");
9068 goto error;
9070 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9072 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9074 r = MsiDoAction(hpkg, "AppSearch");
9075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9077 size = MAX_PATH;
9078 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9079 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9080 ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
9082 size = MAX_PATH;
9083 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9085 ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
9087 size = MAX_PATH;
9088 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9090 ok(!lstrcmpA(prop, "keydata,field2"),
9091 "Expected \"keydata,field2\", got \"%s\"\n", prop);
9093 size = MAX_PATH;
9094 sprintf(path, "%s\\FileName1", CURR_DIR);
9095 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9097 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9099 size = MAX_PATH;
9100 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9102 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9104 size = MAX_PATH;
9105 sprintf(path, "%s\\", CURR_DIR);
9106 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9108 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9110 size = MAX_PATH;
9111 sprintf(path, "%s\\", CURR_DIR);
9112 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9113 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9114 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9116 size = MAX_PATH;
9117 lstrcpyA(path, CURR_DIR);
9118 ptr = strrchr(path, '\\');
9119 *(ptr + 1) = '\0';
9120 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9122 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9124 size = MAX_PATH;
9125 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9127 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9129 if (version)
9131 size = MAX_PATH;
9132 sprintf(path, "%s\\FileName2.dll", CURR_DIR);
9133 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9134 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9135 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9137 size = MAX_PATH;
9138 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9140 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9142 size = MAX_PATH;
9143 sprintf(path, "%s\\FileName4.dll", CURR_DIR);
9144 r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
9145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9146 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9149 MsiCloseHandle(hpkg);
9151 error:
9152 delete_win_ini("IniFile.ini");
9153 DeleteFileA("FileName1");
9154 DeleteFileA("FileName2.dll");
9155 DeleteFileA("FileName3.dll");
9156 DeleteFileA("FileName4.dll");
9157 DeleteFileA(msifile);
9161 * MSI AppSearch action on DrLocator table always returns absolute paths.
9162 * If a relative path was set, it returns the first absolute path that
9163 * matches or an empty string if it didn't find anything.
9164 * This helper function replicates this behaviour.
9166 static void search_absolute_directory(LPSTR absolute, LPCSTR relative)
9168 int i, size;
9169 DWORD attr, drives;
9171 size = lstrlenA(relative);
9172 drives = GetLogicalDrives();
9173 lstrcpyA(absolute, "A:\\");
9174 for (i = 0; i < 26; absolute[0] = '\0', i++)
9176 if (!(drives & (1 << i)))
9177 continue;
9179 absolute[0] = 'A' + i;
9180 if (GetDriveType(absolute) != DRIVE_FIXED)
9181 continue;
9183 lstrcpynA(absolute + 3, relative, size + 1);
9184 attr = GetFileAttributesA(absolute);
9185 if (attr != INVALID_FILE_ATTRIBUTES &&
9186 (attr & FILE_ATTRIBUTE_DIRECTORY))
9188 if (absolute[3 + size - 1] != '\\')
9189 lstrcatA(absolute, "\\");
9190 break;
9192 absolute[3] = '\0';
9196 static void test_appsearch_drlocator(void)
9198 MSIHANDLE hpkg, hdb;
9199 CHAR path[MAX_PATH];
9200 CHAR prop[MAX_PATH];
9201 BOOL version;
9202 LPCSTR str;
9203 DWORD size;
9204 UINT r;
9206 version = TRUE;
9207 if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3)))
9208 version = FALSE;
9210 DeleteFileA("test.dll");
9212 create_test_file("FileName1");
9213 CreateDirectoryA("one", NULL);
9214 CreateDirectoryA("one\\two", NULL);
9215 CreateDirectoryA("one\\two\\three", NULL);
9216 create_test_file("one\\two\\three\\FileName2");
9217 CreateDirectoryA("another", NULL);
9218 create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9219 create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4));
9220 create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3));
9222 hdb = create_package_db();
9223 ok(hdb, "Expected a valid database handle\n");
9225 r = create_appsearch_table(hdb);
9226 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9228 r = add_appsearch_entry(hdb, "'SIGPROP1', 'NewSignature1'");
9229 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9231 r = add_appsearch_entry(hdb, "'SIGPROP2', 'NewSignature2'");
9232 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9234 r = add_appsearch_entry(hdb, "'SIGPROP3', 'NewSignature3'");
9235 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9237 r = add_appsearch_entry(hdb, "'SIGPROP4', 'NewSignature4'");
9238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9240 r = add_appsearch_entry(hdb, "'SIGPROP5', 'NewSignature5'");
9241 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9243 r = add_appsearch_entry(hdb, "'SIGPROP6', 'NewSignature6'");
9244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9246 r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'");
9247 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9249 r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'");
9250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9252 r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'");
9253 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9255 r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'");
9256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9258 r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'");
9259 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9261 r = add_appsearch_entry(hdb, "'SIGPROP13', 'NewSignature13'");
9262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9264 r = create_drlocator_table(hdb);
9265 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9267 /* no parent, full path, depth 0, signature */
9268 sprintf(path, "'NewSignature1', '', '%s', 0", CURR_DIR);
9269 r = add_drlocator_entry(hdb, path);
9270 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9272 /* no parent, full path, depth 0, no signature */
9273 sprintf(path, "'NewSignature2', '', '%s', 0", CURR_DIR);
9274 r = add_drlocator_entry(hdb, path);
9275 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9277 /* no parent, relative path, depth 0, no signature */
9278 sprintf(path, "'NewSignature3', '', '%s', 0", CURR_DIR + 3);
9279 r = add_drlocator_entry(hdb, path);
9280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9282 /* no parent, full path, depth 2, signature */
9283 sprintf(path, "'NewSignature4', '', '%s', 2", CURR_DIR);
9284 r = add_drlocator_entry(hdb, path);
9285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9287 /* no parent, full path, depth 3, signature */
9288 sprintf(path, "'NewSignature5', '', '%s', 3", CURR_DIR);
9289 r = add_drlocator_entry(hdb, path);
9290 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9292 /* no parent, full path, depth 1, signature is dir */
9293 sprintf(path, "'NewSignature6', '', '%s', 1", CURR_DIR);
9294 r = add_drlocator_entry(hdb, path);
9295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9297 /* parent is in DrLocator, relative path, depth 0, signature */
9298 sprintf(path, "'NewSignature7', 'NewSignature1', 'one\\two\\three', 1");
9299 r = add_drlocator_entry(hdb, path);
9300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9302 /* no parent, full path, depth 0, signature w/ version */
9303 sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR);
9304 r = add_drlocator_entry(hdb, path);
9305 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9307 /* no parent, full path, depth 0, signature w/ version, ver > max */
9308 sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR);
9309 r = add_drlocator_entry(hdb, path);
9310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9312 /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */
9313 sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR);
9314 r = add_drlocator_entry(hdb, path);
9315 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9317 /* no parent, relative empty path, depth 0, no signature */
9318 sprintf(path, "'NewSignature11', '', '', 0");
9319 r = add_drlocator_entry(hdb, path);
9320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9322 r = create_reglocator_table(hdb);
9323 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9325 /* parent */
9326 r = add_reglocator_entry(hdb, "NewSignature12", 2, "htmlfile\\shell\\open\\nonexistent", "", 1);
9327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9329 /* parent is in RegLocator, no path, depth 0, no signature */
9330 sprintf(path, "'NewSignature13', 'NewSignature12', '', 0");
9331 r = add_drlocator_entry(hdb, path);
9332 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9334 r = create_signature_table(hdb);
9335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9337 str = "'NewSignature1', 'FileName1', '', '', '', '', '', '', ''";
9338 r = add_signature_entry(hdb, str);
9339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9341 str = "'NewSignature4', 'FileName2', '', '', '', '', '', '', ''";
9342 r = add_signature_entry(hdb, str);
9343 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9345 str = "'NewSignature5', 'FileName2', '', '', '', '', '', '', ''";
9346 r = add_signature_entry(hdb, str);
9347 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9349 str = "'NewSignature6', 'another', '', '', '', '', '', '', ''";
9350 r = add_signature_entry(hdb, str);
9351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9353 str = "'NewSignature7', 'FileName2', '', '', '', '', '', '', ''";
9354 r = add_signature_entry(hdb, str);
9355 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9357 str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9358 r = add_signature_entry(hdb, str);
9359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9361 str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9362 r = add_signature_entry(hdb, str);
9363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9365 str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''";
9366 r = add_signature_entry(hdb, str);
9367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9369 r = package_from_db(hdb, &hpkg);
9370 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9372 skip("Not enough rights to perform tests\n");
9373 goto error;
9375 ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
9377 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9379 r = MsiDoAction(hpkg, "AppSearch");
9380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9382 size = MAX_PATH;
9383 sprintf(path, "%s\\FileName1", CURR_DIR);
9384 r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
9385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9386 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9388 size = MAX_PATH;
9389 sprintf(path, "%s\\", CURR_DIR);
9390 r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
9391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9392 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9394 size = MAX_PATH;
9395 search_absolute_directory(path, CURR_DIR + 3);
9396 r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
9397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9398 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9400 size = MAX_PATH;
9401 r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
9402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9403 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9405 size = MAX_PATH;
9406 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9407 r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
9408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9409 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9411 size = MAX_PATH;
9412 r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
9413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9414 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9416 size = MAX_PATH;
9417 sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
9418 r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
9419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9420 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9422 if (version)
9424 size = MAX_PATH;
9425 sprintf(path, "%s\\FileName3.dll", CURR_DIR);
9426 r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
9427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9428 ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9430 size = MAX_PATH;
9431 r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);
9432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9433 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9435 size = MAX_PATH;
9436 r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size);
9437 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9438 ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
9441 size = MAX_PATH;
9442 search_absolute_directory(path, "");
9443 r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
9444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9445 ok(!lstrcmpiA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
9447 size = MAX_PATH;
9448 strcpy(path, "c:\\");
9449 r = MsiGetPropertyA(hpkg, "SIGPROP13", prop, &size);
9450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
9451 ok(!prop[0], "Expected \"\", got \"%s\"\n", prop);
9453 MsiCloseHandle(hpkg);
9455 error:
9456 DeleteFileA("FileName1");
9457 DeleteFileA("FileName3.dll");
9458 DeleteFileA("FileName4.dll");
9459 DeleteFileA("FileName5.dll");
9460 DeleteFileA("one\\two\\three\\FileName2");
9461 RemoveDirectoryA("one\\two\\three");
9462 RemoveDirectoryA("one\\two");
9463 RemoveDirectoryA("one");
9464 RemoveDirectoryA("another");
9465 DeleteFileA(msifile);
9468 static void test_featureparents(void)
9470 MSIHANDLE hpkg;
9471 UINT r;
9472 MSIHANDLE hdb;
9473 INSTALLSTATE state, action;
9475 hdb = create_package_db();
9476 ok ( hdb, "failed to create package database\n" );
9478 r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'");
9479 ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
9481 r = create_feature_table( hdb );
9482 ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r );
9484 r = create_component_table( hdb );
9485 ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r );
9487 r = create_feature_components_table( hdb );
9488 ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
9490 r = create_file_table( hdb );
9491 ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
9493 /* msidbFeatureAttributesFavorLocal */
9494 r = add_feature_entry( hdb, "'zodiac', '', '', '', 2, 1, '', 0" );
9495 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9497 /* msidbFeatureAttributesFavorSource */
9498 r = add_feature_entry( hdb, "'perseus', '', '', '', 2, 1, '', 1" );
9499 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9501 /* msidbFeatureAttributesFavorLocal */
9502 r = add_feature_entry( hdb, "'orion', '', '', '', 2, 1, '', 0" );
9503 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9505 /* disabled because of install level */
9506 r = add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" );
9507 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9509 /* child feature of disabled feature */
9510 r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
9511 ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
9513 /* component of disabled feature (install level) */
9514 r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
9515 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9517 /* component of disabled child feature (install level) */
9518 r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
9519 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9521 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9522 r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
9523 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9525 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9526 r = add_component_entry( hdb, "'virgo', '', 'TARGETDIR', 1, '', 'virgo_file'" );
9527 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9529 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9530 r = add_component_entry( hdb, "'libra', '', 'TARGETDIR', 2, '', 'libra_file'" );
9531 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9533 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */
9534 r = add_component_entry( hdb, "'cassiopeia', '', 'TARGETDIR', 0, '', 'cassiopeia_file'" );
9535 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9537 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
9538 r = add_component_entry( hdb, "'cepheus', '', 'TARGETDIR', 1, '', 'cepheus_file'" );
9539 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9541 /* msidbFeatureAttributesFavorSource:msidbComponentAttributesOptional */
9542 r = add_component_entry( hdb, "'andromeda', '', 'TARGETDIR', 2, '', 'andromeda_file'" );
9543 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9545 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
9546 r = add_component_entry( hdb, "'canis', '', 'TARGETDIR', 0, '', 'canis_file'" );
9547 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9549 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSourceOnly */
9550 r = add_component_entry( hdb, "'monoceros', '', 'TARGETDIR', 1, '', 'monoceros_file'" );
9551 ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
9553 /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesOptional */
9554 r = add_component_entry( hdb, "'lepus', '', 'TARGETDIR', 2, '', 'lepus_file'" );
9556 r = add_feature_components_entry( hdb, "'zodiac', 'leo'" );
9557 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9559 r = add_feature_components_entry( hdb, "'zodiac', 'virgo'" );
9560 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9562 r = add_feature_components_entry( hdb, "'zodiac', 'libra'" );
9563 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9565 r = add_feature_components_entry( hdb, "'perseus', 'cassiopeia'" );
9566 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9568 r = add_feature_components_entry( hdb, "'perseus', 'cepheus'" );
9569 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9571 r = add_feature_components_entry( hdb, "'perseus', 'andromeda'" );
9572 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9574 r = add_feature_components_entry( hdb, "'orion', 'leo'" );
9575 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9577 r = add_feature_components_entry( hdb, "'orion', 'virgo'" );
9578 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9580 r = add_feature_components_entry( hdb, "'orion', 'libra'" );
9581 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9583 r = add_feature_components_entry( hdb, "'orion', 'cassiopeia'" );
9584 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9586 r = add_feature_components_entry( hdb, "'orion', 'cepheus'" );
9587 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9589 r = add_feature_components_entry( hdb, "'orion', 'andromeda'" );
9590 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9592 r = add_feature_components_entry( hdb, "'orion', 'canis'" );
9593 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9595 r = add_feature_components_entry( hdb, "'orion', 'monoceros'" );
9596 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9598 r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
9599 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9601 r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
9602 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9604 r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
9605 ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
9607 r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
9608 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9610 r = add_file_entry( hdb, "'virgo_file', 'virgo', 'virgo.txt', 0, '', '1033', 8192, 1" );
9611 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9613 r = add_file_entry( hdb, "'libra_file', 'libra', 'libra.txt', 0, '', '1033', 8192, 1" );
9614 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9616 r = add_file_entry( hdb, "'cassiopeia_file', 'cassiopeia', 'cassiopeia.txt', 0, '', '1033', 8192, 1" );
9617 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9619 r = add_file_entry( hdb, "'cepheus_file', 'cepheus', 'cepheus.txt', 0, '', '1033', 8192, 1" );
9620 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9622 r = add_file_entry( hdb, "'andromeda_file', 'andromeda', 'andromeda.txt', 0, '', '1033', 8192, 1" );
9623 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9625 r = add_file_entry( hdb, "'canis_file', 'canis', 'canis.txt', 0, '', '1033', 8192, 1" );
9626 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9628 r = add_file_entry( hdb, "'monoceros_file', 'monoceros', 'monoceros.txt', 0, '', '1033', 8192, 1" );
9629 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9631 r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
9632 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9634 r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
9635 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9637 r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
9638 ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
9640 r = package_from_db( hdb, &hpkg );
9641 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9643 skip("Not enough rights to perform tests\n");
9644 DeleteFile(msifile);
9645 return;
9647 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9649 MsiCloseHandle( hdb );
9651 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9653 r = MsiDoAction( hpkg, "CostInitialize");
9654 ok( r == ERROR_SUCCESS, "cost init failed\n");
9656 r = MsiDoAction( hpkg, "FileCost");
9657 ok( r == ERROR_SUCCESS, "file cost failed\n");
9659 r = MsiDoAction( hpkg, "CostFinalize");
9660 ok( r == ERROR_SUCCESS, "cost finalize failed\n");
9662 state = 0xdeadbee;
9663 action = 0xdeadbee;
9664 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9665 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9666 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9667 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9669 state = 0xdeadbee;
9670 action = 0xdeadbee;
9671 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9672 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9673 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9674 ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
9676 state = 0xdeadbee;
9677 action = 0xdeadbee;
9678 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9679 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9680 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9681 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9683 state = 0xdeadbee;
9684 action = 0xdeadbee;
9685 r = MsiGetFeatureState(hpkg, "waters", &state, &action);
9686 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9687 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9688 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9690 state = 0xdeadbee;
9691 action = 0xdeadbee;
9692 r = MsiGetFeatureState(hpkg, "bayer", &state, &action);
9693 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9694 ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
9695 ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
9697 state = 0xdeadbee;
9698 action = 0xdeadbee;
9699 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9700 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9701 ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
9702 ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
9704 state = 0xdeadbee;
9705 action = 0xdeadbee;
9706 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9707 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9708 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9709 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9711 state = 0xdeadbee;
9712 action = 0xdeadbee;
9713 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9714 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9715 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9716 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9718 state = 0xdeadbee;
9719 action = 0xdeadbee;
9720 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9721 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9722 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9723 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9725 state = 0xdeadbee;
9726 action = 0xdeadbee;
9727 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9728 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9729 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9730 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9732 state = 0xdeadbee;
9733 action = 0xdeadbee;
9734 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9735 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9736 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9737 ok( action == INSTALLSTATE_LOCAL, "Expected andromeda INSTALLSTATE_LOCAL, got %d\n", action);
9739 state = 0xdeadbee;
9740 action = 0xdeadbee;
9741 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9742 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9743 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9744 ok( action == INSTALLSTATE_LOCAL, "Expected canis INSTALLSTATE_LOCAL, got %d\n", action);
9746 state = 0xdeadbee;
9747 action = 0xdeadbee;
9748 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9749 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9750 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9751 ok( action == INSTALLSTATE_SOURCE, "Expected monoceros INSTALLSTATE_SOURCE, got %d\n", action);
9753 state = 0xdeadbee;
9754 action = 0xdeadbee;
9755 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9756 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9757 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9758 ok( action == INSTALLSTATE_LOCAL, "Expected lepus INSTALLSTATE_LOCAL, got %d\n", action);
9760 state = 0xdeadbee;
9761 action = 0xdeadbee;
9762 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9763 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9764 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9765 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9767 state = 0xdeadbee;
9768 action = 0xdeadbee;
9769 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9770 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9771 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9772 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9774 r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
9775 ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
9777 r = MsiSetFeatureState(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT);
9778 ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r);
9780 state = 0xdeadbee;
9781 action = 0xdeadbee;
9782 r = MsiGetFeatureState(hpkg, "zodiac", &state, &action);
9783 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9784 ok( state == INSTALLSTATE_ABSENT, "Expected zodiac INSTALLSTATE_ABSENT, got %d\n", state);
9785 ok( action == INSTALLSTATE_LOCAL, "Expected zodiac INSTALLSTATE_LOCAL, got %d\n", action);
9787 state = 0xdeadbee;
9788 action = 0xdeadbee;
9789 r = MsiGetFeatureState(hpkg, "perseus", &state, &action);
9790 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9791 ok( state == INSTALLSTATE_ABSENT, "Expected perseus INSTALLSTATE_ABSENT, got %d\n", state);
9792 ok( action == INSTALLSTATE_SOURCE, "Expected perseus INSTALLSTATE_SOURCE, got %d\n", action);
9794 state = 0xdeadbee;
9795 action = 0xdeadbee;
9796 r = MsiGetFeatureState(hpkg, "orion", &state, &action);
9797 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9798 ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
9799 ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
9801 state = 0xdeadbee;
9802 action = 0xdeadbee;
9803 r = MsiGetComponentState(hpkg, "leo", &state, &action);
9804 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9805 ok( state == INSTALLSTATE_UNKNOWN, "Expected leo INSTALLSTATE_UNKNOWN, got %d\n", state);
9806 ok( action == INSTALLSTATE_LOCAL, "Expected leo INSTALLSTATE_LOCAL, got %d\n", action);
9808 state = 0xdeadbee;
9809 action = 0xdeadbee;
9810 r = MsiGetComponentState(hpkg, "virgo", &state, &action);
9811 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9812 ok( state == INSTALLSTATE_UNKNOWN, "Expected virgo INSTALLSTATE_UNKNOWN, got %d\n", state);
9813 ok( action == INSTALLSTATE_SOURCE, "Expected virgo INSTALLSTATE_SOURCE, got %d\n", action);
9815 state = 0xdeadbee;
9816 action = 0xdeadbee;
9817 r = MsiGetComponentState(hpkg, "libra", &state, &action);
9818 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9819 ok( state == INSTALLSTATE_UNKNOWN, "Expected libra INSTALLSTATE_UNKNOWN, got %d\n", state);
9820 ok( action == INSTALLSTATE_LOCAL, "Expected libra INSTALLSTATE_LOCAL, got %d\n", action);
9822 state = 0xdeadbee;
9823 action = 0xdeadbee;
9824 r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
9825 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9826 ok( state == INSTALLSTATE_UNKNOWN, "Expected cassiopeia INSTALLSTATE_UNKNOWN, got %d\n", state);
9827 ok( action == INSTALLSTATE_LOCAL, "Expected cassiopeia INSTALLSTATE_LOCAL, got %d\n", action);
9829 state = 0xdeadbee;
9830 action = 0xdeadbee;
9831 r = MsiGetComponentState(hpkg, "cepheus", &state, &action);
9832 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9833 ok( state == INSTALLSTATE_UNKNOWN, "Expected cepheus INSTALLSTATE_UNKNOWN, got %d\n", state);
9834 ok( action == INSTALLSTATE_SOURCE, "Expected cepheus INSTALLSTATE_SOURCE, got %d\n", action);
9836 state = 0xdeadbee;
9837 action = 0xdeadbee;
9838 r = MsiGetComponentState(hpkg, "andromeda", &state, &action);
9839 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9840 ok( state == INSTALLSTATE_UNKNOWN, "Expected andromeda INSTALLSTATE_UNKNOWN, got %d\n", state);
9841 ok( action == INSTALLSTATE_SOURCE, "Expected andromeda INSTALLSTATE_SOURCE, got %d\n", action);
9843 state = 0xdeadbee;
9844 action = 0xdeadbee;
9845 r = MsiGetComponentState(hpkg, "canis", &state, &action);
9846 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9847 ok( state == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", state);
9848 ok( action == INSTALLSTATE_UNKNOWN, "Expected canis INSTALLSTATE_UNKNOWN, got %d\n", action);
9850 state = 0xdeadbee;
9851 action = 0xdeadbee;
9852 r = MsiGetComponentState(hpkg, "monoceros", &state, &action);
9853 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9854 ok( state == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", state);
9855 ok( action == INSTALLSTATE_UNKNOWN, "Expected monoceros INSTALLSTATE_UNKNOWN, got %d\n", action);
9857 state = 0xdeadbee;
9858 action = 0xdeadbee;
9859 r = MsiGetComponentState(hpkg, "lepus", &state, &action);
9860 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9861 ok( state == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", state);
9862 ok( action == INSTALLSTATE_UNKNOWN, "Expected lepus INSTALLSTATE_UNKNOWN, got %d\n", action);
9864 state = 0xdeadbee;
9865 action = 0xdeadbee;
9866 r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
9867 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9868 ok( state == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", state);
9869 ok( action == INSTALLSTATE_UNKNOWN, "Expected delphinus INSTALLSTATE_UNKNOWN, got %d\n", action);
9871 state = 0xdeadbee;
9872 action = 0xdeadbee;
9873 r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
9874 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
9875 ok( state == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", state);
9876 ok( action == INSTALLSTATE_UNKNOWN, "Expected hydrus INSTALLSTATE_UNKNOWN, got %d\n", action);
9878 MsiCloseHandle(hpkg);
9879 DeleteFileA(msifile);
9882 static void test_installprops(void)
9884 MSIHANDLE hpkg, hdb;
9885 CHAR path[MAX_PATH], buf[MAX_PATH];
9886 DWORD size, type;
9887 LANGID langid;
9888 HKEY hkey1, hkey2;
9889 int res;
9890 UINT r;
9891 REGSAM access = KEY_ALL_ACCESS;
9892 SYSTEM_INFO si;
9894 if (is_wow64)
9895 access |= KEY_WOW64_64KEY;
9897 GetCurrentDirectory(MAX_PATH, path);
9898 lstrcat(path, "\\");
9899 lstrcat(path, msifile);
9901 hdb = create_package_db();
9902 ok( hdb, "failed to create database\n");
9904 r = package_from_db(hdb, &hpkg);
9905 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9907 skip("Not enough rights to perform tests\n");
9908 DeleteFile(msifile);
9909 return;
9911 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
9913 MsiCloseHandle(hdb);
9915 size = MAX_PATH;
9916 r = MsiGetProperty(hpkg, "DATABASE", buf, &size);
9917 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9918 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9920 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
9921 RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
9923 size = MAX_PATH;
9924 type = REG_SZ;
9925 *path = '\0';
9926 if (RegQueryValueEx(hkey1, "DefName", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9928 size = MAX_PATH;
9929 type = REG_SZ;
9930 RegQueryValueEx(hkey2, "RegisteredOwner", NULL, &type, (LPBYTE)path, &size);
9933 /* win9x doesn't set this */
9934 if (*path)
9936 size = MAX_PATH;
9937 r = MsiGetProperty(hpkg, "USERNAME", buf, &size);
9938 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9939 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9942 size = MAX_PATH;
9943 type = REG_SZ;
9944 *path = '\0';
9945 if (RegQueryValueEx(hkey1, "DefCompany", NULL, &type, (LPBYTE)path, &size) != ERROR_SUCCESS)
9947 size = MAX_PATH;
9948 type = REG_SZ;
9949 RegQueryValueEx(hkey2, "RegisteredOrganization", NULL, &type, (LPBYTE)path, &size);
9952 if (*path)
9954 size = MAX_PATH;
9955 r = MsiGetProperty(hpkg, "COMPANYNAME", buf, &size);
9956 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9957 ok( !lstrcmp(buf, path), "Expected %s, got %s\n", path, buf);
9960 size = MAX_PATH;
9961 r = MsiGetProperty(hpkg, "VersionDatabase", buf, &size);
9962 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9963 trace("VersionDatabase = %s\n", buf);
9965 size = MAX_PATH;
9966 r = MsiGetProperty(hpkg, "VersionMsi", buf, &size);
9967 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9968 trace("VersionMsi = %s\n", buf);
9970 size = MAX_PATH;
9971 r = MsiGetProperty(hpkg, "Date", buf, &size);
9972 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9973 trace("Date = %s\n", buf);
9975 size = MAX_PATH;
9976 r = MsiGetProperty(hpkg, "Time", buf, &size);
9977 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9978 trace("Time = %s\n", buf);
9980 size = MAX_PATH;
9981 r = MsiGetProperty(hpkg, "PackageCode", buf, &size);
9982 ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
9983 trace("PackageCode = %s\n", buf);
9985 langid = GetUserDefaultLangID();
9986 sprintf(path, "%d", langid);
9988 size = MAX_PATH;
9989 r = MsiGetProperty(hpkg, "UserLanguageID", buf, &size);
9990 ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS< got %d\n", r);
9991 ok( !lstrcmpA(buf, path), "Expected \"%s\", got \"%s\"\n", path, buf);
9993 res = GetSystemMetrics(SM_CXSCREEN);
9994 size = MAX_PATH;
9995 r = MsiGetProperty(hpkg, "ScreenX", buf, &size);
9996 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
9998 res = GetSystemMetrics(SM_CYSCREEN);
9999 size = MAX_PATH;
10000 r = MsiGetProperty(hpkg, "ScreenY", buf, &size);
10001 ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
10003 if (pGetSystemInfo && pSHGetFolderPathA)
10005 pGetSystemInfo(&si);
10006 if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
10008 buf[0] = 0;
10009 size = MAX_PATH;
10010 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10011 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10012 ok(buf[0], "property not set\n");
10014 buf[0] = 0;
10015 size = MAX_PATH;
10016 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10017 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10018 ok(buf[0], "property not set\n");
10020 buf[0] = 0;
10021 size = MAX_PATH;
10022 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10023 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10024 GetSystemDirectoryA(path, MAX_PATH);
10025 if (size) buf[size - 1] = 0;
10026 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10028 buf[0] = 0;
10029 size = MAX_PATH;
10030 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10031 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10032 pGetSystemWow64DirectoryA(path, MAX_PATH);
10033 if (size) buf[size - 1] = 0;
10034 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10036 buf[0] = 0;
10037 size = MAX_PATH;
10038 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10039 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10040 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10041 if (size) buf[size - 1] = 0;
10042 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10044 buf[0] = 0;
10045 size = MAX_PATH;
10046 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10047 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10048 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10049 if (size) buf[size - 1] = 0;
10050 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10052 buf[0] = 0;
10053 size = MAX_PATH;
10054 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10055 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10056 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10057 if (size) buf[size - 1] = 0;
10058 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10060 buf[0] = 0;
10061 size = MAX_PATH;
10062 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10063 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10064 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10065 if (size) buf[size - 1] = 0;
10066 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10068 buf[0] = 0;
10069 size = MAX_PATH;
10070 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10071 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10072 ok(buf[0], "property not set\n");
10074 else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
10076 if (!is_wow64)
10078 buf[0] = 0;
10079 size = MAX_PATH;
10080 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10081 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10082 ok(!buf[0], "property set\n");
10084 buf[0] = 0;
10085 size = MAX_PATH;
10086 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10087 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10088 ok(!buf[0], "property set\n");
10090 buf[0] = 0;
10091 size = MAX_PATH;
10092 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10093 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10094 ok(!buf[0], "property set\n");
10096 buf[0] = 0;
10097 size = MAX_PATH;
10098 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10099 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10100 GetSystemDirectoryA(path, MAX_PATH);
10101 if (size) buf[size - 1] = 0;
10102 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10104 buf[0] = 0;
10105 size = MAX_PATH;
10106 r = MsiGetProperty(hpkg, "ProgramFiles64Folder", buf, &size);
10107 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10108 ok(!buf[0], "property set\n");
10110 buf[0] = 0;
10111 size = MAX_PATH;
10112 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10113 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10114 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
10115 if (size) buf[size - 1] = 0;
10116 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10118 buf[0] = 0;
10119 size = MAX_PATH;
10120 r = MsiGetProperty(hpkg, "CommonFiles64Folder", buf, &size);
10121 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10122 ok(!buf[0], "property set\n");
10124 buf[0] = 0;
10125 size = MAX_PATH;
10126 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10127 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10128 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, path);
10129 if (size) buf[size - 1] = 0;
10130 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10132 buf[0] = 0;
10133 size = MAX_PATH;
10134 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10135 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10136 ok(!buf[0], "property set\n");
10138 else
10140 buf[0] = 0;
10141 size = MAX_PATH;
10142 r = MsiGetProperty(hpkg, "MsiAMD64", buf, &size);
10143 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10144 ok(buf[0], "property not set\n");
10146 buf[0] = 0;
10147 size = MAX_PATH;
10148 r = MsiGetProperty(hpkg, "Msix64", buf, &size);
10149 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10150 ok(buf[0], "property not set\n");
10152 buf[0] = 0;
10153 size = MAX_PATH;
10154 r = MsiGetProperty(hpkg, "System64Folder", buf, &size);
10155 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10156 GetSystemDirectoryA(path, MAX_PATH);
10157 if (size) buf[size - 1] = 0;
10158 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10160 buf[0] = 0;
10161 size = MAX_PATH;
10162 r = MsiGetProperty(hpkg, "SystemFolder", buf, &size);
10163 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10164 pGetSystemWow64DirectoryA(path, MAX_PATH);
10165 if (size) buf[size - 1] = 0;
10166 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10168 buf[0] = 0;
10169 size = MAX_PATH;
10170 r = MsiGetProperty(hpkg, "ProgramFilesFolder64", buf, &size);
10171 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10172 ok(!buf[0], "property set\n");
10174 buf[0] = 0;
10175 size = MAX_PATH;
10176 r = MsiGetProperty(hpkg, "ProgramFilesFolder", buf, &size);
10177 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10178 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path);
10179 if (size) buf[size - 1] = 0;
10180 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10182 buf[0] = 0;
10183 size = MAX_PATH;
10184 r = MsiGetProperty(hpkg, "CommonFilesFolder64", buf, &size);
10185 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10186 ok(!buf[0], "property set\n");
10188 buf[0] = 0;
10189 size = MAX_PATH;
10190 r = MsiGetProperty(hpkg, "CommonFilesFolder", buf, &size);
10191 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10192 pSHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, path);
10193 if (size) buf[size - 1] = 0;
10194 ok(!lstrcmpiA(path, buf), "expected \"%s\", got \"%s\"\n", path, buf);
10196 buf[0] = 0;
10197 size = MAX_PATH;
10198 r = MsiGetProperty(hpkg, "VersionNT64", buf, &size);
10199 ok(r == ERROR_SUCCESS, "failed to get property: %d\n", r);
10200 ok(buf[0], "property not set\n");
10205 CloseHandle(hkey1);
10206 CloseHandle(hkey2);
10207 MsiCloseHandle(hpkg);
10208 DeleteFile(msifile);
10211 static void test_launchconditions(void)
10213 MSIHANDLE hpkg;
10214 MSIHANDLE hdb;
10215 UINT r;
10217 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10219 hdb = create_package_db();
10220 ok( hdb, "failed to create package database\n" );
10222 r = create_launchcondition_table( hdb );
10223 ok( r == ERROR_SUCCESS, "cannot create LaunchCondition table: %d\n", r );
10225 r = add_launchcondition_entry( hdb, "'X = \"1\"', 'one'" );
10226 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10228 /* invalid condition */
10229 r = add_launchcondition_entry( hdb, "'X != \"1\"', 'one'" );
10230 ok( r == ERROR_SUCCESS, "cannot add launch condition: %d\n", r );
10232 r = package_from_db( hdb, &hpkg );
10233 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10235 skip("Not enough rights to perform tests\n");
10236 DeleteFile(msifile);
10237 return;
10239 ok( r == ERROR_SUCCESS, "failed to create package %u\n", r );
10241 MsiCloseHandle( hdb );
10243 r = MsiSetProperty( hpkg, "X", "1" );
10244 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10246 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10248 /* invalid conditions are ignored */
10249 r = MsiDoAction( hpkg, "LaunchConditions" );
10250 ok( r == ERROR_SUCCESS, "cost init failed\n" );
10252 /* verify LaunchConditions still does some verification */
10253 r = MsiSetProperty( hpkg, "X", "2" );
10254 ok( r == ERROR_SUCCESS, "failed to set property\n" );
10256 r = MsiDoAction( hpkg, "LaunchConditions" );
10257 ok( r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r );
10259 MsiCloseHandle( hpkg );
10260 DeleteFile( msifile );
10263 static void test_ccpsearch(void)
10265 MSIHANDLE hdb, hpkg;
10266 CHAR prop[MAX_PATH];
10267 DWORD size = MAX_PATH;
10268 UINT r;
10270 hdb = create_package_db();
10271 ok(hdb, "failed to create package database\n");
10273 r = create_ccpsearch_table(hdb);
10274 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10276 r = add_ccpsearch_entry(hdb, "'CCP_random'");
10277 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10279 r = add_ccpsearch_entry(hdb, "'RMCCP_random'");
10280 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10282 r = create_reglocator_table(hdb);
10283 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10285 r = add_reglocator_entry(hdb, "CCP_random", 0, "htmlfile\\shell\\open\\nonexistent", "", 1);
10286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10288 r = create_drlocator_table(hdb);
10289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10291 r = add_drlocator_entry(hdb, "'RMCCP_random', '', 'C:\\', '0'");
10292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10294 r = create_signature_table(hdb);
10295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10297 r = package_from_db(hdb, &hpkg);
10298 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10300 skip("Not enough rights to perform tests\n");
10301 DeleteFile(msifile);
10302 return;
10304 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10306 MsiCloseHandle(hdb);
10308 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10310 r = MsiDoAction(hpkg, "CCPSearch");
10311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10313 r = MsiGetPropertyA(hpkg, "CCP_Success", prop, &size);
10314 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10315 ok(!lstrcmpA(prop, "1"), "Expected 1, got %s\n", prop);
10317 MsiCloseHandle(hpkg);
10318 DeleteFileA(msifile);
10321 static void test_complocator(void)
10323 MSIHANDLE hdb, hpkg;
10324 UINT r;
10325 CHAR prop[MAX_PATH];
10326 CHAR expected[MAX_PATH];
10327 DWORD size = MAX_PATH;
10329 hdb = create_package_db();
10330 ok(hdb, "failed to create package database\n");
10332 r = create_appsearch_table(hdb);
10333 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10335 r = add_appsearch_entry(hdb, "'ABELISAURUS', 'abelisaurus'");
10336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10338 r = add_appsearch_entry(hdb, "'BACTROSAURUS', 'bactrosaurus'");
10339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10341 r = add_appsearch_entry(hdb, "'CAMELOTIA', 'camelotia'");
10342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10344 r = add_appsearch_entry(hdb, "'DICLONIUS', 'diclonius'");
10345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10347 r = add_appsearch_entry(hdb, "'ECHINODON', 'echinodon'");
10348 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10350 r = add_appsearch_entry(hdb, "'FALCARIUS', 'falcarius'");
10351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10353 r = add_appsearch_entry(hdb, "'GALLIMIMUS', 'gallimimus'");
10354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10356 r = add_appsearch_entry(hdb, "'HAGRYPHUS', 'hagryphus'");
10357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10359 r = add_appsearch_entry(hdb, "'IGUANODON', 'iguanodon'");
10360 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10362 r = add_appsearch_entry(hdb, "'JOBARIA', 'jobaria'");
10363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10365 r = add_appsearch_entry(hdb, "'KAKURU', 'kakuru'");
10366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10368 r = add_appsearch_entry(hdb, "'LABOCANIA', 'labocania'");
10369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10371 r = add_appsearch_entry(hdb, "'MEGARAPTOR', 'megaraptor'");
10372 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10374 r = add_appsearch_entry(hdb, "'NEOSODON', 'neosodon'");
10375 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10377 r = add_appsearch_entry(hdb, "'OLOROTITAN', 'olorotitan'");
10378 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10380 r = add_appsearch_entry(hdb, "'PANTYDRACO', 'pantydraco'");
10381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10383 r = create_complocator_table(hdb);
10384 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10386 r = add_complocator_entry(hdb, "'abelisaurus', '{E3619EED-305A-418C-B9C7-F7D7377F0934}', 1");
10387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10389 r = add_complocator_entry(hdb, "'bactrosaurus', '{D56B688D-542F-42Ef-90FD-B6DA76EE8119}', 0");
10390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10392 r = add_complocator_entry(hdb, "'camelotia', '{8211BE36-2466-47E3-AFB7-6AC72E51AED2}', 1");
10393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10395 r = add_complocator_entry(hdb, "'diclonius', '{5C767B20-A33C-45A4-B80B-555E512F01AE}', 0");
10396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10398 r = add_complocator_entry(hdb, "'echinodon', '{A19E16C5-C75D-4699-8111-C4338C40C3CB}', 1");
10399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10401 r = add_complocator_entry(hdb, "'falcarius', '{17762FA1-A7AE-4CC6-8827-62873C35361D}', 0");
10402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10404 r = add_complocator_entry(hdb, "'gallimimus', '{75EBF568-C959-41E0-A99E-9050638CF5FB}', 1");
10405 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10407 r = add_complocator_entry(hdb, "'hagrphus', '{D4969B72-17D9-4AB6-BE49-78F2FEE857AC}', 0");
10408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10410 r = add_complocator_entry(hdb, "'iguanodon', '{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}', 1");
10411 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10413 r = add_complocator_entry(hdb, "'jobaria', '{243C22B1-8C51-4151-B9D1-1AE5265E079E}', 0");
10414 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10416 r = add_complocator_entry(hdb, "'kakuru', '{5D0F03BA-50BC-44F2-ABB1-72C972F4E514}', 1");
10417 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10419 r = add_complocator_entry(hdb, "'labocania', '{C7DDB60C-7828-4046-A6F8-699D5E92F1ED}', 0");
10420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10422 r = add_complocator_entry(hdb, "'megaraptor', '{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}', 1");
10423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10425 r = add_complocator_entry(hdb, "'neosodon', '{0B499649-197A-48EF-93D2-AF1C17ED6E90}', 0");
10426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10428 r = add_complocator_entry(hdb, "'olorotitan', '{54E9E91F-AED2-46D5-A25A-7E50AFA24513}', 1");
10429 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10431 r = add_complocator_entry(hdb, "'pantydraco', '{2A989951-5565-4FA7-93A7-E800A3E67D71}', 0");
10432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10434 r = create_signature_table(hdb);
10435 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10437 r = add_signature_entry(hdb, "'abelisaurus', 'abelisaurus', '', '', '', '', '', '', ''");
10438 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10440 r = add_signature_entry(hdb, "'bactrosaurus', 'bactrosaurus', '', '', '', '', '', '', ''");
10441 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10443 r = add_signature_entry(hdb, "'camelotia', 'camelotia', '', '', '', '', '', '', ''");
10444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10446 r = add_signature_entry(hdb, "'diclonius', 'diclonius', '', '', '', '', '', '', ''");
10447 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10449 r = add_signature_entry(hdb, "'iguanodon', 'iguanodon', '', '', '', '', '', '', ''");
10450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10452 r = add_signature_entry(hdb, "'jobaria', 'jobaria', '', '', '', '', '', '', ''");
10453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10455 r = add_signature_entry(hdb, "'kakuru', 'kakuru', '', '', '', '', '', '', ''");
10456 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10458 r = add_signature_entry(hdb, "'labocania', 'labocania', '', '', '', '', '', '', ''");
10459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10461 r = package_from_db(hdb, &hpkg);
10462 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10464 skip("Not enough rights to perform tests\n");
10465 DeleteFile(msifile);
10466 return;
10468 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10470 MsiCloseHandle(hdb);
10472 create_test_file("abelisaurus");
10473 create_test_file("bactrosaurus");
10474 create_test_file("camelotia");
10475 create_test_file("diclonius");
10476 create_test_file("echinodon");
10477 create_test_file("falcarius");
10478 create_test_file("gallimimus");
10479 create_test_file("hagryphus");
10480 CreateDirectoryA("iguanodon", NULL);
10481 CreateDirectoryA("jobaria", NULL);
10482 CreateDirectoryA("kakuru", NULL);
10483 CreateDirectoryA("labocania", NULL);
10484 CreateDirectoryA("megaraptor", NULL);
10485 CreateDirectoryA("neosodon", NULL);
10486 CreateDirectoryA("olorotitan", NULL);
10487 CreateDirectoryA("pantydraco", NULL);
10489 set_component_path("abelisaurus", MSIINSTALLCONTEXT_MACHINE,
10490 "{E3619EED-305A-418C-B9C7-F7D7377F0934}", NULL, FALSE);
10491 set_component_path("bactrosaurus", MSIINSTALLCONTEXT_MACHINE,
10492 "{D56B688D-542F-42Ef-90FD-B6DA76EE8119}", NULL, FALSE);
10493 set_component_path("echinodon", MSIINSTALLCONTEXT_MACHINE,
10494 "{A19E16C5-C75D-4699-8111-C4338C40C3CB}", NULL, FALSE);
10495 set_component_path("falcarius", MSIINSTALLCONTEXT_MACHINE,
10496 "{17762FA1-A7AE-4CC6-8827-62873C35361D}", NULL, FALSE);
10497 set_component_path("iguanodon", MSIINSTALLCONTEXT_MACHINE,
10498 "{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}", NULL, FALSE);
10499 set_component_path("jobaria", MSIINSTALLCONTEXT_MACHINE,
10500 "{243C22B1-8C51-4151-B9D1-1AE5265E079E}", NULL, FALSE);
10501 set_component_path("megaraptor", MSIINSTALLCONTEXT_MACHINE,
10502 "{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}", NULL, FALSE);
10503 set_component_path("neosodon", MSIINSTALLCONTEXT_MACHINE,
10504 "{0B499649-197A-48EF-93D2-AF1C17ED6E90}", NULL, FALSE);
10506 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10508 r = MsiDoAction(hpkg, "AppSearch");
10509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10511 size = MAX_PATH;
10512 r = MsiGetPropertyA(hpkg, "ABELISAURUS", prop, &size);
10513 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10515 lstrcpyA(expected, CURR_DIR);
10516 lstrcatA(expected, "\\abelisaurus");
10517 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10518 "Expected %s or empty string, got %s\n", expected, prop);
10520 size = MAX_PATH;
10521 r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
10522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10523 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10525 size = MAX_PATH;
10526 r = MsiGetPropertyA(hpkg, "CAMELOTIA", prop, &size);
10527 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10528 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10530 size = MAX_PATH;
10531 r = MsiGetPropertyA(hpkg, "DICLONIUS", prop, &size);
10532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10533 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10535 size = MAX_PATH;
10536 r = MsiGetPropertyA(hpkg, "ECHINODON", prop, &size);
10537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10539 lstrcpyA(expected, CURR_DIR);
10540 lstrcatA(expected, "\\");
10541 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10542 "Expected %s or empty string, got %s\n", expected, prop);
10544 size = MAX_PATH;
10545 r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
10546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10547 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10549 size = MAX_PATH;
10550 r = MsiGetPropertyA(hpkg, "GALLIMIMUS", prop, &size);
10551 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10552 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10554 size = MAX_PATH;
10555 r = MsiGetPropertyA(hpkg, "HAGRYPHUS", prop, &size);
10556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10557 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10559 size = MAX_PATH;
10560 r = MsiGetPropertyA(hpkg, "IGUANODON", prop, &size);
10561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10562 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10564 size = MAX_PATH;
10565 r = MsiGetPropertyA(hpkg, "JOBARIA", prop, &size);
10566 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10567 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10569 size = MAX_PATH;
10570 r = MsiGetPropertyA(hpkg, "KAKURU", prop, &size);
10571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10572 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10574 size = MAX_PATH;
10575 r = MsiGetPropertyA(hpkg, "LABOCANIA", prop, &size);
10576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10577 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10579 size = MAX_PATH;
10580 r = MsiGetPropertyA(hpkg, "MEGARAPTOR", prop, &size);
10581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10583 lstrcpyA(expected, CURR_DIR);
10584 lstrcatA(expected, "\\");
10585 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10586 "Expected %s or empty string, got %s\n", expected, prop);
10588 size = MAX_PATH;
10589 r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
10590 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10592 lstrcpyA(expected, CURR_DIR);
10593 lstrcatA(expected, "\\neosodon\\");
10594 ok(!lstrcmpA(prop, expected) || !lstrcmpA(prop, ""),
10595 "Expected %s or empty string, got %s\n", expected, prop);
10597 size = MAX_PATH;
10598 r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
10599 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10600 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10602 size = MAX_PATH;
10603 r = MsiGetPropertyA(hpkg, "PANTYDRACO", prop, &size);
10604 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10605 ok(!lstrcmpA(prop, ""), "Expected , got %s\n", prop);
10607 MsiCloseHandle(hpkg);
10608 DeleteFileA("abelisaurus");
10609 DeleteFileA("bactrosaurus");
10610 DeleteFileA("camelotia");
10611 DeleteFileA("diclonius");
10612 DeleteFileA("echinodon");
10613 DeleteFileA("falcarius");
10614 DeleteFileA("gallimimus");
10615 DeleteFileA("hagryphus");
10616 RemoveDirectoryA("iguanodon");
10617 RemoveDirectoryA("jobaria");
10618 RemoveDirectoryA("kakuru");
10619 RemoveDirectoryA("labocania");
10620 RemoveDirectoryA("megaraptor");
10621 RemoveDirectoryA("neosodon");
10622 RemoveDirectoryA("olorotitan");
10623 RemoveDirectoryA("pantydraco");
10624 delete_component_path("{E3619EED-305A-418C-B9C7-F7D7377F0934}",
10625 MSIINSTALLCONTEXT_MACHINE, NULL);
10626 delete_component_path("{D56B688D-542F-42Ef-90FD-B6DA76EE8119}",
10627 MSIINSTALLCONTEXT_MACHINE, NULL);
10628 delete_component_path("{A19E16C5-C75D-4699-8111-C4338C40C3CB}",
10629 MSIINSTALLCONTEXT_MACHINE, NULL);
10630 delete_component_path("{17762FA1-A7AE-4CC6-8827-62873C35361D}",
10631 MSIINSTALLCONTEXT_MACHINE, NULL);
10632 delete_component_path("{8E0DA02E-F6A7-4A8F-B25D-6F564C492308}",
10633 MSIINSTALLCONTEXT_MACHINE, NULL);
10634 delete_component_path("{243C22B1-8C51-4151-B9D1-1AE5265E079E}",
10635 MSIINSTALLCONTEXT_MACHINE, NULL);
10636 delete_component_path("{8B1034B7-BD5E-41ac-B52C-0105D3DFD74D}",
10637 MSIINSTALLCONTEXT_MACHINE, NULL);
10638 delete_component_path("{0B499649-197A-48EF-93D2-AF1C17ED6E90}",
10639 MSIINSTALLCONTEXT_MACHINE, NULL);
10640 DeleteFileA(msifile);
10643 static void set_suminfo_prop(MSIHANDLE db, DWORD prop, DWORD val)
10645 MSIHANDLE summary;
10646 UINT r;
10648 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
10649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10651 r = MsiSummaryInfoSetPropertyA(summary, prop, VT_I4, val, NULL, NULL);
10652 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10654 r = MsiSummaryInfoPersist(summary);
10655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10657 MsiCloseHandle(summary);
10660 static void test_MsiGetSourcePath(void)
10662 MSIHANDLE hdb, hpkg;
10663 CHAR path[MAX_PATH];
10664 CHAR cwd[MAX_PATH];
10665 CHAR subsrc[MAX_PATH];
10666 CHAR sub2[MAX_PATH];
10667 DWORD size;
10668 UINT r;
10670 lstrcpyA(cwd, CURR_DIR);
10671 lstrcatA(cwd, "\\");
10673 lstrcpyA(subsrc, cwd);
10674 lstrcatA(subsrc, "subsource");
10675 lstrcatA(subsrc, "\\");
10677 lstrcpyA(sub2, subsrc);
10678 lstrcatA(sub2, "sub2");
10679 lstrcatA(sub2, "\\");
10681 /* uncompressed source */
10683 hdb = create_package_db();
10684 ok( hdb, "failed to create database\n");
10686 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
10688 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
10689 ok(r == S_OK, "failed\n");
10691 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'subtarget:subsource'");
10692 ok(r == S_OK, "failed\n");
10694 r = add_directory_entry(hdb, "'SubDir2', 'SubDir', 'sub2'");
10695 ok(r == S_OK, "failed\n");
10697 r = MsiDatabaseCommit(hdb);
10698 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
10700 r = package_from_db(hdb, &hpkg);
10701 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10703 skip("Not enough rights to perform tests\n");
10704 DeleteFile(msifile);
10705 return;
10707 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
10709 MsiCloseHandle(hdb);
10711 /* invalid database handle */
10712 size = MAX_PATH;
10713 lstrcpyA(path, "kiwi");
10714 r = MsiGetSourcePath(-1, "TARGETDIR", path, &size);
10715 ok(r == ERROR_INVALID_HANDLE,
10716 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
10717 ok(!lstrcmpA(path, "kiwi"),
10718 "Expected path to be unchanged, got \"%s\"\n", path);
10719 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10721 /* NULL szFolder */
10722 size = MAX_PATH;
10723 lstrcpyA(path, "kiwi");
10724 r = MsiGetSourcePath(hpkg, NULL, path, &size);
10725 ok(r == ERROR_INVALID_PARAMETER,
10726 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
10727 ok(!lstrcmpA(path, "kiwi"),
10728 "Expected path to be unchanged, got \"%s\"\n", path);
10729 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10731 /* empty szFolder */
10732 size = MAX_PATH;
10733 lstrcpyA(path, "kiwi");
10734 r = MsiGetSourcePath(hpkg, "", path, &size);
10735 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10736 ok(!lstrcmpA(path, "kiwi"),
10737 "Expected path to be unchanged, got \"%s\"\n", path);
10738 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10740 /* try TARGETDIR */
10741 size = MAX_PATH;
10742 lstrcpyA(path, "kiwi");
10743 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10744 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10745 ok(!lstrcmpA(path, "kiwi"),
10746 "Expected path to be unchanged, got \"%s\"\n", path);
10747 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10749 size = MAX_PATH;
10750 lstrcpyA(path, "kiwi");
10751 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10753 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10754 ok(size == 0, "Expected 0, got %d\n", size);
10756 size = MAX_PATH;
10757 lstrcpyA(path, "kiwi");
10758 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10760 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10761 ok(size == 0, "Expected 0, got %d\n", size);
10763 /* try SourceDir */
10764 size = MAX_PATH;
10765 lstrcpyA(path, "kiwi");
10766 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10767 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10768 ok(!lstrcmpA(path, "kiwi"),
10769 "Expected path to be unchanged, got \"%s\"\n", path);
10770 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10772 /* try SOURCEDIR */
10773 size = MAX_PATH;
10774 lstrcpyA(path, "kiwi");
10775 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10776 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10777 ok(!lstrcmpA(path, "kiwi"),
10778 "Expected path to be unchanged, got \"%s\"\n", path);
10779 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10781 /* source path does not exist, but the property exists */
10782 size = MAX_PATH;
10783 lstrcpyA(path, "kiwi");
10784 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
10785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10786 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10787 ok(size == 0, "Expected 0, got %d\n", size);
10789 size = MAX_PATH;
10790 lstrcpyA(path, "kiwi");
10791 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10793 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
10794 ok(size == 0, "Expected 0, got %d\n", size);
10796 /* try SubDir */
10797 size = MAX_PATH;
10798 lstrcpyA(path, "kiwi");
10799 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10800 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10801 ok(!lstrcmpA(path, "kiwi"),
10802 "Expected path to be unchanged, got \"%s\"\n", path);
10803 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10805 /* try SubDir2 */
10806 size = MAX_PATH;
10807 lstrcpyA(path, "kiwi");
10808 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10809 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10810 ok(!lstrcmpA(path, "kiwi"),
10811 "Expected path to be unchanged, got \"%s\"\n", path);
10812 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10814 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10816 r = MsiDoAction(hpkg, "CostInitialize");
10817 ok(r == ERROR_SUCCESS, "cost init failed\n");
10819 /* try TARGETDIR after CostInitialize */
10820 size = MAX_PATH;
10821 lstrcpyA(path, "kiwi");
10822 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10824 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10825 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10827 /* try SourceDir after CostInitialize */
10828 size = MAX_PATH;
10829 lstrcpyA(path, "kiwi");
10830 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10831 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10832 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10833 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10835 /* try SOURCEDIR after CostInitialize */
10836 size = MAX_PATH;
10837 lstrcpyA(path, "kiwi");
10838 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10839 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10840 ok(!lstrcmpA(path, "kiwi"),
10841 "Expected path to be unchanged, got \"%s\"\n", path);
10842 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10844 /* source path does not exist, but the property exists */
10845 size = MAX_PATH;
10846 lstrcpyA(path, "kiwi");
10847 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10848 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10849 todo_wine
10851 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10852 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10855 /* try SubDir after CostInitialize */
10856 size = MAX_PATH;
10857 lstrcpyA(path, "kiwi");
10858 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10859 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10860 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10861 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10863 /* try SubDir2 after CostInitialize */
10864 size = MAX_PATH;
10865 lstrcpyA(path, "kiwi");
10866 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10868 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10869 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10871 r = MsiDoAction(hpkg, "ResolveSource");
10872 ok(r == ERROR_SUCCESS, "file cost failed\n");
10874 /* try TARGETDIR after ResolveSource */
10875 size = MAX_PATH;
10876 lstrcpyA(path, "kiwi");
10877 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10879 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10880 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10882 /* try SourceDir after ResolveSource */
10883 size = MAX_PATH;
10884 lstrcpyA(path, "kiwi");
10885 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10886 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10887 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10888 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10890 /* try SOURCEDIR after ResolveSource */
10891 size = MAX_PATH;
10892 lstrcpyA(path, "kiwi");
10893 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10894 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10895 ok(!lstrcmpA(path, "kiwi"),
10896 "Expected path to be unchanged, got \"%s\"\n", path);
10897 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10899 /* source path does not exist, but the property exists */
10900 size = MAX_PATH;
10901 lstrcpyA(path, "kiwi");
10902 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10904 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10905 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10907 /* try SubDir after ResolveSource */
10908 size = MAX_PATH;
10909 lstrcpyA(path, "kiwi");
10910 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10911 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10912 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10913 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10915 /* try SubDir2 after ResolveSource */
10916 size = MAX_PATH;
10917 lstrcpyA(path, "kiwi");
10918 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10919 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10920 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10921 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10923 r = MsiDoAction(hpkg, "FileCost");
10924 ok(r == ERROR_SUCCESS, "file cost failed\n");
10926 /* try TARGETDIR after FileCost */
10927 size = MAX_PATH;
10928 lstrcpyA(path, "kiwi");
10929 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10930 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10931 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10932 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10934 /* try SourceDir after FileCost */
10935 size = MAX_PATH;
10936 lstrcpyA(path, "kiwi");
10937 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10939 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10940 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10942 /* try SOURCEDIR after FileCost */
10943 size = MAX_PATH;
10944 lstrcpyA(path, "kiwi");
10945 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10946 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10947 ok(!lstrcmpA(path, "kiwi"),
10948 "Expected path to be unchanged, got \"%s\"\n", path);
10949 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
10951 /* source path does not exist, but the property exists */
10952 size = MAX_PATH;
10953 lstrcpyA(path, "kiwi");
10954 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
10955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10956 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10957 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10959 /* try SubDir after FileCost */
10960 size = MAX_PATH;
10961 lstrcpyA(path, "kiwi");
10962 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
10963 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10964 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
10965 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
10967 /* try SubDir2 after FileCost */
10968 size = MAX_PATH;
10969 lstrcpyA(path, "kiwi");
10970 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
10971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10972 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
10973 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
10975 r = MsiDoAction(hpkg, "CostFinalize");
10976 ok(r == ERROR_SUCCESS, "file cost failed\n");
10978 /* try TARGETDIR after CostFinalize */
10979 size = MAX_PATH;
10980 lstrcpyA(path, "kiwi");
10981 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
10982 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10983 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10984 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10986 /* try SourceDir after CostFinalize */
10987 size = MAX_PATH;
10988 lstrcpyA(path, "kiwi");
10989 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
10990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
10991 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
10992 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
10994 /* try SOURCEDIR after CostFinalize */
10995 size = MAX_PATH;
10996 lstrcpyA(path, "kiwi");
10997 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
10998 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
10999 ok(!lstrcmpA(path, "kiwi"),
11000 "Expected path to be unchanged, got \"%s\"\n", path);
11001 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11003 /* source path does not exist, but the property exists */
11004 size = MAX_PATH;
11005 lstrcpyA(path, "kiwi");
11006 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11008 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11009 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11011 /* try SubDir after CostFinalize */
11012 size = MAX_PATH;
11013 lstrcpyA(path, "kiwi");
11014 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11016 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11017 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11019 /* try SubDir2 after CostFinalize */
11020 size = MAX_PATH;
11021 lstrcpyA(path, "kiwi");
11022 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11024 ok(!lstrcmpA(path, sub2), "Expected \"%s\", got \"%s\"\n", sub2, path);
11025 ok(size == lstrlenA(sub2), "Expected %d, got %d\n", lstrlenA(sub2), size);
11027 /* nonexistent directory */
11028 size = MAX_PATH;
11029 lstrcpyA(path, "kiwi");
11030 r = MsiGetSourcePath(hpkg, "IDontExist", path, &size);
11031 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11032 ok(!lstrcmpA(path, "kiwi"),
11033 "Expected path to be unchanged, got \"%s\"\n", path);
11034 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11036 /* NULL szPathBuf */
11037 size = MAX_PATH;
11038 r = MsiGetSourcePath(hpkg, "SourceDir", NULL, &size);
11039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11040 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11042 /* NULL pcchPathBuf */
11043 lstrcpyA(path, "kiwi");
11044 r = MsiGetSourcePath(hpkg, "SourceDir", path, NULL);
11045 ok(r == ERROR_INVALID_PARAMETER,
11046 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
11047 ok(!lstrcmpA(path, "kiwi"),
11048 "Expected path to be unchanged, got \"%s\"\n", path);
11050 /* pcchPathBuf is 0 */
11051 size = 0;
11052 lstrcpyA(path, "kiwi");
11053 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11054 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11055 ok(!lstrcmpA(path, "kiwi"),
11056 "Expected path to be unchanged, got \"%s\"\n", path);
11057 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11059 /* pcchPathBuf does not have room for NULL terminator */
11060 size = lstrlenA(cwd);
11061 lstrcpyA(path, "kiwi");
11062 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11063 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
11064 ok(!strncmp(path, cwd, lstrlenA(cwd) - 1),
11065 "Expected path with no backslash, got \"%s\"\n", path);
11066 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11068 /* pcchPathBuf has room for NULL terminator */
11069 size = lstrlenA(cwd) + 1;
11070 lstrcpyA(path, "kiwi");
11071 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11073 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11074 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11076 /* remove property */
11077 r = MsiSetProperty(hpkg, "SourceDir", NULL);
11078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11080 /* try SourceDir again */
11081 size = MAX_PATH;
11082 lstrcpyA(path, "kiwi");
11083 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11085 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11086 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11088 /* set property to a valid directory */
11089 r = MsiSetProperty(hpkg, "SOURCEDIR", cwd);
11090 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11092 /* try SOURCEDIR again */
11093 size = MAX_PATH;
11094 lstrcpyA(path, "kiwi");
11095 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11096 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11097 ok(!lstrcmpA(path, "kiwi"),
11098 "Expected path to be unchanged, got \"%s\"\n", path);
11099 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11101 MsiCloseHandle(hpkg);
11103 /* compressed source */
11105 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11108 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeCompressed);
11110 r = package_from_db(hdb, &hpkg);
11111 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11113 /* try TARGETDIR */
11114 size = MAX_PATH;
11115 lstrcpyA(path, "kiwi");
11116 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11117 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11118 ok(!lstrcmpA(path, "kiwi"),
11119 "Expected path to be unchanged, got \"%s\"\n", path);
11120 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11122 /* try SourceDir */
11123 size = MAX_PATH;
11124 lstrcpyA(path, "kiwi");
11125 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11126 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11127 ok(!lstrcmpA(path, "kiwi"),
11128 "Expected path to be unchanged, got \"%s\"\n", path);
11129 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11131 /* try SOURCEDIR */
11132 size = MAX_PATH;
11133 lstrcpyA(path, "kiwi");
11134 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11135 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11136 ok(!lstrcmpA(path, "kiwi"),
11137 "Expected path to be unchanged, got \"%s\"\n", path);
11138 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11140 /* source path nor the property exist */
11141 size = MAX_PATH;
11142 lstrcpyA(path, "kiwi");
11143 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11145 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11146 ok(size == 0, "Expected 0, got %d\n", size);
11148 /* try SubDir */
11149 size = MAX_PATH;
11150 lstrcpyA(path, "kiwi");
11151 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11152 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11153 ok(!lstrcmpA(path, "kiwi"),
11154 "Expected path to be unchanged, got \"%s\"\n", path);
11155 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11157 /* try SubDir2 */
11158 size = MAX_PATH;
11159 lstrcpyA(path, "kiwi");
11160 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11161 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11162 ok(!lstrcmpA(path, "kiwi"),
11163 "Expected path to be unchanged, got \"%s\"\n", path);
11164 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11166 r = MsiDoAction(hpkg, "CostInitialize");
11167 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11169 /* try TARGETDIR after CostInitialize */
11170 size = MAX_PATH;
11171 lstrcpyA(path, "kiwi");
11172 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11173 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11174 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11175 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11177 /* try SourceDir after CostInitialize */
11178 size = MAX_PATH;
11179 lstrcpyA(path, "kiwi");
11180 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11182 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11183 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11185 /* try SOURCEDIR after CostInitialize */
11186 size = MAX_PATH;
11187 lstrcpyA(path, "kiwi");
11188 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11189 todo_wine
11191 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11192 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11193 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11196 /* source path does not exist, but the property exists */
11197 size = MAX_PATH;
11198 lstrcpyA(path, "kiwi");
11199 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11200 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11201 todo_wine
11203 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11204 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11207 /* try SubDir after CostInitialize */
11208 size = MAX_PATH;
11209 lstrcpyA(path, "kiwi");
11210 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11211 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11212 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11213 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11215 /* try SubDir2 after CostInitialize */
11216 size = MAX_PATH;
11217 lstrcpyA(path, "kiwi");
11218 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11220 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11221 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11223 r = MsiDoAction(hpkg, "ResolveSource");
11224 ok(r == ERROR_SUCCESS, "file cost failed\n");
11226 /* try TARGETDIR after ResolveSource */
11227 size = MAX_PATH;
11228 lstrcpyA(path, "kiwi");
11229 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11230 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11231 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11232 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11234 /* try SourceDir after ResolveSource */
11235 size = MAX_PATH;
11236 lstrcpyA(path, "kiwi");
11237 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11239 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11240 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11242 /* try SOURCEDIR after ResolveSource */
11243 size = MAX_PATH;
11244 lstrcpyA(path, "kiwi");
11245 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11246 todo_wine
11248 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11249 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11250 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11253 /* source path and the property exist */
11254 size = MAX_PATH;
11255 lstrcpyA(path, "kiwi");
11256 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11257 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11258 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11259 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11261 /* try SubDir after ResolveSource */
11262 size = MAX_PATH;
11263 lstrcpyA(path, "kiwi");
11264 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11265 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11266 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11267 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11269 /* try SubDir2 after ResolveSource */
11270 size = MAX_PATH;
11271 lstrcpyA(path, "kiwi");
11272 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11273 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11274 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11275 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11277 r = MsiDoAction(hpkg, "FileCost");
11278 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11280 /* try TARGETDIR after CostFinalize */
11281 size = MAX_PATH;
11282 lstrcpyA(path, "kiwi");
11283 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11284 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11285 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11286 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11288 /* try SourceDir after CostFinalize */
11289 size = MAX_PATH;
11290 lstrcpyA(path, "kiwi");
11291 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11293 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11294 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11296 /* try SOURCEDIR after CostFinalize */
11297 size = MAX_PATH;
11298 lstrcpyA(path, "kiwi");
11299 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11300 todo_wine
11302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11303 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11304 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11307 /* source path and the property exist */
11308 size = MAX_PATH;
11309 lstrcpyA(path, "kiwi");
11310 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11311 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11312 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11313 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11315 /* try SubDir after CostFinalize */
11316 size = MAX_PATH;
11317 lstrcpyA(path, "kiwi");
11318 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11320 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11321 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11323 /* try SubDir2 after CostFinalize */
11324 size = MAX_PATH;
11325 lstrcpyA(path, "kiwi");
11326 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11327 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11328 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11329 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11331 r = MsiDoAction(hpkg, "CostFinalize");
11332 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11334 /* try TARGETDIR after CostFinalize */
11335 size = MAX_PATH;
11336 lstrcpyA(path, "kiwi");
11337 r = MsiGetSourcePath(hpkg, "TARGETDIR", path, &size);
11338 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11339 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11340 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11342 /* try SourceDir after CostFinalize */
11343 size = MAX_PATH;
11344 lstrcpyA(path, "kiwi");
11345 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11347 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11348 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11350 /* try SOURCEDIR after CostFinalize */
11351 size = MAX_PATH;
11352 lstrcpyA(path, "kiwi");
11353 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11354 todo_wine
11356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11357 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11358 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11361 /* source path and the property exist */
11362 size = MAX_PATH;
11363 lstrcpyA(path, "kiwi");
11364 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11366 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11367 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11369 /* try SubDir after CostFinalize */
11370 size = MAX_PATH;
11371 lstrcpyA(path, "kiwi");
11372 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11373 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11374 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11375 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11377 /* try SubDir2 after CostFinalize */
11378 size = MAX_PATH;
11379 lstrcpyA(path, "kiwi");
11380 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11381 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11382 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11383 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11385 MsiCloseHandle(hpkg);
11386 DeleteFile(msifile);
11389 static void test_shortlongsource(void)
11391 MSIHANDLE hdb, hpkg;
11392 CHAR path[MAX_PATH];
11393 CHAR cwd[MAX_PATH];
11394 CHAR subsrc[MAX_PATH];
11395 DWORD size;
11396 UINT r;
11398 lstrcpyA(cwd, CURR_DIR);
11399 lstrcatA(cwd, "\\");
11401 lstrcpyA(subsrc, cwd);
11402 lstrcatA(subsrc, "long");
11403 lstrcatA(subsrc, "\\");
11405 /* long file names */
11407 hdb = create_package_db();
11408 ok( hdb, "failed to create database\n");
11410 set_suminfo_prop(hdb, PID_WORDCOUNT, 0);
11412 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11413 ok(r == S_OK, "failed\n");
11415 r = add_directory_entry(hdb, "'SubDir', 'TARGETDIR', 'short|long'");
11416 ok(r == S_OK, "failed\n");
11418 /* CostInitialize:short */
11419 r = add_directory_entry(hdb, "'SubDir2', 'TARGETDIR', 'one|two'");
11420 ok(r == S_OK, "failed\n");
11422 /* CostInitialize:long */
11423 r = add_directory_entry(hdb, "'SubDir3', 'TARGETDIR', 'three|four'");
11424 ok(r == S_OK, "failed\n");
11426 /* FileCost:short */
11427 r = add_directory_entry(hdb, "'SubDir4', 'TARGETDIR', 'five|six'");
11428 ok(r == S_OK, "failed\n");
11430 /* FileCost:long */
11431 r = add_directory_entry(hdb, "'SubDir5', 'TARGETDIR', 'seven|eight'");
11432 ok(r == S_OK, "failed\n");
11434 /* CostFinalize:short */
11435 r = add_directory_entry(hdb, "'SubDir6', 'TARGETDIR', 'nine|ten'");
11436 ok(r == S_OK, "failed\n");
11438 /* CostFinalize:long */
11439 r = add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
11440 ok(r == S_OK, "failed\n");
11442 MsiDatabaseCommit(hdb);
11444 r = package_from_db(hdb, &hpkg);
11445 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11447 skip("Not enough rights to perform tests\n");
11448 DeleteFile(msifile);
11449 return;
11451 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11453 MsiCloseHandle(hdb);
11455 CreateDirectoryA("one", NULL);
11456 CreateDirectoryA("four", NULL);
11458 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11460 r = MsiDoAction(hpkg, "CostInitialize");
11461 ok(r == ERROR_SUCCESS, "file cost failed\n");
11463 CreateDirectory("five", NULL);
11464 CreateDirectory("eight", NULL);
11466 r = MsiDoAction(hpkg, "FileCost");
11467 ok(r == ERROR_SUCCESS, "file cost failed\n");
11469 CreateDirectory("nine", NULL);
11470 CreateDirectory("twelve", NULL);
11472 r = MsiDoAction(hpkg, "CostFinalize");
11473 ok(r == ERROR_SUCCESS, "file cost failed\n");
11475 /* neither short nor long source directories exist */
11476 size = MAX_PATH;
11477 lstrcpyA(path, "kiwi");
11478 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11480 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11481 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11483 CreateDirectoryA("short", NULL);
11485 /* short source directory exists */
11486 size = MAX_PATH;
11487 lstrcpyA(path, "kiwi");
11488 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11490 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11491 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11493 CreateDirectoryA("long", NULL);
11495 /* both short and long source directories exist */
11496 size = MAX_PATH;
11497 lstrcpyA(path, "kiwi");
11498 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11499 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11500 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11501 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11503 lstrcpyA(subsrc, cwd);
11504 lstrcatA(subsrc, "two");
11505 lstrcatA(subsrc, "\\");
11507 /* short dir exists before CostInitialize */
11508 size = MAX_PATH;
11509 lstrcpyA(path, "kiwi");
11510 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11512 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11513 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11515 lstrcpyA(subsrc, cwd);
11516 lstrcatA(subsrc, "four");
11517 lstrcatA(subsrc, "\\");
11519 /* long dir exists before CostInitialize */
11520 size = MAX_PATH;
11521 lstrcpyA(path, "kiwi");
11522 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11523 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11524 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11525 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11527 lstrcpyA(subsrc, cwd);
11528 lstrcatA(subsrc, "six");
11529 lstrcatA(subsrc, "\\");
11531 /* short dir exists before FileCost */
11532 size = MAX_PATH;
11533 lstrcpyA(path, "kiwi");
11534 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11536 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11537 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11539 lstrcpyA(subsrc, cwd);
11540 lstrcatA(subsrc, "eight");
11541 lstrcatA(subsrc, "\\");
11543 /* long dir exists before FileCost */
11544 size = MAX_PATH;
11545 lstrcpyA(path, "kiwi");
11546 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11547 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11548 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11549 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11551 lstrcpyA(subsrc, cwd);
11552 lstrcatA(subsrc, "ten");
11553 lstrcatA(subsrc, "\\");
11555 /* short dir exists before CostFinalize */
11556 size = MAX_PATH;
11557 lstrcpyA(path, "kiwi");
11558 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11559 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11560 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11561 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11563 lstrcpyA(subsrc, cwd);
11564 lstrcatA(subsrc, "twelve");
11565 lstrcatA(subsrc, "\\");
11567 /* long dir exists before CostFinalize */
11568 size = MAX_PATH;
11569 lstrcpyA(path, "kiwi");
11570 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11572 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11573 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11575 MsiCloseHandle(hpkg);
11576 RemoveDirectoryA("short");
11577 RemoveDirectoryA("long");
11578 RemoveDirectoryA("one");
11579 RemoveDirectoryA("four");
11580 RemoveDirectoryA("five");
11581 RemoveDirectoryA("eight");
11582 RemoveDirectoryA("nine");
11583 RemoveDirectoryA("twelve");
11585 /* short file names */
11587 r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
11588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11590 set_suminfo_prop(hdb, PID_WORDCOUNT, msidbSumInfoSourceTypeSFN);
11592 r = package_from_db(hdb, &hpkg);
11593 ok(r == ERROR_SUCCESS, "failed to create package %u\n", r);
11595 MsiCloseHandle(hdb);
11597 CreateDirectoryA("one", NULL);
11598 CreateDirectoryA("four", NULL);
11600 r = MsiDoAction(hpkg, "CostInitialize");
11601 ok(r == ERROR_SUCCESS, "file cost failed\n");
11603 CreateDirectory("five", NULL);
11604 CreateDirectory("eight", NULL);
11606 r = MsiDoAction(hpkg, "FileCost");
11607 ok(r == ERROR_SUCCESS, "file cost failed\n");
11609 CreateDirectory("nine", NULL);
11610 CreateDirectory("twelve", NULL);
11612 r = MsiDoAction(hpkg, "CostFinalize");
11613 ok(r == ERROR_SUCCESS, "file cost failed\n");
11615 lstrcpyA(subsrc, cwd);
11616 lstrcatA(subsrc, "short");
11617 lstrcatA(subsrc, "\\");
11619 /* neither short nor long source directories exist */
11620 size = MAX_PATH;
11621 lstrcpyA(path, "kiwi");
11622 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11623 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11624 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11625 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11627 CreateDirectoryA("short", NULL);
11629 /* short source directory exists */
11630 size = MAX_PATH;
11631 lstrcpyA(path, "kiwi");
11632 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11634 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11635 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11637 CreateDirectoryA("long", NULL);
11639 /* both short and long source directories exist */
11640 size = MAX_PATH;
11641 lstrcpyA(path, "kiwi");
11642 r = MsiGetSourcePath(hpkg, "SubDir", path, &size);
11643 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11644 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11645 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11647 lstrcpyA(subsrc, cwd);
11648 lstrcatA(subsrc, "one");
11649 lstrcatA(subsrc, "\\");
11651 /* short dir exists before CostInitialize */
11652 size = MAX_PATH;
11653 lstrcpyA(path, "kiwi");
11654 r = MsiGetSourcePath(hpkg, "SubDir2", path, &size);
11655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11656 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11657 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11659 lstrcpyA(subsrc, cwd);
11660 lstrcatA(subsrc, "three");
11661 lstrcatA(subsrc, "\\");
11663 /* long dir exists before CostInitialize */
11664 size = MAX_PATH;
11665 lstrcpyA(path, "kiwi");
11666 r = MsiGetSourcePath(hpkg, "SubDir3", path, &size);
11667 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11668 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11669 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11671 lstrcpyA(subsrc, cwd);
11672 lstrcatA(subsrc, "five");
11673 lstrcatA(subsrc, "\\");
11675 /* short dir exists before FileCost */
11676 size = MAX_PATH;
11677 lstrcpyA(path, "kiwi");
11678 r = MsiGetSourcePath(hpkg, "SubDir4", path, &size);
11679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11680 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11681 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11683 lstrcpyA(subsrc, cwd);
11684 lstrcatA(subsrc, "seven");
11685 lstrcatA(subsrc, "\\");
11687 /* long dir exists before FileCost */
11688 size = MAX_PATH;
11689 lstrcpyA(path, "kiwi");
11690 r = MsiGetSourcePath(hpkg, "SubDir5", path, &size);
11691 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11692 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11693 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11695 lstrcpyA(subsrc, cwd);
11696 lstrcatA(subsrc, "nine");
11697 lstrcatA(subsrc, "\\");
11699 /* short dir exists before CostFinalize */
11700 size = MAX_PATH;
11701 lstrcpyA(path, "kiwi");
11702 r = MsiGetSourcePath(hpkg, "SubDir6", path, &size);
11703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11704 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11705 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11707 lstrcpyA(subsrc, cwd);
11708 lstrcatA(subsrc, "eleven");
11709 lstrcatA(subsrc, "\\");
11711 /* long dir exists before CostFinalize */
11712 size = MAX_PATH;
11713 lstrcpyA(path, "kiwi");
11714 r = MsiGetSourcePath(hpkg, "SubDir7", path, &size);
11715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11716 ok(!lstrcmpA(path, subsrc), "Expected \"%s\", got \"%s\"\n", subsrc, path);
11717 ok(size == lstrlenA(subsrc), "Expected %d, got %d\n", lstrlenA(subsrc), size);
11719 MsiCloseHandle(hpkg);
11720 RemoveDirectoryA("short");
11721 RemoveDirectoryA("long");
11722 RemoveDirectoryA("one");
11723 RemoveDirectoryA("four");
11724 RemoveDirectoryA("five");
11725 RemoveDirectoryA("eight");
11726 RemoveDirectoryA("nine");
11727 RemoveDirectoryA("twelve");
11728 DeleteFileA(msifile);
11731 static void test_sourcedir(void)
11733 MSIHANDLE hdb, hpkg;
11734 CHAR package[12];
11735 CHAR path[MAX_PATH];
11736 CHAR cwd[MAX_PATH];
11737 CHAR subsrc[MAX_PATH];
11738 DWORD size;
11739 UINT r;
11741 lstrcpyA(cwd, CURR_DIR);
11742 lstrcatA(cwd, "\\");
11744 lstrcpyA(subsrc, cwd);
11745 lstrcatA(subsrc, "long");
11746 lstrcatA(subsrc, "\\");
11748 hdb = create_package_db();
11749 ok( hdb, "failed to create database\n");
11751 r = add_directory_entry(hdb, "'TARGETDIR', '', 'SourceDir'");
11752 ok(r == S_OK, "failed\n");
11754 sprintf(package, "#%u", hdb);
11755 r = MsiOpenPackage(package, &hpkg);
11756 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
11758 skip("Not enough rights to perform tests\n");
11759 goto error;
11761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11763 /* properties only */
11765 /* SourceDir prop */
11766 size = MAX_PATH;
11767 lstrcpyA(path, "kiwi");
11768 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11769 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11770 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11771 ok(size == 0, "Expected 0, got %d\n", size);
11773 /* SOURCEDIR prop */
11774 size = MAX_PATH;
11775 lstrcpyA(path, "kiwi");
11776 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11777 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11778 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11779 ok(size == 0, "Expected 0, got %d\n", size);
11781 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
11783 r = MsiDoAction(hpkg, "CostInitialize");
11784 ok(r == ERROR_SUCCESS, "file cost failed\n");
11786 /* SourceDir after CostInitialize */
11787 size = MAX_PATH;
11788 lstrcpyA(path, "kiwi");
11789 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11790 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11791 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11792 ok(size == 0, "Expected 0, got %d\n", size);
11794 /* SOURCEDIR after CostInitialize */
11795 size = MAX_PATH;
11796 lstrcpyA(path, "kiwi");
11797 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11799 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11800 ok(size == 0, "Expected 0, got %d\n", size);
11802 r = MsiDoAction(hpkg, "FileCost");
11803 ok(r == ERROR_SUCCESS, "file cost failed\n");
11805 /* SourceDir after FileCost */
11806 size = MAX_PATH;
11807 lstrcpyA(path, "kiwi");
11808 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11809 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11810 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11811 ok(size == 0, "Expected 0, got %d\n", size);
11813 /* SOURCEDIR after FileCost */
11814 size = MAX_PATH;
11815 lstrcpyA(path, "kiwi");
11816 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11817 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11818 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11819 ok(size == 0, "Expected 0, got %d\n", size);
11821 r = MsiDoAction(hpkg, "CostFinalize");
11822 ok(r == ERROR_SUCCESS, "file cost failed\n");
11824 /* SourceDir after CostFinalize */
11825 size = MAX_PATH;
11826 lstrcpyA(path, "kiwi");
11827 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11829 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11830 ok(size == 0, "Expected 0, got %d\n", size);
11832 /* SOURCEDIR after CostFinalize */
11833 size = MAX_PATH;
11834 lstrcpyA(path, "kiwi");
11835 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11836 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11837 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11838 ok(size == 0, "Expected 0, got %d\n", size);
11840 r = MsiDoAction(hpkg, "ResolveSource");
11841 ok(r == ERROR_SUCCESS, "file cost failed\n");
11843 /* SourceDir after ResolveSource */
11844 size = MAX_PATH;
11845 lstrcpyA(path, "kiwi");
11846 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11848 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11849 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11851 /* SOURCEDIR after ResolveSource */
11852 size = MAX_PATH;
11853 lstrcpyA(path, "kiwi");
11854 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11856 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11857 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11859 /* random casing */
11860 size = MAX_PATH;
11861 lstrcpyA(path, "kiwi");
11862 r = MsiGetProperty(hpkg, "SoUrCeDiR", path, &size);
11863 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11864 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11865 ok(size == 0, "Expected 0, got %d\n", size);
11867 MsiCloseHandle(hpkg);
11869 /* reset the package state */
11870 sprintf(package, "#%i", hdb);
11871 r = MsiOpenPackage(package, &hpkg);
11872 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11874 /* test how MsiGetSourcePath affects the properties */
11876 /* SourceDir prop */
11877 size = MAX_PATH;
11878 lstrcpyA(path, "kiwi");
11879 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11880 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11881 todo_wine
11883 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11884 ok(size == 0, "Expected 0, got %d\n", size);
11887 size = MAX_PATH;
11888 lstrcpyA(path, "kiwi");
11889 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11890 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11891 ok(!lstrcmpA(path, "kiwi"),
11892 "Expected path to be unchanged, got \"%s\"\n", path);
11893 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11895 /* SourceDir after MsiGetSourcePath */
11896 size = MAX_PATH;
11897 lstrcpyA(path, "kiwi");
11898 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11899 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11900 todo_wine
11902 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11903 ok(size == 0, "Expected 0, got %d\n", size);
11906 /* SOURCEDIR prop */
11907 size = MAX_PATH;
11908 lstrcpyA(path, "kiwi");
11909 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11910 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11911 todo_wine
11913 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11914 ok(size == 0, "Expected 0, got %d\n", size);
11917 size = MAX_PATH;
11918 lstrcpyA(path, "kiwi");
11919 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11920 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11921 ok(!lstrcmpA(path, "kiwi"),
11922 "Expected path to be unchanged, got \"%s\"\n", path);
11923 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11925 /* SOURCEDIR prop after MsiGetSourcePath */
11926 size = MAX_PATH;
11927 lstrcpyA(path, "kiwi");
11928 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11930 todo_wine
11932 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11933 ok(size == 0, "Expected 0, got %d\n", size);
11936 r = MsiDoAction(hpkg, "CostInitialize");
11937 ok(r == ERROR_SUCCESS, "file cost failed\n");
11939 /* SourceDir after CostInitialize */
11940 size = MAX_PATH;
11941 lstrcpyA(path, "kiwi");
11942 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11943 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11944 todo_wine
11946 ok(!lstrcmpA(path, ""), "Expected \"\", got \"%s\"\n", path);
11947 ok(size == 0, "Expected 0, got %d\n", size);
11950 size = MAX_PATH;
11951 lstrcpyA(path, "kiwi");
11952 r = MsiGetSourcePath(hpkg, "SourceDir", path, &size);
11953 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11954 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11955 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11957 /* SourceDir after MsiGetSourcePath */
11958 size = MAX_PATH;
11959 lstrcpyA(path, "kiwi");
11960 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11961 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11962 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11963 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11965 /* SOURCEDIR after CostInitialize */
11966 size = MAX_PATH;
11967 lstrcpyA(path, "kiwi");
11968 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11970 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11971 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11973 /* SOURCEDIR source path still does not exist */
11974 size = MAX_PATH;
11975 lstrcpyA(path, "kiwi");
11976 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
11977 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
11978 ok(!lstrcmpA(path, "kiwi"),
11979 "Expected path to be unchanged, got \"%s\"\n", path);
11980 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
11982 r = MsiDoAction(hpkg, "FileCost");
11983 ok(r == ERROR_SUCCESS, "file cost failed\n");
11985 /* SourceDir after FileCost */
11986 size = MAX_PATH;
11987 lstrcpyA(path, "kiwi");
11988 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
11989 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11990 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11991 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
11993 /* SOURCEDIR after FileCost */
11994 size = MAX_PATH;
11995 lstrcpyA(path, "kiwi");
11996 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
11997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
11998 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
11999 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12001 /* SOURCEDIR source path still does not exist */
12002 size = MAX_PATH;
12003 lstrcpyA(path, "kiwi");
12004 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12005 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12006 ok(!lstrcmpA(path, "kiwi"),
12007 "Expected path to be unchanged, got \"%s\"\n", path);
12008 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12010 r = MsiDoAction(hpkg, "CostFinalize");
12011 ok(r == ERROR_SUCCESS, "file cost failed\n");
12013 /* SourceDir after CostFinalize */
12014 size = MAX_PATH;
12015 lstrcpyA(path, "kiwi");
12016 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12018 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12019 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12021 /* SOURCEDIR after CostFinalize */
12022 size = MAX_PATH;
12023 lstrcpyA(path, "kiwi");
12024 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12026 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12027 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12029 /* SOURCEDIR source path still does not exist */
12030 size = MAX_PATH;
12031 lstrcpyA(path, "kiwi");
12032 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12033 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12034 ok(!lstrcmpA(path, "kiwi"),
12035 "Expected path to be unchanged, got \"%s\"\n", path);
12036 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12038 r = MsiDoAction(hpkg, "ResolveSource");
12039 ok(r == ERROR_SUCCESS, "file cost failed\n");
12041 /* SourceDir after ResolveSource */
12042 size = MAX_PATH;
12043 lstrcpyA(path, "kiwi");
12044 r = MsiGetProperty(hpkg, "SourceDir", path, &size);
12045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12046 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12047 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12049 /* SOURCEDIR after ResolveSource */
12050 size = MAX_PATH;
12051 lstrcpyA(path, "kiwi");
12052 r = MsiGetProperty(hpkg, "SOURCEDIR", path, &size);
12053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12054 ok(!lstrcmpA(path, cwd), "Expected \"%s\", got \"%s\"\n", cwd, path);
12055 ok(size == lstrlenA(cwd), "Expected %d, got %d\n", lstrlenA(cwd), size);
12057 /* SOURCEDIR source path still does not exist */
12058 size = MAX_PATH;
12059 lstrcpyA(path, "kiwi");
12060 r = MsiGetSourcePath(hpkg, "SOURCEDIR", path, &size);
12061 ok(r == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", r);
12062 ok(!lstrcmpA(path, "kiwi"),
12063 "Expected path to be unchanged, got \"%s\"\n", path);
12064 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12066 MsiCloseHandle(hpkg);
12068 error:
12069 MsiCloseHandle(hdb);
12070 DeleteFileA(msifile);
12073 struct access_res
12075 BOOL gothandle;
12076 DWORD lasterr;
12077 BOOL ignore;
12080 static const struct access_res create[16] =
12082 { TRUE, ERROR_SUCCESS, TRUE },
12083 { TRUE, ERROR_SUCCESS, TRUE },
12084 { TRUE, ERROR_SUCCESS, FALSE },
12085 { TRUE, ERROR_SUCCESS, FALSE },
12086 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12087 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12088 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12089 { TRUE, ERROR_SUCCESS, FALSE },
12090 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12091 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12092 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12093 { TRUE, ERROR_SUCCESS, TRUE },
12094 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12095 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12096 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12097 { TRUE, ERROR_SUCCESS, TRUE }
12100 static const struct access_res create_commit[16] =
12102 { TRUE, ERROR_SUCCESS, TRUE },
12103 { TRUE, ERROR_SUCCESS, TRUE },
12104 { TRUE, ERROR_SUCCESS, FALSE },
12105 { TRUE, ERROR_SUCCESS, FALSE },
12106 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12107 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12108 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12109 { TRUE, ERROR_SUCCESS, FALSE },
12110 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12111 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12112 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12113 { TRUE, ERROR_SUCCESS, TRUE },
12114 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12115 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12116 { FALSE, ERROR_SHARING_VIOLATION, FALSE },
12117 { TRUE, ERROR_SUCCESS, TRUE }
12120 static const struct access_res create_close[16] =
12122 { TRUE, ERROR_SUCCESS, FALSE },
12123 { TRUE, ERROR_SUCCESS, FALSE },
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 }
12140 static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD line)
12142 DWORD access = 0, share = 0;
12143 DWORD lasterr;
12144 HANDLE hfile;
12145 int i, j, idx = 0;
12147 for (i = 0; i < 4; i++)
12149 if (i == 0) access = 0;
12150 if (i == 1) access = GENERIC_READ;
12151 if (i == 2) access = GENERIC_WRITE;
12152 if (i == 3) access = GENERIC_READ | GENERIC_WRITE;
12154 for (j = 0; j < 4; j++)
12156 if (ares[idx].ignore)
12157 continue;
12159 if (j == 0) share = 0;
12160 if (j == 1) share = FILE_SHARE_READ;
12161 if (j == 2) share = FILE_SHARE_WRITE;
12162 if (j == 3) share = FILE_SHARE_READ | FILE_SHARE_WRITE;
12164 SetLastError(0xdeadbeef);
12165 hfile = CreateFileA(file, access, share, NULL, OPEN_EXISTING,
12166 FILE_ATTRIBUTE_NORMAL, 0);
12167 lasterr = GetLastError();
12169 ok((hfile != INVALID_HANDLE_VALUE) == ares[idx].gothandle,
12170 "(%d, handle, %d): Expected %d, got %d\n",
12171 line, idx, ares[idx].gothandle,
12172 (hfile != INVALID_HANDLE_VALUE));
12174 ok(lasterr == ares[idx].lasterr ||
12175 lasterr == 0xdeadbeef, /* win9x */
12176 "(%d, lasterr, %d): Expected %d, got %d\n",
12177 line, idx, ares[idx].lasterr, lasterr);
12179 CloseHandle(hfile);
12180 idx++;
12185 #define test_file_access(file, ares) _test_file_access(file, ares, __LINE__)
12187 static void test_access(void)
12189 MSIHANDLE hdb;
12190 UINT r;
12192 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb);
12193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12195 test_file_access(msifile, create);
12197 r = MsiDatabaseCommit(hdb);
12198 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12200 test_file_access(msifile, create_commit);
12201 MsiCloseHandle(hdb);
12203 test_file_access(msifile, create_close);
12204 DeleteFileA(msifile);
12206 r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATEDIRECT, &hdb);
12207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12209 test_file_access(msifile, create);
12211 r = MsiDatabaseCommit(hdb);
12212 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12214 test_file_access(msifile, create_commit);
12215 MsiCloseHandle(hdb);
12217 test_file_access(msifile, create_close);
12218 DeleteFileA(msifile);
12221 static void test_emptypackage(void)
12223 MSIHANDLE hpkg = 0, hdb = 0, hsuminfo = 0;
12224 MSIHANDLE hview = 0, hrec = 0;
12225 MSICONDITION condition;
12226 CHAR buffer[MAX_PATH];
12227 DWORD size;
12228 UINT r;
12230 r = MsiOpenPackageA("", &hpkg);
12231 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12233 skip("Not enough rights to perform tests\n");
12234 return;
12236 todo_wine
12238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12241 hdb = MsiGetActiveDatabase(hpkg);
12242 todo_wine
12244 ok(hdb != 0, "Expected a valid database handle\n");
12247 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Tables`", &hview);
12248 todo_wine
12250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12252 r = MsiViewExecute(hview, 0);
12253 todo_wine
12255 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12258 r = MsiViewFetch(hview, &hrec);
12259 todo_wine
12261 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12264 buffer[0] = 0;
12265 size = MAX_PATH;
12266 r = MsiRecordGetString(hrec, 1, buffer, &size);
12267 todo_wine
12269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12270 ok(!lstrcmpA(buffer, "_Property"),
12271 "Expected \"_Property\", got \"%s\"\n", buffer);
12274 MsiCloseHandle(hrec);
12276 r = MsiViewFetch(hview, &hrec);
12277 todo_wine
12279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12282 size = MAX_PATH;
12283 r = MsiRecordGetString(hrec, 1, buffer, &size);
12284 todo_wine
12286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12287 ok(!lstrcmpA(buffer, "#_FolderCache"),
12288 "Expected \"_Property\", got \"%s\"\n", buffer);
12291 MsiCloseHandle(hrec);
12292 MsiViewClose(hview);
12293 MsiCloseHandle(hview);
12295 condition = MsiDatabaseIsTablePersistentA(hdb, "_Property");
12296 todo_wine
12298 ok(condition == MSICONDITION_FALSE,
12299 "Expected MSICONDITION_FALSE, got %d\n", condition);
12302 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Property`", &hview);
12303 todo_wine
12305 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12307 r = MsiViewExecute(hview, 0);
12308 todo_wine
12310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12313 /* _Property table is not empty */
12314 r = MsiViewFetch(hview, &hrec);
12315 todo_wine
12317 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12320 MsiCloseHandle(hrec);
12321 MsiViewClose(hview);
12322 MsiCloseHandle(hview);
12324 condition = MsiDatabaseIsTablePersistentA(hdb, "#_FolderCache");
12325 todo_wine
12327 ok(condition == MSICONDITION_FALSE,
12328 "Expected MSICONDITION_FALSE, got %d\n", condition);
12331 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `#_FolderCache`", &hview);
12332 todo_wine
12334 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12336 r = MsiViewExecute(hview, 0);
12337 todo_wine
12339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12342 /* #_FolderCache is not empty */
12343 r = MsiViewFetch(hview, &hrec);
12344 todo_wine
12346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12349 MsiCloseHandle(hrec);
12350 MsiViewClose(hview);
12351 MsiCloseHandle(hview);
12353 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Streams`", &hview);
12354 todo_wine
12356 ok(r == ERROR_BAD_QUERY_SYNTAX,
12357 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12360 r = MsiDatabaseOpenView(hdb, "SELECT * FROM `_Storages`", &hview);
12361 todo_wine
12363 ok(r == ERROR_BAD_QUERY_SYNTAX,
12364 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12367 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
12368 todo_wine
12370 ok(r == ERROR_INSTALL_PACKAGE_INVALID,
12371 "Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
12374 MsiCloseHandle(hsuminfo);
12376 r = MsiDatabaseCommit(hdb);
12377 todo_wine
12379 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12382 MsiCloseHandle(hdb);
12383 MsiCloseHandle(hpkg);
12386 static void test_MsiGetProductProperty(void)
12388 MSIHANDLE hprod, hdb;
12389 CHAR val[MAX_PATH];
12390 CHAR path[MAX_PATH];
12391 CHAR query[MAX_PATH];
12392 CHAR keypath[MAX_PATH*2];
12393 CHAR prodcode[MAX_PATH];
12394 CHAR prod_squashed[MAX_PATH];
12395 HKEY prodkey, userkey, props;
12396 DWORD size;
12397 LONG res;
12398 UINT r;
12399 SC_HANDLE scm;
12400 REGSAM access = KEY_ALL_ACCESS;
12402 scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
12403 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
12405 win_skip("Different registry keys on Win9x and WinMe\n");
12406 return;
12408 CloseServiceHandle(scm);
12410 GetCurrentDirectoryA(MAX_PATH, path);
12411 lstrcatA(path, "\\");
12413 create_test_guid(prodcode, prod_squashed);
12415 if (is_wow64)
12416 access |= KEY_WOW64_64KEY;
12418 r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
12419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12421 r = MsiDatabaseCommit(hdb);
12422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12424 r = set_summary_info(hdb);
12425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12427 r = run_query(hdb,
12428 "CREATE TABLE `Directory` ( "
12429 "`Directory` CHAR(255) NOT NULL, "
12430 "`Directory_Parent` CHAR(255), "
12431 "`DefaultDir` CHAR(255) NOT NULL "
12432 "PRIMARY KEY `Directory`)");
12433 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12435 r = run_query(hdb,
12436 "CREATE TABLE `Property` ( "
12437 "`Property` CHAR(72) NOT NULL, "
12438 "`Value` CHAR(255) "
12439 "PRIMARY KEY `Property`)");
12440 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12442 sprintf(query, "INSERT INTO `Property` "
12443 "(`Property`, `Value`) "
12444 "VALUES( 'ProductCode', '%s' )", prodcode);
12445 r = run_query(hdb, query);
12446 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12448 r = MsiDatabaseCommit(hdb);
12449 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12451 MsiCloseHandle(hdb);
12453 lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
12454 lstrcatA(keypath, prod_squashed);
12456 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL);
12457 if (res == ERROR_ACCESS_DENIED)
12459 skip("Not enough rights to perform tests\n");
12460 DeleteFile(msifile);
12461 return;
12463 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12465 lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
12466 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
12467 lstrcatA(keypath, prod_squashed);
12469 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
12470 if (res == ERROR_ACCESS_DENIED)
12472 skip("Not enough rights to perform tests\n");
12473 RegDeleteKeyA(prodkey, "");
12474 RegCloseKey(prodkey);
12475 return;
12477 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12479 res = RegCreateKeyExA(userkey, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
12480 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12482 lstrcpyA(val, path);
12483 lstrcatA(val, "\\");
12484 lstrcatA(val, msifile);
12485 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
12486 (const BYTE *)val, lstrlenA(val) + 1);
12487 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
12489 hprod = 0xdeadbeef;
12490 r = MsiOpenProductA(prodcode, &hprod);
12491 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12492 ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
12494 /* hProduct is invalid */
12495 size = MAX_PATH;
12496 lstrcpyA(val, "apple");
12497 r = MsiGetProductPropertyA(0xdeadbeef, "ProductCode", val, &size);
12498 ok(r == ERROR_INVALID_HANDLE,
12499 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12500 ok(!lstrcmpA(val, "apple"),
12501 "Expected val to be unchanged, got \"%s\"\n", val);
12502 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12504 /* szProperty is NULL */
12505 size = MAX_PATH;
12506 lstrcpyA(val, "apple");
12507 r = MsiGetProductPropertyA(hprod, NULL, val, &size);
12508 ok(r == ERROR_INVALID_PARAMETER,
12509 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12510 ok(!lstrcmpA(val, "apple"),
12511 "Expected val to be unchanged, got \"%s\"\n", val);
12512 ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
12514 /* szProperty is empty */
12515 size = MAX_PATH;
12516 lstrcpyA(val, "apple");
12517 r = MsiGetProductPropertyA(hprod, "", val, &size);
12518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12519 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12520 ok(size == 0, "Expected 0, got %d\n", size);
12522 /* get the property */
12523 size = MAX_PATH;
12524 lstrcpyA(val, "apple");
12525 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12527 ok(!lstrcmpA(val, prodcode),
12528 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12529 ok(size == lstrlenA(prodcode),
12530 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12532 /* lpValueBuf is NULL */
12533 size = MAX_PATH;
12534 r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size);
12535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12536 ok(size == lstrlenA(prodcode),
12537 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12539 /* pcchValueBuf is NULL */
12540 lstrcpyA(val, "apple");
12541 r = MsiGetProductPropertyA(hprod, "ProductCode", val, NULL);
12542 ok(r == ERROR_INVALID_PARAMETER,
12543 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12544 ok(!lstrcmpA(val, "apple"),
12545 "Expected val to be unchanged, got \"%s\"\n", val);
12546 ok(size == lstrlenA(prodcode),
12547 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12549 /* pcchValueBuf is too small */
12550 size = 4;
12551 lstrcpyA(val, "apple");
12552 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12553 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12554 ok(!strncmp(val, prodcode, 3),
12555 "Expected first 3 chars of \"%s\", got \"%s\"\n", prodcode, val);
12556 ok(size == lstrlenA(prodcode),
12557 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12559 /* pcchValueBuf does not leave room for NULL terminator */
12560 size = lstrlenA(prodcode);
12561 lstrcpyA(val, "apple");
12562 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12563 ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
12564 ok(!strncmp(val, prodcode, lstrlenA(prodcode) - 1),
12565 "Expected first 37 chars of \"%s\", got \"%s\"\n", prodcode, val);
12566 ok(size == lstrlenA(prodcode),
12567 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12569 /* pcchValueBuf has enough room for NULL terminator */
12570 size = lstrlenA(prodcode) + 1;
12571 lstrcpyA(val, "apple");
12572 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12574 ok(!lstrcmpA(val, prodcode),
12575 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12576 ok(size == lstrlenA(prodcode),
12577 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12579 /* nonexistent property */
12580 size = MAX_PATH;
12581 lstrcpyA(val, "apple");
12582 r = MsiGetProductPropertyA(hprod, "IDontExist", val, &size);
12583 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12584 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12585 ok(size == 0, "Expected 0, got %d\n", size);
12587 r = MsiSetPropertyA(hprod, "NewProperty", "value");
12588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12590 /* non-product property set */
12591 size = MAX_PATH;
12592 lstrcpyA(val, "apple");
12593 r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size);
12594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12595 ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
12596 ok(size == 0, "Expected 0, got %d\n", size);
12598 r = MsiSetPropertyA(hprod, "ProductCode", "value");
12599 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12601 /* non-product property that is also a product property set */
12602 size = MAX_PATH;
12603 lstrcpyA(val, "apple");
12604 r = MsiGetProductPropertyA(hprod, "ProductCode", val, &size);
12605 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12606 ok(!lstrcmpA(val, prodcode),
12607 "Expected \"%s\", got \"%s\"\n", prodcode, val);
12608 ok(size == lstrlenA(prodcode),
12609 "Expected %d, got %d\n", lstrlenA(prodcode), size);
12611 MsiCloseHandle(hprod);
12613 RegDeleteValueA(props, "LocalPackage");
12614 delete_key(props, "", access);
12615 RegCloseKey(props);
12616 delete_key(userkey, "", access);
12617 RegCloseKey(userkey);
12618 delete_key(prodkey, "", access);
12619 RegCloseKey(prodkey);
12620 DeleteFileA(msifile);
12623 static void test_MsiSetProperty(void)
12625 MSIHANDLE hpkg, hdb, hrec;
12626 CHAR buf[MAX_PATH];
12627 LPCSTR query;
12628 DWORD size;
12629 UINT r;
12631 r = package_from_db(create_package_db(), &hpkg);
12632 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
12634 skip("Not enough rights to perform tests\n");
12635 DeleteFile(msifile);
12636 return;
12638 ok(r == ERROR_SUCCESS, "Expected a valid package %u\n", r);
12640 /* invalid hInstall */
12641 r = MsiSetPropertyA(0, "Prop", "Val");
12642 ok(r == ERROR_INVALID_HANDLE,
12643 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12645 /* invalid hInstall */
12646 r = MsiSetPropertyA(0xdeadbeef, "Prop", "Val");
12647 ok(r == ERROR_INVALID_HANDLE,
12648 "Expected ERROR_INVALID_HANDLE, got %d\n", r);
12650 /* szName is NULL */
12651 r = MsiSetPropertyA(hpkg, NULL, "Val");
12652 ok(r == ERROR_INVALID_PARAMETER,
12653 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12655 /* both szName and szValue are NULL */
12656 r = MsiSetPropertyA(hpkg, NULL, NULL);
12657 ok(r == ERROR_INVALID_PARAMETER,
12658 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
12660 /* szName is empty */
12661 r = MsiSetPropertyA(hpkg, "", "Val");
12662 ok(r == ERROR_FUNCTION_FAILED,
12663 "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
12665 /* szName is empty and szValue is NULL */
12666 r = MsiSetPropertyA(hpkg, "", NULL);
12667 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12669 /* set a property */
12670 r = MsiSetPropertyA(hpkg, "Prop", "Val");
12671 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12673 /* get the property */
12674 size = MAX_PATH;
12675 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12676 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12677 ok(!lstrcmpA(buf, "Val"), "Expected \"Val\", got \"%s\"\n", buf);
12678 ok(size == 3, "Expected 3, got %d\n", size);
12680 /* update the property */
12681 r = MsiSetPropertyA(hpkg, "Prop", "Nuvo");
12682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12684 /* get the property */
12685 size = MAX_PATH;
12686 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12687 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12688 ok(!lstrcmpA(buf, "Nuvo"), "Expected \"Nuvo\", got \"%s\"\n", buf);
12689 ok(size == 4, "Expected 4, got %d\n", size);
12691 hdb = MsiGetActiveDatabase(hpkg);
12692 ok(hdb != 0, "Expected a valid database handle\n");
12694 /* set prop is not in the _Property table */
12695 query = "SELECT * FROM `_Property` WHERE `Property` = 'Prop'";
12696 r = do_query(hdb, query, &hrec);
12697 ok(r == ERROR_BAD_QUERY_SYNTAX,
12698 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12700 /* set prop is not in the Property table */
12701 query = "SELECT * FROM `Property` WHERE `Property` = 'Prop'";
12702 r = do_query(hdb, query, &hrec);
12703 ok(r == ERROR_BAD_QUERY_SYNTAX,
12704 "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
12706 MsiCloseHandle(hdb);
12708 /* szValue is an empty string */
12709 r = MsiSetPropertyA(hpkg, "Prop", "");
12710 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12712 /* try to get the property */
12713 size = MAX_PATH;
12714 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12715 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12716 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12717 ok(size == 0, "Expected 0, got %d\n", size);
12719 /* reset the property */
12720 r = MsiSetPropertyA(hpkg, "Prop", "BlueTap");
12721 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12723 /* delete the property */
12724 r = MsiSetPropertyA(hpkg, "Prop", NULL);
12725 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12727 /* try to get the property */
12728 size = MAX_PATH;
12729 r = MsiGetPropertyA(hpkg, "Prop", buf, &size);
12730 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
12731 ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
12732 ok(size == 0, "Expected 0, got %d\n", size);
12734 MsiCloseHandle(hpkg);
12735 DeleteFileA(msifile);
12738 static void test_MsiApplyMultiplePatches(void)
12740 UINT r, type = GetDriveType(NULL);
12742 if (!pMsiApplyMultiplePatchesA) {
12743 win_skip("MsiApplyMultiplePatchesA not found\n");
12744 return;
12747 r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
12748 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12750 r = pMsiApplyMultiplePatchesA("", NULL, NULL);
12751 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12753 r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
12754 todo_wine
12756 if (type == DRIVE_FIXED)
12757 ok(r == ERROR_PATH_NOT_FOUND,
12758 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12759 else
12760 ok(r == ERROR_INVALID_NAME,
12761 "Expected ERROR_INVALID_NAME, got %u\n", r);
12764 r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
12765 todo_wine
12767 if (type == DRIVE_FIXED)
12768 ok(r == ERROR_PATCH_PACKAGE_OPEN_FAILED,
12769 "Expected ERROR_PATCH_PACKAGE_OPEN_FAILED, got %u\n", r);
12770 else
12771 ok(r == ERROR_INVALID_NAME,
12772 "Expected ERROR_INVALID_NAME, got %u\n", r);
12775 r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
12776 todo_wine
12778 if (type == DRIVE_FIXED)
12779 ok(r == ERROR_PATH_NOT_FOUND,
12780 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12781 else
12782 ok(r == ERROR_INVALID_NAME,
12783 "Expected ERROR_INVALID_NAME, got %u\n", r);
12786 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
12787 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12789 r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
12790 todo_wine
12792 if (type == DRIVE_FIXED)
12793 ok(r == ERROR_PATH_NOT_FOUND,
12794 "Expected ERROR_PATH_NOT_FOUND, got %u\n", r);
12795 else
12796 ok(r == ERROR_INVALID_NAME,
12797 "Expected ERROR_INVALID_NAME, got %u\n", r);
12800 r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
12801 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12803 r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
12804 todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
12807 static void test_MsiApplyPatch(void)
12809 UINT r;
12811 r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
12812 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12814 r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
12815 ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
12818 START_TEST(package)
12820 STATEMGRSTATUS status;
12821 BOOL ret = FALSE;
12823 init_functionpointers();
12825 if (pIsWow64Process)
12826 pIsWow64Process(GetCurrentProcess(), &is_wow64);
12828 GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
12830 /* Create a restore point ourselves so we circumvent the multitude of restore points
12831 * that would have been created by all the installation and removal tests.
12833 if (pSRSetRestorePointA)
12835 memset(&status, 0, sizeof(status));
12836 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
12839 test_createpackage();
12840 test_doaction();
12841 test_gettargetpath_bad();
12842 test_settargetpath();
12843 test_props();
12844 test_property_table();
12845 test_condition();
12846 test_msipackage();
12847 test_formatrecord2();
12848 test_states();
12849 test_getproperty();
12850 test_removefiles();
12851 test_appsearch();
12852 test_appsearch_complocator();
12853 test_appsearch_reglocator();
12854 test_appsearch_inilocator();
12855 test_appsearch_drlocator();
12856 test_featureparents();
12857 test_installprops();
12858 test_launchconditions();
12859 test_ccpsearch();
12860 test_complocator();
12861 test_MsiGetSourcePath();
12862 test_shortlongsource();
12863 test_sourcedir();
12864 test_access();
12865 test_emptypackage();
12866 test_MsiGetProductProperty();
12867 test_MsiSetProperty();
12868 test_MsiApplyMultiplePatches();
12869 test_MsiApplyPatch();
12871 if (pSRSetRestorePointA && ret)
12873 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
12874 if (ret)
12875 remove_restore_point(status.llSequenceNumber);