What is the best way to register a dll in a wise package?

I included it as a custom action, but Iam seeing this error:
LoadLibrary("ProgramName\Filename.dll") failed - the specified module could not be found

The dll file is part of the installation: (C:\Program files\Program Name\filename.dll)

I created a custom action and added it after InstallFinalize

Custom Action:
Execute Program from Installation Command Line [ProgramFiles]ProgramName\Filename.dll (Action1)

In the Details tab for Action1 Properties:
Custom Action Name: Action1
Executable File: [SystemFolder]regsvr32.exe
Command Line Arguments: [ProgramFiles]\ProgramName\filename.dll

Location Tab:
Sequence: Normal Execute Immediate/Deferred
and the Action1 is all the way down after InstallFinalize andthe condition is NOT Installed

Properties Tab:
Immediate Execution, Synchronous and Always Execute
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Do not use self-registration such as the SelfReg table, regsvr32.exe /i <path to .dll> or msiexed /y.
Instead extract the registration registry information and add it either in the Registry table or COM-advertise related tables (such as Class, TypeLib, ProgId...). From memory, wisecompcap.exe should do this for you.
Answered 12/02/2008 by: AngelD
Red Belt

Please log in to comment
Without using the custom action try adding the dll file to the C:\Program files\Program Name\filename.dll and add the dll file in msi. Do the following procedure as below

1. Select the dll file in the msi and Right click and select Details
2. In File Details window select Self Registration tab
3. In Registration method : Use Ordered specified below

This will do self registration for your dll.
Answered 12/02/2008 by: Packaging123
Blue Belt

Please log in to comment
This will do self registration for your dll.No, no, no, no NO! As we keep banging on here, self-registration is the work of Satan, as is using RegSvr32/MSIExec /y. This is precisely because of the problem the OP had, namely that if any depdency is missing, the registration will fail. If your package is responsible for delivering the dependency, then include it. If it isn't, add an AppSearch for ALL dependencies and abort the install if they're not present.

Finding dependencies is a no-brainer: load the DLL into the freely-available Depency Walker tool.

Wise includes a tool called WiseComCapture which will extract COM information into a .REG file. Its use can easily be scripted if you have many DLLs/OCXs from which tio extract that information. Once you have your .REG(s), import them into your project, answering 'Yes' when Wise asks you if you want to use the advertising tables.

Next, turn off the option in Wise which populates the SelfReg table (Tools/Options/Advertising/Advertising Setting/Scan advertising information into advertising tables).
Answered 12/03/2008 by: VBScab
Red Belt

Please log in to comment
I agree with VBScab, the SelfReg should be avoided as the plague. If you have a file in a component add the registry information by importing a .reg file to it, recently I use a tool called RegSpy.exe (but that also doesn't work if the dependency is not there). The advantage of a component with registry info is that it will always install and the rest of the info could be on the machine. It is better to put all the dependencies also in the package because that makes it more robust and let the application also work on an empty machine
Answered 12/04/2008 by: sk
Senior Yellow Belt

Please log in to comment
It is better to put all the dependencies also in the packageNot necessarily. It depends very much on the package and its dependencies. Don't forget that there are dependencies which vendors are prohibited (by licensing restrictions, for example) from distributing.

As I say, the very least that should be in the package is an AppSearch (or several) and a failure/flag if anything is missing.
Answered 12/04/2008 by: VBScab
Red Belt

Please log in to comment
We get this question constantly.

Can we get a sticky on this.. or better yet.. VBScab is the dll expert.. how about a little article to post and sticky?

I know there's an ugly trick to get COM extraction to work in Wise.. I haven't done it in awhile so I've already forgotten. I think VBScab or someone had a little script that ran the Wise tool and what have you. That would be good info too!

Answered 12/04/2008 by: turbokitty
Sixth Degree Black Belt

Please log in to comment
I have used a vbscript that registers the dlls from a CA:

Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "regsvr32.exe c:\windows\system32\whatever.dll"

This worked for my!
Answered 12/09/2008 by: cmi2000
Senior Purple Belt

Please log in to comment
Why do everyone keep posting how to "self-register" a DLL when the question was "What is the best way to register a dll in a wise package?"!
Answered 12/09/2008 by: AngelD
Red Belt

Please log in to comment
Yeh! Keep the easy ones coming, Kim! :)

It's because

a) WPS defaults to using the SelfReg table, something I asked them to fix a gazillion years ago. (Yes, flamers, I know not everyone uses WPS but I'd say a substantial number of AppDeploy posters - especially newcomers - do), and
b) they're too bone idle to research issues before posting.
Answered 12/10/2008 by: VBScab
Red Belt

Please log in to comment

Would you take up the request from Kitty regarding "Preferred way to register COM/ActiveX-components through COM-Advertising"?

Cheers! :D
Answered 12/10/2008 by: AngelD
Red Belt

Please log in to comment