New User

URGENT : CUSTOM DLL QUESTION

Hi

I tried to retrieve the target path using the MsiGetTargetPath function. The code I used to retrieve the target path is as follows

if(MsiGetTargetPath(hInstall, _T("TARGETDIR"), szBuf,&cch)==ERROR_SUCCESS)
{
MessageBox(NULL,szBuf,MB_OK,0);

}
else
{
MessageBox(NULL,"Error occurred",MB_OK,0);
}

Messagebox returns a blank. i.e szBuf is empty.

Thanks
Pete Furness
Posts: 16
Joined: Fri Feb 20, 2004 9:34 am
Location: SURREY, UK

After some experimentation I found that I could get the [TARGETDIR], in my case to store a registry key, by adding an entry in the registry section thus...
HKLM\SOFTWARE\MYCO\MYAPP
with a Name: myname
and a Value: "[TARGETDIR]"
Hope this helps
Pete
amalia

Hi,

We investigated your problem and we have an answer: all the custom actions you can add to the project are deferred custom action. This means you only hava access to a limited amount of information about Installer database inside these custom actions. For detailed information see "Obtaining Context Information for Deferred Execution Custom Actions" in MSDN Library.

One solution is to make something similar to what Pete Furness suggested. However, the best you can do at this time is to change the DLL into an EXE custom action and transmit as a command line argument the string [TARGETDIR].

In the future we will improve the custom action support.
Regards,
Amalia
New User

URGENT -- Custom DLL

Hi

Can I retrieve the value of the registry key even before complete installation.

If so, can you give some detail explanantion on that.

Thanks

Return to “Common Problems”