WIX: installing DLL's of an application

2,510 views
Skip to first unread message

remoe

unread,
Sep 26, 2012, 1:41:51 PM9/26/12
to firebre...@googlegroups.com
Hi

First, i've read the documentation ;)
How can i add all DLL's of a project in wxs - file? I have an application 'exe' that need some dll every time. It is not a "feature". The wiki of Firebreath is not clear for me in this task:


i found ComponentGroupRef Id="PluginDLLGroup" . Put i don't understand from where it comes. And yes i've added the DLL's at:

<!-- Put Additional files here: -->
                            <!-- example:
                            <Component Id="UniqueComponentId" Guid="*">
                                <File Id="uniqueFileId" KeyPath="yes" Source="SourceDir\filename.ext" />
                            </Component>
                            /example -->
                            <!--  -->

But then it need's to define a feature. But my application as tons of DLL's. so i want to group this together. Is there any full sample WXS for this?

Thanks

Richard Bateman

unread,
Sep 26, 2012, 2:08:30 PM9/26/12
to firebre...@googlegroups.com

this is not a firebreath question; perhaps there will be people here who can help, but let's make sure that's clear to start out with =]

I recommend you read up a bit on WiX; my first guess, though, is that you added the component but didn't add the component to the feature declared at the bottom of the file.  Notice all those "<ComponentRef ...>" lines? Those all tell WiX that the named component belongs in that feature.

Richard

remoe

unread,
Sep 26, 2012, 2:33:04 PM9/26/12
to firebre...@googlegroups.com
Richard, thanks. Yes, i've see this lines. But i found in "add_wix_installer" the "WIX_DLLFILES" array. I tried to add multiple files to this:

set(WIX_DLL_FILES
a.dll
b.dll
c.dll
)

This compiles but it doesn't add this files to msi.

Richard Bateman

unread,
Sep 26, 2012, 4:28:03 PM9/26/12
to firebre...@googlegroups.com
WIX_DLLFILES has nothing whatsoever to do with what you're trying to do.  You're not modifying the cmake, you're changing the .wxs file.

Richard

Doug Keislar

unread,
Sep 26, 2012, 6:22:22 PM9/26/12
to firebre...@googlegroups.com
I'm encountering a problem where most of the time (not all the time)
npMyPlugin_auto.wxs is mistakenly in a skeletal form, resulting in:
error LGHT0204: ICE38
when Visual Studio 2010 is building MyPlugin_WiXInstall.vcxproj.
So far I haven't figured out why this usually happens or how to prevent
it. I haven't yet been able to isolate what's different between the
working and non-working environments, prior to the build. I need to
solve this problem in order to create a Windows installer.

Details are below. Has anyone seen this kind of thing, or does anyone
have any clues why it's happening and how to fix it?

In both the working and the non-working case, Visual Studio seems to
successfully build the plug-in itself from MyPlugin.vcxproj, before
attempting to build MyPlugin_WiXInstall.vcxproj. It's just the build of
MyPlugin_WiXInstall.vcxproj that fails. I think the output of
prep2010.cmd was the same in both cases as well, though I could be
wrong. I haven't done any tweaking of
projects/MyPlugin/Win/WiX/MyPluginInstaller.wxs yet -- for now, I'm just
using what prep2010.cmd generated, and I believe it's essentially the
same in the working and non-working case.

Parenthetically, I don't really understand how npMyPlugin_auto.wxs is
generated -- the build output seems to be saying that the .wxs is
actually compiled from the plug-in DLL, but maybe that's a misleading
message:
Compiling C:/build/bin/MyPlugin/Debug/npMyPlugin.dll ->
npMyPlugin_auto.wxs

Since npMyPlugin_auto.wxs is generated from FireBreath-created files,
I'm posting my question to the FireBreath group rather than the WiX
group, in hopes that someone here has seen or understands this problem.

Thanks in advance for any tips!
Doug


DETAILS:
============================
BROKEN VERSION OF build\projects\MyPlugin\npMyPlugin_auto.wxs:
-----------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<w:Wix xmlns:w="http://schemas.microsoft.com/wix/2006/wi"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<w:Fragment>
<w:DirectoryRef Id="INSTALLDIR" />
</w:Fragment>
<w:Fragment>
<w:ComponentGroup Id="PluginDLLGroup">
<w:Component Id="cmp99DB32B0616422AF6027EE83710EA9FE"
Guid="{E15B2C17-1028-413D-A790-C9FBDCFF2998}" Directory="INSTALLDIR">
<w:File Id="filDA9F2EE8D99B7917C6A7C4E45471A9B5"
Source="$(var.BINSRC)\npMyPlugin.dll" />
</w:Component>
</w:ComponentGroup>
</w:Fragment>
</w:Wix>

