i don't want to "steal" the answer by Nikolay, but i'd like to "extend" it.
so as nikolay referred to some other answer the solution is to call IsProcessorFeaturePresent:
UINT __stdcall checkCpuFeatureSSE2(MSIHANDLE hInstall)
{
if (IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE)) // SSE2
MsiSetProperty(hInstall, L"CPU_FEATURE_SSE2", L"1");
return 0;
}
unfortunately this methods only allows to check for SSE2.
later versions of SIMD features are not covered: SSE42, AVX, AVX2, AVX512.
--
to check for those additional features i'm now using the reference implementation (as found in this answer) from: https://github.com/Mysticial/FeatureDetector
it calls __cpuid
/ __cpuidex
from <intrin.h>
.
for additional details see: https://msdn.microsoft.com/en-us/library/hskdteyh.aspx
so with this FeatureDetector (by Mysticial) i can now implement the desired LaunchCondition by adding:
DLLEXPORT VOID checkCpuFeatureSSE42(MSIHANDLE hMSI)
{
FeatureDetector::cpu_x86 features;
features.detect_host();
if (features.HW_SSE42)
MsiSetProperty(hMSI, "CPU_FEATURE_SSE42", "1");
}
DLLEXPORT VOID checkCpuFeatureAVX(MSIHANDLE hMSI)
{
FeatureDetector::cpu_x86 features;
features.detect_host();
if (features.HW_AVX)
MsiSetProperty(hMSI, "CPU_FEATURE_AVX", "1");
}
DLLEXPORT VOID checkCpuFeatureAVX2(MSIHANDLE hMSI)
{
FeatureDetector::cpu_x86 features;
features.detect_host();
if (features.HW_AVX2)
MsiSetProperty(hMSI, "CPU_FEATURE_AVX2", "1");
}
DLLEXPORT VOID checkCpuFeatureAVX512(MSIHANDLE hMSI)
{
FeatureDetector::cpu_x86 features;
features.detect_host();
if (features.HW_AVX512_F)
MsiSetProperty(hMSI, "CPU_FEATURE_AVX512", "1");
}
--
also see: https://stackoverflow.com/a/7495023