How do I embed CustomAction.CA.dll in to MSI?
Asked Answered
S

1

1

I am using wix toolset to create MSI build.

Here is the Binary source in Product.wxs file.

    <Binary Id="BI.CA" 
         SourceFile="..\..\CustomAction\bin\$(var.Configuration)\CustomAction.CA.dll" />

MSI generated and works as expected in local but fails in build machine showing below error.

Could not find CustomAction.CA.dll

I see that CustomAction.CA.dll is present in the build machine but not the path which I specified.

How do I embed this dll in to MSI?

Update

In build machine, I see the DLL here

E:\BuildAgent\1\b\CustomAction.CA.dll"

Sasnett answered 8/8, 2019 at 8:25 Comment(5)
Have you added a dll reference to your wix project?Tay
I added as project referenceSasnett
Did I send you my WiX quick-start ad-hoc lunatic answer before? Just heading out the door, there are sample links. Perhaps one of them has what you need. Otherwise, try github.com.Ostensory
Throwing in this C++ CA answer. And one more. Probably not useful, just lobbing some links on the run.Ostensory
@SteinÅsmul I made it work by adding $(TargetDir) in source file path. it worked now on build machine. but fails in local :) anyways let me read your documents. Meanwhile now I am stuck with upgrade issues. Might create new quesiton if I do not find answer any where else. basically it says "anouther verson already exists" but I have changed verison number and GUID ID in new MSISasnett
O
2

When your DLL has the name CustomAction.CA.dll that should not be! Then you need to double the CA here <Binary Id="BI.CA" SourceFile="..\..\CustomAction\bin\$(var.Configuration)\CustomAction.CA.CA.dll" />

The CA is an internal postfix for the DLL but the output / target of your Custom Action Library should not have it in the name.

You have two options:

a) Remove the CA from the output target in Custom Action project
b) Introduce a second CA in MSI-Project Binary Element

See also How to execute a WiX custom action DLL file with dependencies

Overbearing answered 20/2, 2020 at 17:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.