'Module something.dll failed to register' when trying to make a DLL register

Mike McGavin

Posts: 38Joined: 2011-05-31

Hello.

I've been using the WiX designer for the first time and despite some looking around the forums it's possible I've missed something obvious regarding the following problem (sorry!).

I have a scenario with a ComVisible DLL, built by another project. Once copied to the system by my installer, it needs to be registered on the system with an equivalent of running "regasm /codebase filename.dll".

I used to be able to do this with the old VS2010 setup projects, despite all their bugginess, by telling the DLL to register via one of the Properties window of the setup project. I've tried something similar in the interface of the WiX designer. In the File System Editor, I've found the primary output for the DLL within the Application Folder, and set its Register property to 'vsdrfCOMSelfReg'.

Unfortunately when I then go to run the MSI that's built, I get a pop-up Cancel/Retry/Ignore warning dialog with the message:

At first I thought this might be UAC related, even though the installer was already prompting for UAC permission. Based on some previous piecemeal WiX experience I edited the Product.wxs file, and for the Package eleent I made sure the InstallPrivileges attribute it set to 'elevated'. Despite this, and even if I run it with 'msiexec /i installer.msi' from an admin-privileged command prompt (so there shouldn't be any chance of it not having the right privileges by the time it tries to register), I'm seeing the same error.

Is there anything obvious I might be missing? I'm happy to provide more info on request.

So far this is entirely on my development machine. The DLL is compiled with the [ComVisible(true)] attribute set, and I can successfully register it manually with RegAsm. which for what it's worth is running Windows 10, WiX 3.10, WiX Designer v106-b204-std, and Visual Studio 2013.

[Edit/Addition] It seems on this occasion I've actually been using VS2013 (corrected above). I have also since tried upgrading the designer to v107-b205, re-opening the project, switching the Register property in the File System viewer to vsdrfDoNotRegister and then back to vsdrfCOMSelfReg, and recompiled... but unfortunately have the same result when running the MSI.

Also, it looks as if the RegisterForCOM.xml file that's in the XSLT folder of the project merely has an empty COMLibraries element. Should this file have more content if I'm trying to get the installer to register a DLL?

Thanks for the help, and sorry for taking so long to respond. It's less urgent at this point as I reverted to hacking together a WiX project independently that does what I want. (Basically by using "RegAsm /regfile" and Heat.Exe to generate a heap of XML for registry values to be installed as a component). It'd still be very helpful to be able to use the designer for all of this in future, though, because we often make small .Net components which require registration in this way.

Is what you've suggested documented anywhere at present? I've had a quick look in the documentation PDF and couldn't see anything.

The DLL I'm trying to register is the Primary Output of another project, and I'm having trouble identifying the various ID values which relate to it. I can see what I *think* would be the appropriate File ID in a generated file at "obj\Release\Harvested XML\_[projectName].xml". As this is XML is generated by running Heat.Exe at compile time, though, I'm unsure if I can predict the ID value (prior to compilation) that would be appropriate for going into RegisterForCOM.xml.

No, this feature is not documented. It was added to support the conversion of vdproj setup projects to WiX.
The more reliable way is to use RegAsm. However you can use RegisterForCOM.xml as well. To register project output you need to add the following XML to the RegisterForCOM.xml file:

This technology is now available for our custom development services only. Based on the Add-in Express for Office core, it is designed for building custom-tailored Office add-ins with far less coding than you usually have to do. Plus, it includes all Add-in Express features such as True RAD, visual designers, Outlook view and form regions, etc.

Get the best platform for building version-neutral, fast and easy deployable plug-ins by using Add-in Express projects templates, visual designers, components and wizards in combination with a perfect Delphi compiler.

This is an extension for Visual Studio that allows developers to quickly create WiX-based setup projects in a familiar Visual Studio way.

The Designer for WiX Toolset lets you forget the plain Windows Installer XML and concentrate on your deployment logic. It integrates several editors with the Visual Studio IDE and provides a set of vdproj designers to configure the file system, registry, user interface, custom actions, launch conditions and more for your setup projects.

The innovative technology for customizing Outlook views and forms. It is included in all Add-in Express for Office products and can be used to extend Outlook views, e-mail, task and appointment windows, To-Do bar, Reading and Navigation panes with your own custom sub-panes.

Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in
the United States and/or other countries. All other trademarks are property of their respective owners.