Does anyone know if the string I passed is correct, to search for that 'GAC_mscorlib_*' with the '*' wildcard? I don't even know how to try to use the RAPI functions outside of NSIS to test this, I'm really operating outside my expertise here.
How would I look at the last output parameter, the r3/$3 which is supposed to be a pointer to the array of _CE_FIND_DATA structures?
Thanks
Here's my script:
SectionEnd
Section "DetectCF"
System::Call "rapi::CeRapiInit() i .r0"
/***************
Dll Call Structure
STDAPI_(BOOL) CeFindAllFiles(
LPCWSTR szPath,
DWORD dwFlags,
LPDWORD lpdwFoundCount,
LPLPCE_FIND_DATA ppFindDataArray
);
These are flags for CeFindAllFiles
#define FAD_NAME ((WORD) 0x04)
//
// The Windows CE WIN32_FIND_DATA structure differs from the
// Windows WIN32_FIND_DATA stucture so we copy the Windows CE
// definition to here so that both sides match.
//
typedef struct _CE_FIND_DATA {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD dwOID;
WCHAR cFileName[MAX_PATH];
} CE_FIND_DATA, *LPCE_FIND_DATA;
typedef CE_FIND_DATA** LPLPCE_FIND_DATA;
*/
# Use CeFindAllFiles to search the device's Windows directory for GAC_mscorlib_*.dll
System::Call "rapi::CeFindAllFiles(t '\Windows\GAC_mscorlib_*.dll', \
i 0x04, \
*l . r2, \
*i . r3) b r4"
${If} $4 == 'some value'
MessageBox MB_OK 'Found a version of Compact Framework'
${Else}
MessageBox MB_OK 'Did not find a version of Compact Framework'
${EndIf}
System::Call "rapi::CeRapiUninit() i .r0"