================================
WORKING VERSION OF build\projects\MyPlugin\npMyPlugin_auto.wxs:
-----------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<w:Wix xmlns:w="http://schemas.microsoft.com/wix/2006/wi"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<w:Fragment>
<w:DirectoryRef Id="INSTALLDIR" />
</w:Fragment>
<w:Fragment>
<w:ComponentGroup Id="PluginDLLGroup">
<w:Component Id="cmp99DB32B0616422AF6027EE83710EA9FE"
Guid="{5ADB207D-455F-4043-B999-26703C0F470E}" Directory="INSTALLDIR">
<w:File Id="filDA9F2EE8D99B7917C6A7C4E45471A9B5"
Source="$(var.BINSRC)\npMyPlugin.dll">
<w:TypeLib
Id="{75E05DC7-F9D1-5DA6-8083-D3BBF7232056}" Description="MyPlugin 1.0
Type Library" HelpDirectory="INSTALLDIR" Language="0" MajorVersion="1"
MinorVersion="0">
<AppId Description="FireBreathWin"
Id="{B415CD14-B45D-4BCA-B552-B06175C38606}"
xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Class
Id="{F7388CAE-B15E-5B8E-8FB2-FF830102F0C0}" Context="InprocServer32"
Description="my plugin" ThreadingModel="apartment" Version="1"
Programmable="yes" Control="yes">
<ProgId Id="MyCompany.MyPlugin.1"
Description="my plugin">
<ProgId Id="MyCompany.MyPlugin"
Description="my plugin" />
</ProgId>
</Class>
</AppId>
<Interface
Id="{41074FF4-459F-5514-A1F7-53F20AB8F8DD}" Name="IFBControl"
ProxyStubClassId="{00020424-0000-0000-C000-000000000046}"
ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}"
xmlns="http://schemas.microsoft.com/wix/2006/wi" />
<Interface
Id="{E73CE26A-A565-5CD5-9774-963E84DE7449}" Name="IFBComEventSource"
ProxyStubClassId="{00020420-0000-0000-C000-000000000046}"
ProxyStubClassId32="{00020420-0000-0000-C000-000000000046}"
xmlns="http://schemas.microsoft.com/wix/2006/wi" />
<Interface
Id="{F8868EE9-14F0-5055-BCA2-3087BD1830F8}"
Name="IFBComJavascriptObject"
ProxyStubClassId="{00020424-0000-0000-C000-000000000046}"
ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}"
xmlns="http://schemas.microsoft.com/wix/2006/wi" />
</w:TypeLib>
</w:File>
<ProgId Id="MIME"
xmlns="http://schemas.microsoft.com/wix/2006/wi" />
<w:RegistryValue Key="AppID\npMyPlugin.dll"
Value="{B415CD14-B45D-4BCA-B552-B06175C38606}" Type="string"
Action="write" Name="AppID" Root="HKCR" />
<w:RegistryValue
Key="CLSID\{f7388cae-b15e-5b8e-8fb2-ff830102f0c0}\MiscStatus\1"
Value="131473" Type="string" Action="write" Root="HKCR" />
<w:RegistryValue
Key="CLSID\{f7388cae-b15e-5b8e-8fb2-ff830102f0c0}\MiscStatus" Value="0"
Type="string" Action="write" Root="HKCR" />
<w:RegistryValue Key="MIME\Database\Content
Type\application/x-myPlugin" Value="my plugin" Type="string"
Action="write" Root="HKCR" />
<w:RegistryValue Key="MIME\Database\Content
Type\application/x-myPlugin" Value="" Type="string" Action="write"
Name="Extension" Root="HKCR" />
<w:RegistryValue Key="MIME\Database\Content
Type\application/x-myPlugin"
Value="{f7388cae-b15e-5b8e-8fb2-ff830102f0c0}" Type="string"
Action="write" Name="CLSID" Root="HKCR" />
<w:RegistryValue
Key="Software\Microsoft\Windows\CurrentVersion\Ext\PreApproved\{f7388cae-b15e-5b8e-8fb2-ff830102f0c0}"
Value="" Type="string" Action="write" Root="HKCU" />
<w:RegistryValue
Key="Software\Microsoft\Windows\CurrentVersion\Ext\Stats\{f7388cae-b15e-5b8e-8fb2-ff830102f0c0}\iexplore\AllowedDomains\*"
Value="" Type="string" Action="write" Root="HKCU" />
<w:RegistryValue
Key="Software\Microsoft\Windows\CurrentVersion\Ext\Stats\{f7388cae-b15e-5b8e-8fb2-ff830102f0c0}\iexplore"
Value="-858993460" Type="integer" Action="write" Name="Count" Root="HKCU" />
<w:RegistryValue
Key="Software\MozillaPlugins\mycompany.com/MyPlugin"
Value="[!filDA9F2EE8D99B7917C6A7C4E45471A9B5]" Type="string"
Action="write" Name="Path" Root="HKCU" KeyPath="yes" />
</w:Component>
</w:ComponentGroup>
</w:Fragment>
</w:Wix>
================================
As you can see, the working version has a fleshed-out <w:File> field,
followed by a <ProgId field> and multiple <w:RegistryValue> fields,
which are missing in the broken version. Other than that, the broken
and working versions are identical (except for different GUIDs).

Here is the build output in the broken case:

