/build/static/layout/Breadcrumb_cap_w.png

custom action to register a dll

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:
RegSvr32
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   [ + ] Show comments

Answers (10)

Posted by: anonymous_9363 15 years ago
Red Belt
1
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).
Posted by: AngelD 15 years ago
Red Belt
0
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.
Posted by: Packaging123 15 years ago
Blue Belt
0
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.
Posted by: sk 15 years ago
Senior Yellow Belt
0
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
Posted by: anonymous_9363 15 years ago
Red Belt
0
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.
Posted by: turbokitty 15 years ago
6th Degree Black Belt
0
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!

[:D]
Posted by: cmi2000 15 years ago
Senior Purple Belt
0
Hi,
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!
Posted by: AngelD 15 years ago
Red Belt
0
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?"!
Posted by: anonymous_9363 15 years ago
Red Belt
0
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.
Posted by: AngelD 15 years ago
Red Belt
0
Ian,

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

Cheers! :D
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