0
votes

I have added the custom action in Merge Module Project in InstallShiled.

PFA: Screenshot for more info. Custom Action

I have set the property in Property Manager in Merge Module Project.

Key = "CustomActionData", Value = "[INSTALLDIR]"

PFA: Screenshot more info. InstallPath

I have shared sample MSI DLL Source code.

PFA: Screenshot more info. MSI DLL Source code

I have built merge module and added in Basic MSI Project.

I have added Custom Action from Merge Module file.

PFA: Screenshot more info. Custom Action Added in Basic Project

I have built basic MSI project and InstallShield generated setup.exe.

When I run setup.exe then The install function called in Custom Action MSI DLL. But It gets to failed custom Action Data.

PFA: Screenshot for more info. Error

same issue working on Visual Studio 2010 installer but install shield has failed to get install path during installation using

UINT gp = ::MsiGetProperty( hInstall,
                               _T("CustomActionData"), 
                               customData, 
                               &len);
2

2 Answers

0
votes

You need to change the name of your property that you are setting from CustomActionData to the name of the deferred custom action that will receive the CustomActionData. In this case that would be CustomActions.

0
votes

The problem is: You did not add Property using Property Manager.

  1. You need to custom action in InstallShiled.

    Add Custom Action

  2. You need to add "New Set Property" in Custom Action Section.

New Set Property

  1. You need to fill up information of "newly Set Property" in Custom Action Section.

New Set Property fill up information

  1. Property Name = Custom Action Name

    Example:

    Property Name = "Installation"

  2. You need to use "CustomActionData" in C++ MSI DLL Source code.

    Example:

    MsiGetProperty( hInstall, _T("CustomActionData"), customData, &len);