Posted 26 September 2003 - 11:01
Hi
I'm now trying with script code - se below
And then load the dll dynamically from my other dll!!
Hopefully this works.
Regards,
Thomas
function ExtractDLLfromWI(hMSI)
.....
begin
hDB = MsiGetActiveDatabase(hMSI);
rc = MsiDatabaseOpenView( hDB, "Select * FROM `Binary` WHERE `Name`='xxxxx'", hView);
rc = MsiViewExecute( hView, NULL);
if (MsiViewFetch( hView, hRec ) == ERROR_SUCCESS)
then
OpenFileMode (FILE_MODE_BINARY);
nStopInstall = CreateFile (nvFileHandle, pathName, "dwndsinst.dll");
nBuffer = 1023;
nTotal = 0;
while (nBuffer > 0)
MsiRecordReadStream(hRec, 2, pBinary, nBuffer);
if(nBuffer > 0)then
nTotal = nTotal + nBuffer;
WriteBytes(nvFileHandle, pBinary, 0, nBuffer);
endif;
endwhile;
CloseFile (nvFileHandle);
endif;
MsiCloseHandle(hView);
MsiCloseHandle(hRec);
end;