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>
source to share
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 is
C:\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">
source to share
Try changing DllEntry
from WixQuietExec
to CAQuietExec
and using the propertyQtExecCmdLine
refer to https://www.firegiant.com/wix/tutorial/standard-libraries/silence-please/
source to share
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.
source to share