Wix Installer error "DLL required for this installation to complete"

When I run the installer I get this error: There is a problem with this Windows Installer package. A DLL required to complete this installation could not be started. Any hint?

Snippet of code:

    <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="GoGo" UpgradeCode="9bfe9221-2d7d-46ee-b483-88f00e14b4b3">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

    <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
      <ComponentGroupRef Id="ProductComponents"/>
    </Feature>

    <!--<Binary Id="WixCA" SourceFile="WixCA.dll" />-->

    <Property Id="QtExecDeferredExample" Value="InstallManager.exe"/>
    <CustomAction Id="QtExecDeferredExample" BinaryKey="WixCA" DllEntry="WixQuietExec"
                Execute="immediate" Return="check" Impersonate="no"/>

    <InstallExecuteSequence>
      <Custom Action="QtExecDeferredExample" Before="InstallFinalize">NOT Installed</Custom>
    </InstallExecuteSequence>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="SetupProject1" >
          <Component Id='MainExecutable'>
            <File Id='InstallManagerEXE'
                  Name='InstallManager.exe'
                  DiskId='1'
                  Source='InstallManager.exe'
                  KeyPath='yes'/>
          </Component>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <ComponentRef Id='MainExecutable' />
    </ComponentGroup>
  </Fragment>


</Wix>

      

+3


source to share


4 answers


Your question has two answers.

First answer: shared DLL

When configuring a custom action, an attribute appears DllEntry="WixQuietExec"

. You have to package the DLL with this code:

<Binary Id="WixCA" SourceFile="WixQuietExec.dll" />

      

This tag must be created internally Product

.

So your code will be like this:

...
<Binary Id="WixCA" SourceFile="WixQuietExec.dll" />
<CustomAction Id="QtExecDeferredExample" BinaryKey="WixCA" DllEntry="WixQuietExec"
              Execute="deferred" Return="check" Impersonate="no" />
...

      



Don't forget to include CustomAction[BinaryKey]

and Binary[Id]

.

Second answer: WixUtilExtension

In particular, for a standard custom action like QtExec , you only need to provide a link to the extension.

  • In Solution Explorer, expand the links in your project
  • Right click on it and select Add Link
  • Find the folder where the WiX Toolkit is installed. Then select the bin folder. In my case, the full path isC:\Program Files (x86)\WiX Toolset v3.8\bin

  • Select WixUtilExtension.dll and click "Add" and then "OK"

Modify the tag Wix

by adding xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"

. For example, your tag would be:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

      

+1


source


Try changing DllEntry

from WixQuietExec

to CAQuietExec

and using the propertyQtExecCmdLine



refer to https://www.firegiant.com/wix/tutorial/standard-libraries/silence-please/

+1


source


I faced the same problem (error 1157) when I switched from using the CAQuietExec extension to WixQuietExec. I was using Wix Toolset 3.9 when the error occurred.

I solved this problem by installing Wix Toolset 3.10.1 (this is the latest stable version now) and the WixQuietExec extension works as expected.

+1


source


For anyone who comes across this issue while developing a custom action using C #, I suggest making sure that

  1. The BinaryKey refers to the generated * .CA.dll and not the actual DLL file.
  2. Make sure the called method has the [CustomAction] attribute.
0


source







All Articles