148 if (!szProduct || !
squash_guid( szProduct, squashed_pc ))
231 const WCHAR *reinstallmode;
248 if (reinstallmode[--
len] ==
'v' || reinstallmode[
len] ==
'V')
297 if (szPatchPackage && !(patch_package =
strdupAtoW(szPatchPackage)))
300 if (szInstallPackage && !(install_package =
strdupAtoW(szInstallPackage)))
303 if (szCommandLine && !(command_line =
strdupAtoW(szCommandLine)))
306 r =
MsiApplyPatchW(patch_package, install_package, eInstallType, command_line);
310 free(install_package);
336 ERR(
"Failed to read product codes from patch\n");
363 LPCWSTR cmd_ptr = szCommandLine;
367 if (!szPatchPackage || !szPatchPackage[0])
389 for (
i = 0; codes[
i];
i++)
394 TRACE(
"patch applied\n");
417 FIXME(
"Only reading target products from patch\n");
435 if (!szPatchPackages || !szPatchPackages[0])
438 if (!(patch_packages =
strdupAtoW(szPatchPackages)))
441 if (szProductCode && !(product_code =
strdupAtoW(szProductCode)))
444 if (szPropertiesList && !(properties_list =
strdupAtoW(szPropertiesList)))
450 free(patch_packages);
452 free(properties_list);
466 if (!szPatchPackages || !szPatchPackages[0])
469 beg =
end = szPatchPackages;
475 while (*beg ==
' ') beg++;
479 while (
len && beg[
len - 1] ==
' ')
len--;
521 ret[
i].ePatchDataType =
info[
i].ePatchDataType;
535 TRACE(
"%s, %lu, %p\n",
debugstr_a(szProductPackagePath), cPatchInfo, pPatchInfo );
537 if (szProductPackagePath && !(package_path =
strdupAtoW( szProductPackagePath )))
542 free( package_path );
548 for (
i = 0;
i < cPatchInfo;
i++)
554 free( package_path );
581 TRACE(
"patch not applicable\n");
602 ERR(
"no product code to check\n");
607 hr = IXMLDOMDocument_selectNodes(
desc,
s, &
list );
614 hr = IXMLDOMNode_get_text(
node, &
s );
615 IXMLDOMNode_Release(
node );
622 IXMLDOMNodeList_Release(
list );
625 TRACE(
"patch not applicable\n");
627 free( product_code );
637 FIXME(
"patch ordering not supported\n");
641 switch (
info[
i].ePatchDataType)
667 &IID_IXMLDOMDocument, (
void**)&
desc );
670 ERR(
"failed to create DOMDocument30 instance, %#lx\n",
hr );
685 hr = IXMLDOMDocument_loadXML(
desc,
s, &
b );
689 ERR(
"failed to parse patch description\n");
690 IXMLDOMDocument_Release(
desc );
708 FIXME(
"unknown patch data type %u\n",
info[
i].ePatchDataType);
716 TRACE(
"ePatchDataType: %u\n",
info[
i].ePatchDataType);
721 if (
desc) IXMLDOMDocument_Release(
desc );
732 TRACE(
"%s, %lu, %p\n",
debugstr_w(szProductPackagePath), cPatchInfo, pPatchInfo );
737 ERR(
"failed to open package %u\n",
r);
756 if (usersid && !(usersidW =
strdupAtoW( usersid )))
800 DWORD sz =
sizeof(sourcepath);
841 TRACE(
"%s %d %d %s\n",
debugstr_w(szProduct), iInstallLevel, eInstallState,
850 FIXME(
"State %d not implemented\n", eInstallState);
885 lstrcpyW(commandline, szCommandLine);
888 lstrcatW(commandline,
L" INSTALLLEVEL=32767");
896 sz =
sizeof(sourcepath);
941 free( szwCommandLine);
952 TRACE(
"%s %d %d\n",
debugstr_a(szProduct), iInstallLevel, eInstallState);
994 free( szwComponent );
1002 HKEY compkey, prodkey;
1008 if (!szComponent || !*szComponent)
1084 ERR(
"unhandled value type %lu\n", *
type );
1230 if (szValue->
str.
a || szValue->
str.
w)
1240 *pcchValueBuf =
len;
1262 szBuffer, pcchValueBuf);
1265 if( szProduct && !szwProduct )
1280 free( szwAttribute );
1291 szBuffer, pcchValueBuf);
1313 szValue, pcchValue);
1315 if (szValue && !pcchValue)
1318 if (szProductCode) product =
strdupAtoW(szProductCode);
1319 if (szUserSid) usersid =
strdupAtoW(szUserSid);
1320 if (szProperty)
property =
strdupAtoW(szProperty);
1343 if (*pcchValue >=
len)
1352 if (*pcchValue <=
len || !szValue)
1355 *pcchValue =
len - 1;
1403 szValue, pcchValue);
1405 if (!szProductCode || !
squash_guid( szProductCode, squashed_pc ))
1408 if (szValue && !pcchValue)
1416 if (!szProperty || !*szProperty)
1432 package = INSTALLPROPERTY_LOCALPACKAGEW;
1434 if (!
props && !prod)
1439 package = L"ManagedLocalPackage";
1441 if (!
props && !managed)
1446 package = INSTALLPROPERTY_LOCALPACKAGEW;
1449 if (!
props && !classes)
1474 if (prod || classes)
1483 szProperty =
L"DisplayName";
1485 szProperty =
L"DisplayVersion";
1502 if (!prod && !classes)
1545 if (prod || managed)
1554 if (!prod && !classes)
1578 debugstr_a(szPatchList), pcFiles, pphFileRecords);
1586 debugstr_w(szPatchList), pcFiles, pphFileRecords);
1603 if (lpValue && !pcchValue)
1606 if (szPatchCode) patch =
strdupAtoW(szPatchCode);
1607 if (szProductCode) product =
strdupAtoW(szProductCode);
1608 if (szUserSid) usersid =
strdupAtoW(szUserSid);
1609 if (szProperty)
property =
strdupAtoW(szProperty);
1634 if ((*
val && *pcchValue <
len + 1) || !lpValue)
1639 lpValue[*pcchValue - 1] =
'\0';
1663 HKEY patch = 0, patches = 0;
1664 HKEY udpatch = 0, datakey = 0;
1665 HKEY prodpatches = 0;
1674 if (!szProductCode || !
squash_guid( szProductCode, squashed_pc ))
1677 if (!szPatchCode || !
squash_guid( szPatchCode, squashed_patch ))
1683 if (lpValue && !pcchValue)
1694 if (szUserSid && !
wcscmp( szUserSid,
L"S-1-5-18" ))
1725 datakey = prodpatches;
1726 szProperty = squashed_patch;
1737 szProperty =
L"ManagedLocalPackage";
1743 szProperty =
L"Installed";
1772 if ((*
val && *pcchValue <
len + 1) || !lpValue)
1803 if (!patch || !
attr)
1851 if (!patch || !
attr)
1887 TRACE(
"%#lx, %s, %#lx\n", dwLogMode,
debugstr_a(szLogFile), attributes );
1902 TRACE(
"%#lx, %s, %#lx\n", dwLogMode,
debugstr_w(szLogFile), attributes );
1932 TRACE(
"%lu, %s, %lu, %d, %p, %p, %p, %p\n",
handle,
debugstr_a(component),
index,
state,
drive, buflen, cost,
1972 TRACE(
"%lu, %s, %lu, %d, %p, %p, %p, %p\n",
handle,
debugstr_w(component),
index,
state,
drive, buflen, cost,
2029 if (component && component[0])
2065 if (szProductCode && !(prodcode =
strdupAtoW(szProductCode)))
2068 if (szUserSid && !(usersid =
strdupAtoW(szUserSid)))
2071 if (szComponent && !(comp =
strdupAtoW(szComponent)))
2106 package = L"ManagedLocalPackage";
2108 package = L"LocalPackage";
2151 if (!pdwState || !szComponent)
2154 if (!szProductCode || !*szProductCode ||
lstrlenW(szProductCode) !=
GUID_SIZE - 1)
2194 val[0] >=
'0' &&
val[0] <=
'9' &&
val[1] >=
'0' &&
val[1] <=
'9' &&
val[2] !=
':')
2203 TRACE(
"-> %d\n", *pdwState);
2227 HKEY prodkey = 0, userdata = 0;
2233 if (!szProduct || !*szProduct)
2239 if (szProduct[0] !=
'{' || szProduct[37] !=
'}')
2286 TRACE(
"%08x %p\n", dwUILevel, phWnd);
2291 FIXME(
"Unrecognized flags %08x\n", dwUILevel);
2310 TRACE(
"%p, %#lx, %p\n", puiHandler, dwMessageFilter, pvContext );
2324 TRACE(
"%p, %#lx, %p\n", puiHandler, dwMessageFilter, pvContext );
2369 FIXME(
"don't know how to deal with handle = %lu\n",
handle );
2384 for (
i = 0;
i < (
id & 0xf);
i++)
p += *
p + 1;
2387 if( nBufferMax <=
len )
2409 if(
len <= nBufferMax )
2426 if (!szComponent || !pcchBuf)
2442 if (!szComponent || !pcchBuf)
2454 FIXME(
"%p, %s, %s, %u, %#x, %#lx\n",
hWnd,
debugstr_a(lpText),
debugstr_a(lpCaption), uType, wLanguageId,
f );
2461 FIXME(
"%p, %s, %s, %u, %#x %#lx\n",
hWnd,
debugstr_w(lpText),
debugstr_w(lpCaption), uType, wLanguageId,
f );
2468 FIXME(
"%p, %s, %s, %u, %#lx, %#x, %#lx): semi-stub\n",
hWnd,
debugstr_a(lpText),
debugstr_a(lpCaption), uType,
2476 FIXME(
"%p, %s, %s, %u, %#lx, %#x, %#lx): semi-stub\n",
hWnd,
debugstr_w(lpText),
debugstr_w(lpCaption), uType,
2482 DWORD dwAssemblyInfo,
char *lpPathBuf,
DWORD *pcchPathBuf )
2485 dwAssemblyInfo, lpPathBuf, pcchPathBuf );
2493 dwAssemblyInfo, lpPathBuf, pcchPathBuf );
2596 TRACE(
"%lu, %s, %p, %p\n", hProduct,
debugstr_a(szProperty), szValue, pccbValue );
2598 if (szValue && !pccbValue)
2601 if (szProperty) prop =
strdupAtoW(szProperty);
2610 if (szValue) *szValue =
'\0';
2611 if (pccbValue) *pccbValue = 0;
2634 if (
len > *pccbValue)
2637 *pccbValue =
len - 1;
2658 TRACE(
"%lu, %s, %p, %p)\n", hProduct,
debugstr_w(szProperty), szValue, pccbValue );
2663 if (szValue && !pccbValue)
2666 package = msihandle2msiinfo(hProduct, MSIHANDLETYPE_PACKAGE);
2670 r =
MSI_OpenQuery(package->
db, &
view,
L"SELECT * FROM `Property` WHERE `Property` = '%s'", szProperty);
2709 if (szValue) *szValue =
'\0';
2710 if (pccbValue) *pccbValue = 0;
2761 if (usersid && !
wcsicmp( usersid,
L"S-1-1-0" ))
2763 FIXME(
"only looking at the current user\n" );
2780 if (!szProduct || !szComponent)
2783 if (lpPathBuf->
str.
w && !pcchBuf)
2872 if (usersid && !(usersidW =
strdupAtoW( usersid )))
goto end;
2967 path[0] >=
'0' &&
path[0] <=
'9' &&
2994 if (usersid && !(usersidW =
strdupAtoW( usersid )))
3029 if ( szProduct && !szwProduct )
3033 if ( szFeature && !szwFeature )
3070 if (!szProduct || !szFeature || !
squash_guid( szProduct, squashed ))
3094 if ((lpVersionBuf && !pcchVersionBuf) ||
3095 (lpLangBuf && !pcchLangBuf))
3105 if( lpVersionBuf && pcchVersionBuf && *pcchVersionBuf )
3107 lpwVersionBuff =
malloc(*pcchVersionBuf *
sizeof(
WCHAR));
3108 if( !lpwVersionBuff )
3112 if( lpLangBuf && pcchLangBuf && *pcchLangBuf )
3114 lpwLangBuff =
malloc(*pcchLangBuf *
sizeof(
WCHAR));
3120 lpwLangBuff, pcchLangBuf);
3124 lpVersionBuf, *pcchVersionBuf + 1,
NULL,
NULL);
3127 lpLangBuf, *pcchLangBuf + 1,
NULL,
NULL);
3131 free(lpwVersionBuff);
3161 if (!verbuf && !verlen && !langbuf && !langlen)
3171 HIWORD(ffi->dwFileVersionMS),
LOWORD(ffi->dwFileVersionMS),
3172 HIWORD(ffi->dwFileVersionLS),
LOWORD(ffi->dwFileVersionLS) );
3173 if (verbuf)
lstrcpynW( verbuf, tmp, *verlen );
3180 if (verbuf) *verbuf = 0;
3189 if (langbuf)
lstrcpynW( langbuf, tmp, *langlen );
3196 if (langbuf) *langbuf = 0;
3212 TRACE(
"%s, %p(%lu), %p(%lu)\n",
debugstr_w(
path), verbuf, verlen ? *verlen : 0, langbuf, langlen ? *langlen : 0 );
3214 if ((verbuf && !verlen) || (langbuf && !langlen))
3243 pdwUseCount, pwDateUsed);
3257 pdwUseCount, pwDateUsed);
3260 if (szProduct && !prod)
3264 if (szFeature && !feat)
3293 FIXME(
"mark product %s feature %s as used\n",
3312 if (szProduct && !prod)
3316 if (szFeature && !feat)
3362#define BASE85_SIZE 20
3390 if (!szProduct) szProduct = product;
3428 DWORD *pcchPathBuf )
3432 TRACE(
"%s, %s, %lu, %s, %#lx, %#lx, %p, %p\n",
debugstr_w(szComponent),
debugstr_w(szQualifier), dwInstallMode,
3433 debugstr_w(szProduct), Unused1, Unused2, lpPathBuf, pcchPathBuf );
3436 path.str.w = lpPathBuf;
3439 &
path, pcchPathBuf );
3446 const char *szProduct,
DWORD Unused1,
DWORD Unused2,
char *lpPathBuf,
3447 DWORD *pcchPathBuf )
3449 WCHAR *szwComponent, *szwQualifier =
NULL, *szwProduct =
NULL;
3453 TRACE(
"%s, %s, %lu, %s, %#lx, %#lx, %p, %p\n",
debugstr_a(szComponent),
debugstr_a(szQualifier), dwInstallMode,
3454 debugstr_a(szProduct), Unused1, Unused2, lpPathBuf, pcchPathBuf );
3457 if (szComponent && !szwComponent)
3461 if (szQualifier && !szwQualifier)
3465 if (szProduct && !szwProduct)
3469 path.str.a = lpPathBuf;
3472 dwInstallMode, szwProduct, Unused1,
3473 Unused2, &
path, pcchPathBuf);
3490 dwInstallMode,
NULL, 0, 0, lpPathBuf, pcchPathBuf);
3501 dwInstallMode,
NULL, 0, 0, lpPathBuf, pcchPathBuf);
3519 pcchUserNameBuf, lpOrgNameBuf, pcchOrgNameBuf, lpSerialBuf,
3522 if (!szProduct || !
squash_guid( szProduct, squashed_pc ))
3555 if (pcchUserNameBuf)
3557 if (lpUserNameBuf && !
user)
3559 (*pcchUserNameBuf)--;
3574 if (!orgptr) orgptr =
L"";
3615 if ((lpUserNameBuf && !pcchUserNameBuf) ||
3616 (lpOrgNameBuf && !pcchOrgNameBuf) ||
3617 (lpSerialBuf && !pcchSerialBuf))
3621 user.str.w = lpUserNameBuf;
3623 org.str.w = lpOrgNameBuf;
3625 serial.str.w = lpSerialBuf;
3628 &
org, pcchOrgNameBuf,
3629 &
serial, pcchSerialBuf );
3641 if ((lpUserNameBuf && !pcchUserNameBuf) ||
3642 (lpOrgNameBuf && !pcchOrgNameBuf) ||
3643 (lpSerialBuf && !pcchSerialBuf))
3647 if (szProduct && !prod)
3651 user.str.a = lpUserNameBuf;
3653 org.str.a = lpOrgNameBuf;
3655 serial.str.a = lpSerialBuf;
3658 &
org, pcchOrgNameBuf,
3659 &
serial, pcchSerialBuf );
3679 package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3704 package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3727 if (szProduct && !prod)
3731 if (szFeature && !feat)
3755 if (!szProduct || !szFeature)
3758 switch (eInstallState)
3777 sz =
sizeof(sourcepath);
3838 LPSTR szComponentCode )
3846 if (szShortcutTarget && !
target )
3875 szProductCode, szFeatureId, szComponentCode );
3883 r = IPersistFile_Load( pf, szShortcutTarget,
3887 r = IPersistFile_QueryInterface( pf, &IID_IShellLinkDataList,
3893 IShellLinkDataList_Release( dl );
3896 IPersistFile_Release( pf );
3902 TRACE(
"darwin = %p\n", darwin);
3910 szProductCode, szFeatureId, szComponentCode, &sz );