------ Build started: Project: MyPlugin_WiXInstall, Configuration: Debug
Win32 ------
Building Custom Rule C:/projects/MyPlugin/CMakeLists.txt
CMake does not need to re-run because
C:\build\projects\MyPlugin\CMakeFiles\generate.stamp is up-to-date.
Compiling C:/build/bin/MyPlugin/Debug/npMyPlugin.dll ->
npMyPlugin_auto.wxs
Windows Installer Xml Toolset Harvester version 3.6.3303.0
Copyright (C) Outercurve Foundation. All rights reserved.

heat.exe : warning HEAT1108: The command line switch 't:' is deprecated.
Please use 't' instead.
heat.exe : warning HEAT5150: Could not harvest data from a file that was
expected to be a SelfReg DLL:
C:\build\bin\MyPlugin\Debug\npMyPlugin.dll. If this file does not
support SelfReg you can ignore this warning. Otherwise, this error
detail may be helpful to diagnose the failure: Unable to load file:
C:\build\bin\MyPlugin\Debug\npMyPlugin.dll, error: 126
Compiling C:/build/projects/MyPlugin/MyPluginInstaller.wxs ->
MyPluginInstaller.wixobj
Windows Installer Xml Compiler version 3.6.3303.0
Copyright (C) Outercurve Foundation. All rights reserved.

MyPluginInstaller.wxs
Compiling C:/build/projects/MyPlugin/npMyPlugin_auto.wxs ->
npMyPlugin_auto.wixobj
Windows Installer Xml Compiler version 3.6.3303.0
Copyright (C) Outercurve Foundation. All rights reserved.

npMyPlugin_auto.wxs
Skipping... (no relevant changes detected)
dummy.cpp
dummy.obj : MSIL .netmodule or module compiled with /GL found;
restarting link with /LTCG; add /LTCG to the link command line to
improve linker performance
MyPlugin_WiXInstall.vcxproj ->
C:\build\projects\MyPlugin\Debug\MyPlugin_WiXInstall.lib
Windows Installer Xml Linker version 3.6.3303.0
Copyright (C) Outercurve Foundation. All rights reserved.

C:\build\projects\MyPlugin\npMyPlugin_auto.wxs(8): error LGHT0204:
ICE38: Component cmp99DB32B0616422AF6027EE83710EA9FE installs to user
profile. It must use a registry key under HKCU as its KeyPath, not a file.

Richard Bateman

unread,
Sep 26, 2012, 6:35:03 PM9/26/12
to firebre...@googlegroups.com

The npMyPlugin_auto.wxs is generated using the WiX tool heat.exe. Basically it runs DllRegisterServer and captures the output.

That your DLL is not working correctly with it means that regsvr32 doesn't work with it properly, which is *usually* caused by linking to a DLL file that is needed by isn't present / can't be loaded.

Richard

remoe

unread,
Sep 27, 2012, 8:37:52 AM9/27/12
to firebre...@googlegroups.com
Richard, I've read the WiX documentation. I found that i must create a new GUID and a registry entry like the following:

      <Component Id="projComp" Guid="{f33cc67c-b219-4547-a4bc-0b17369f6c94}">
        <File Id="proj" KeyPath="no" Source="${PLUGIN_BIN_DIR}proj.dll" />
        <RegistryValue Root="HKCU" KeyPath="yes" Key="SOFTWARE\${COMPANY_NAME}\${PLUGIN_NAME}\${FBSTRING_PLUGIN_VERSION}\proj" Name="Uninstall" Type="string" Value="${FBSTRING_PLUGIN_VERSION}" />
      </Component>

Richard Bateman

unread,
Sep 27, 2012, 10:45:38 AM9/27/12
to firebre...@googlegroups.com

That would make sense.  Glad you got it working.

Richard

Doug Keislar

unread,
Sep 27, 2012, 5:51:52 PM9/27/12
to firebre...@googlegroups.com
Thanks for your tip, Richard! My plug-in DLL requires some other
DLLs. I found that the problem disappeared after I manually copied
those DLLs alongside the plug-in DLL into build/bin/MyPlugin/Debug/. (I
imagine this step will be unnecessary once I specify them in
MyPluginInstaller.wxs.)

Doug
> .
>

Richard Bateman

unread,
Sep 27, 2012, 6:02:05 PM9/27/12
to firebre...@googlegroups.com

Actually you'll probably need to create a post-build step in your plugin project to copy the DLL files over for you before WiX runs.  MyPluginInstaller.wxs doesn't affect the call to heat.exe in any way.

grabbing a sample from one of my projects, it might look something like this:

get_property(PLUGIN_PATH TARGET ${PROJECT_NAME} PROPERTY LOCATION)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy "${DLL_PATH}" "${PLUGIN_PATH}/"
    )

I haven't actually tested that, but it looks about right. ${DLL_PATH} would need to refer to the path where your DLL is, of course.  to be a little more flexible in finding the location of the file, you could use http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:find_file

Richard
Reply all
Reply to author
Forward
0 new messages