cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rjking
Level 3

how do I pass INSTALLDIR to a DLL function?

I am using InstallShield 2008 Pro and need to pass INSTALLDIR to a DLL function and return another path (where we will install data files). The function signature dialog does not offer INSTALLDIR as a property that can be passed across as an argument to our function. Can someone tell me how to do this or an alternative way of copying and manipulating the Install directory path and assigning this to another property. We do not want to use VBScript or InstallScript unless we absolutely have to.

Thanks, Richard
Labels (1)
0 Kudos
(3) Replies
fanasus
Level 4

you can create the function with passing msi handle. For example:

1. create the function: (make sure to export this function)
UINT __stdcall TestInstallPath(MSIHANDLE hMsi)
{
TCHAR szInstallPath[MAX_PATH];
DWORK dwSize=sizeof(szInstallPath);
memset(szInstallPath,0,sizeof(szInstallPath)*sizeof(TCHAR));

//get the property INSTALLDIR, in fact, you can get any property if it exist.
MsiGetProperty(hMsi, _T("INSTALLDIR"), szInstallPath, &dwSize);
return ERROR_SUCCESS;
}

2. add the custom action for TestInstallPath.
. Open the Custom Actions in InstallShield 2008, click right button to select "New MSI DLL" to add new custom action.

Regards,
fanasus
0 Kudos
rjking
Level 3

That did the trick!
0 Kudos
Anand_Choubey
Level 3

Hi,

This will not work in deferred execution. You will have to access by CustomActionData only.

Anand
0 Kudos