For what it's worth, I believe that the original reason why your discovery was unsuccessful would be because VersionMsi has only two precision digits:
<![CDATA[VersionNT = 'v5.1' AND VersionMsi >= "4.5.6001.22159"]]>
should be
<![CDATA[VersionNT = 'v5.1' AND VersionMsi >= v4.5]]>
I recently ran into a similar issue and ended up in Burn to find the answer.
static HRESULT InitializeVariableVersionMsi( __in DWORD_PTR dwpData, __inout BURN_VARIANT* pValue ) { UNREFERENCED_PARAMETER(dwpData); HRESULT hr = S_OK; DLLGETVERSIONPROC pfnMsiDllGetVersion = NULL; DLLVERSIONINFO msiVersionInfo = { }; // Get DllGetVersion proc address pfnMsiDllGetVersion = (DLLGETVERSIONPROC)::GetProcAddress(::GetModuleHandleW(L"msi"), "DllGetVersion"); ExitOnNullWithLastError(pfnMsiDllGetVersion, hr, "Failed to find DllGetVersion entry point in msi.dll."); // Get msi.dll version information msiVersionInfo.cbSize = sizeof(DLLVERSIONINFO); hr = pfnMsiDllGetVersion(&msiVersionInfo); ExitOnFailure(hr, "Failed to get msi.dll version info."); hr = BVariantSetVersion(pValue, MAKEQWORDVERSION(msiVersionInfo.dwMajorVersion, msiVersionInfo.dwMinorVersion, 0, 0)); ExitOnFailure(hr, "Failed to set variant value."); LExit: return hr; }
source share