This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Will not work under deferred execution
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 10, 2008
12:18 AM
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
Thanks, Richard
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 10, 2008
02:10 AM
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 14, 2008
11:04 PM
That did the trick!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 15, 2008
01:00 AM
Hi,
This will not work in deferred execution. You will have to access by CustomActionData only.
Anand
This will not work in deferred execution. You will have to access by CustomActionData only.
Anand
![](/skins/images/19F9C6DC056868BD0EEB3511534AB4E7/responsive_peak/images/icon_anonymous_message.png)