Darqer
Darqer

Reputation: 2887

Wix and custom .net dll

I'm searching for some complete sample of wix project with reference to .NET dll (complete wix VS project, .net dll VS project, and compiled .net dll).

I'm trying to run SampleAskKeyNet and constantly I got error "There is a problem with this Windows Installer package. A DLL required for this installation to complete could not be run. Contact your support personnel or package vendor and I'm trying to find what I made wrong.

I created wix project in VS, .net dll project in VS, compiled dll project, copy over CheckPidPackage.dll to wix VS project directory and compile wix project. Then I run it and I get this error.

Upvotes: 3

Views: 3296

Answers (4)

Chaitanya Gadkari
Chaitanya Gadkari

Reputation: 2807

Link mentioned in accepted answer(by user431821) was indeed helpful but posting the exact thing which was helpful to me.

Custom actions project creates 2 dlls. If project is CustomActionProject, it will create CustomActionProject.dll and CustomActionProject.CA.dll

I was referencing to CustomActionProject.dll as below which is regular dll.

<Binary Id="CustomActionProject"
     src="..\CustomActionProject\bin\$(var.Configuration)\CustomActionProject.dll" />
<CustomAction Id="MyAction"
    Return="check"
    BinaryKey="CustomActionProject"                  
    DllEntry="Validate"/>

WIX creates CustomActionProject.CA.dll which is actually NOT the .NET managed assembly but unmanaged assembly. SO we have to refer to it instead of regular one.

<Binary Id="CustomActionProject"
     src="..\CustomActionProject\bin\$(var.Configuration)\CustomActionProject.CA.dll" />
<CustomAction Id="MyAction"
    Return="check"
    BinaryKey="CustomActionProject"                  
    DllEntry="Validate"/>

This solved my issue.

Upvotes: 5

Chris Schiffhauer
Chris Schiffhauer

Reputation: 17310

For me, it was my CustomAction DllEntry did not match my method name. i.e.

<CustomAction Id="CheckingPID" BinaryKey="CheckPID.CA" DllEntry="BadValue" />

public static ActionResult CheckPID(Session session)

Upvotes: 1

user431821
user431821

Reputation:

Maybe this could be useful: http://www.codeproject.com/KB/install/wixcustomaction.aspx

Upvotes: 4

Darqer
Darqer

Reputation: 2887

I forgot to use MakeSfxCA.exe on dll in order to wrap it.

More details here Custom Action in C# used via WiX fails with error 1154 and here http://blog.deploymentengineering.com/2008/05/deployment-tools-foundation-dtf-custom.html

Upvotes: 0

Related Questions