0
votes

I need to execute one DLL during installation of MSI package . The DLL will create a DSN. I added a custom action for that.

    <Binary Id="CustomActionBinary" SourceFile="C:\MemDbDrv_3010.dll"/>
    <CustomAction Id="CustomActionId" BinaryKey="CustomActionBinary" DllEntry="SelfInstall" Execute="immediate" Return="check" />

    <InstallExecuteSequence>
        <Custom Action="CustomActionId" Before='InstallFinalize'/>
    </InstallExecuteSequence>

It is compiling fine. But while installing the package I am getting the below error "There is a problem with this Windows installer package.A DLL required for this install to complete could not be run. Contact your support personnel or package vendor" Can you please help what could be the resolution

1

1 Answers

0
votes

Your custom action crashed or didn't load, so you may need to say what language it is and worry about missing dependencies, or even show the code if you don't get anywhere with this. However:

  1. Immediate custom actions run before anything is installed, so if it has any dependent Dlls then they won't yet be installed.

  2. Immediate custom actions shouldn't alter the system because they can't be undone in the event of the install failing. It should be deferred with a rollback to undo it.

  3. It's won't run elevated as immediate, so if it needs privilege to work then it will fail. Deferred CAs run elevated with the system account if they are impersonation=no, so that may be what you need.