0

I have a custom action which should be run on uninstall. But for unknown reason the msiexec says "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.". The code goes below:

<Binary SourceFile="SetupWiX.CA.dll" Id="Binary1"  />       
<CustomAction Id="DropDatabase" BinaryKey="Binary1" DllEntry="DropDatabase" Execute="deferred" Return="check"/>
<Custom Action='DropDatabase'  After="SetCustomActionDataValue_DropDatabase">Installed</Custom>

I have few other custom actions that run on install and they run fine. Everything is same there except the conditions. So how can I make my custom action run on uninstall correctly? I've created a blank wix setup project, and a simple custom action that shows message box on uninstall, and it works fine. I don't know what is the problem with my first custom action. I use the same DLL on install and uninstall. The error log goes below:

Action start 16:07:34: INSTALL.
Action start 16:07:34: ValidateProductID.
Action ended 16:07:34: ValidateProductID. Return value 1.
Action start 16:07:34: CostInitialize.
Action ended 16:07:34: CostInitialize. Return value 1.
Action start 16:07:34: FileCost.
Action ended 16:07:34: FileCost. Return value 1.
Action start 16:07:34: CostFinalize.
Action ended 16:07:34: CostFinalize. Return value 1.
Action start 16:07:34: InstallValidate.
Action ended 16:07:34: InstallValidate. Return value 1.
Action start 16:07:34: InstallInitialize.
Action ended 16:07:37: InstallInitialize. Return value 1.
Action start 16:07:37: ProcessComponents.
Action ended 16:07:37: ProcessComponents. Return value 1.
Action start 16:07:37: UnpublishFeatures.
Action ended 16:07:37: UnpublishFeatures. Return value 1.
Action start 16:07:37: RemoveFiles.
Action ended 16:07:37: RemoveFiles. Return value 0.
Action start 16:07:37: InstallFiles.
Action ended 16:07:37: InstallFiles. Return value 1.
Action start 16:07:37: DropDatabase.
Action ended 16:07:37: DropDatabase. Return value 1.
Action start 16:07:37: RegisterUser.
Action ended 16:07:37: RegisterUser. Return value 0.
Action start 16:07:37: RegisterProduct.
Action ended 16:07:37: RegisterProduct. Return value 1.
Action start 16:07:37: PublishFeatures.
Action ended 16:07:37: PublishFeatures. Return value 1.
Action start 16:07:37: PublishProduct.
Action ended 16:07:37: PublishProduct. Return value 1.
Action start 16:07:37: InstallFinalize.
CustomAction DropDatabase returned actual error code 1154 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (D4:DC) [16:07:41:650]: Product: MyProduct -- Error 1723. 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.  Action DropDatabase, entry: DropDatabase, library: C:\Windows\Installer\MSI4DEF.tmp 

Error 1723. 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.  Action DropDatabase, entry: DropDatabase, library: C:\Windows\Installer\MSI4DEF.tmp 
Action ended 16:07:41: InstallFinalize. Return value 3.
Action ended 16:07:42: INSTALL. Return value 3.
Bogdan Verbenets
  • 25,686
  • 13
  • 66
  • 119
  • 1
    Have you viewed the MSI logs to see exactly what is going wrong? – saschabeaumont Apr 21 '11 at 02:36
  • @saschabeaumont the logs contain exactly same error, no detailed description is available – Bogdan Verbenets Apr 21 '11 at 07:22
  • 1
    And your CA DLL definitely exports the function DropDatabase(MSIHANDLE h)? Have you tried copying the SetupWiX.CA.dll to the target system and running depends.exe on it to make sure it loads OK. – Stephen Connolly Apr 21 '11 at 12:15
  • @Stephen Connolly, no, I haven't, but I'll try. Of course the DLL contains the DropDatabase method. – Bogdan Verbenets Apr 21 '11 at 12:16
  • @Stephen Connolly Yes, it loads fine except ieshims.dll, for which I get "Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.". But I don't know what this library is any way. ieshims is not mine. – Bogdan Verbenets Apr 26 '11 at 14:20
  • 1
    Can you post the previous 10 lines before the error, that might give an idea about how the installer service is trying to load the DLL. Also just checking - do you use the same DLL on installation and that works fine? – Stephen Connolly Apr 27 '11 at 08:41
  • @Stephen Connolly, yes, I use the same library. I've added the log to my question. – Bogdan Verbenets Apr 27 '11 at 13:10
  • Any hints here (http://stackoverflow.com/questions/3560370/custom-action-in-c-used-via-wix-fails-with-error-1154). Is your exported CA signature correct? – Stephen Connolly Apr 27 '11 at 22:08

1 Answers1

0

The problem was in my custom action method being private, not public.

Bogdan Verbenets
  • 25,686
  • 13
  • 66
  • 119