Archive: Problems register COM DLL under Vista Buisness


Problems register COM DLL under Vista Buisness
I have to register a COM Dll during the installation.

It is working under Windows 2000 and XP, but not under Vista.

First I used:

RegDLL "$INSTDIR\MyDLL.dll"


Then I used:

!insertmacro InstallLib REGDLLTLB NOTSHARED NOREBOOT_NOTPROTECTED "MyDLL.dll" "$INSTDIR\MyDLL.dll" "$SYSDIR"


If I run the installation under vista a second time the dll will be registered.

I think I feel confused and found no explanation. Does anybody has an idea?


Does it work if you manually register it using regsvr32?


No, even using regsvr32 is not working


Then the problem is with the DLL itself.


Hello,

thanks for your answer. The problem is not with the DLL itself. I checked this with several COMM DLL´s, always the same.

If you search in Google for "regsvr32" and "Vista" you will find a lot of people having problems to install a COM DLL under vista.

The program I install is for users having low level skills using a PC. They are not able to switch off the "UAC". I´m still hunting for a solution.


If it's a general problem with registration of COM DLL files on Vista, I doubt this is the best place to look for an answer. You may get better responses from some COM development community. I don't have any idea what might go wrong with every COM DLL that'd cause it to work only on the second registration.


As I can read out from your answers you have no idea. Even it is a problem of vista the installer should help to solve this problem. I can see in the forum I´m not the only one with this problem.

An installer that is working only on several Operating systems is not helpful. Have you tested registering a COM DLL when the UAC is turned on?


No, I have no idea. NSIS works fine on every OS from 95 all the way to Vista. DLL registration works fine as well on all of those, even with UAC. You're describing a problem that affects registration of your COM DLL files on Vista with UAC with any installer and even with regsvr32.exe which comes with the OS. If you provide more details, I might be able to help, but with the current level of details, I can only offer you seek help from COM development community as the question is about COM DLL files and Vista in general.


dll registration by non-admin users on Vista
Hi guys
First of all, the real problem is privilege issue.
Looks like, NSIS, only permits 'admin's to use RegDLL. Please correct me if i am wrong. When we are on XP, this does not cause much problem, because, there is no user elevation thing in XP. However, when you are on Vista, in the installer, you need to specify the "RequestExecutionLevel" as "admin".

IF your installer is intended to be used by admins, then you don't have much problem. But if you want it to be used by non-admin users as well, then you are in trouble. (like me)

I used to use InstallShield till now. Recently, i wanted to migrate to NSIS. Except this issue, i already migrated everything successfully. But this limitation makes me consider again. Because, we can not assume, administrators are staying around non-admin users, and help them enter admin passwords when the installer asks them the password to elevate to admin.!!! Hopefully, i am wrong, and there is already a solution for this in NSIS.
Looking forward to your comments
Thanks


You're wrong. NSIS doesn't care if you're an administrator or not when you use RegDLL.


Then, why RegDLL is failing for non admin users, and is working for admins ?


well, i can guess your reply. You may say that this is not NSIS issue, but it is OS privilege issue.

Let me clarify my real problem here, if you can give me an idea about how can it be solved in NSIS, i would highly appricate it.

We have our own custom voice recognition DLL, and we want it to be installed as a plugin into users' machines regardless of user's role. In other words, we want a totally current user installation, even if the user is an administrator. So that, multiple users can work on the same machine without interfering each other. Since the installation involves registering the DLL, this makes this task troublesome. I was hoping that i can register the dll into HKEY_CURRENT_USER, rather than HKEY_LOCAL_MACHINE.

However, REgdLL is always tries registering in HKLM eevn if the user is non admin. In that case, OS rejects the registration and installation fails.

We need a solution for this , it can be any kind of hack or trick or a workaround solution, but we just want it to be installable by all users.

Thanks for taking time and for your precious ideas. :)


Well, I assume you created this DLL, so just change DllRegisterServer to use HKCU\Software\Classes instead of HKCR, or if you want, you can create a DllRegisterServerNonAdmin export and use that (regdll allows you to specify the export used)

If you don't control the dll, it's more tricky, but still possible (I did this for my custom iTunes install) you must map HKCR to HKCU\Software\Classes by calling RegCreateKeyEx + RegOverridePredefKey (with the system plugin) before registering the dll

It is possible to install the typelib in the same way, can't remember exactly the steps required, but IIRC, you call some COM interface with the system plugin


Thanks Anders
Yes, we outsourced the DLL, but we have its source code
This sounds a good solution. I will try that.


Hi,
I have the same issue.

Would it be possible to provide the snippet using System plugin?

Thanks a lot


Perhaps I just stumbled upon the same thing?

http://forums.winamp.com/showthread....80#post2439880


Actually, whatever i did , did not work for standard users.
Finally, we came to understand that, on windows OS, especially on Vista, (and especially if UAC is ON), then it is almost impossible to do anything. Even if you can solve the the installer issue somehow, sure, you will bump into other problems.
So, finally, we decided to assume that our users have admin account. Currently we have hundreds of thousands of users, and looks like, our assumption is OK, no complaints about it.
If any one has a better idea, please let me know.


Hi all,
sorry that i dig out this Thread again, but i have a similar problem like WKaa.
I'm trying to register two DirectShow filters in the end of my installation using this Code:

ExecWait 'regsvr32.exe "PGRDirectShowSource.ax"'
ExecWait 'regsvr32.exe "PGRDirectShowDecoder.ax"'


but every times it fails with error:
LoadLibrary("PGRDirectShowSource.ax") failed - The specified module could not be found
If i run the installation a second time it works.
The same happens using RegDLL and InstallLib.
I have tried to solve this by using a batch file and call regsvr32 there ==> same error.
If i put a "Pause" Command at the beginning of the batch file and register both filters manually via Command Line it works without errors. Executing the batch file after the installation has finished works too.

I'm using Windows XP Professional SP2 running in VirtualBox.

Thanks for any help
CLST58.

Maybe try full paths?


The Problem is that the two filters (and all other dll's wich are needed to register the filters) are extracted/installed from another msi setup wich is called in my setup (not really nice i know...), for this reason i dont know where the dll exactly are. But the msi setup seems to make a setting wich tells regsvr32 where to find the filters and all other dll's. At least I can call "regsvr32.exe PGRDirectShowSource.ax" via command line after the msi setup and it searches automatically in the correct directory (i observed this using FileMon). However if NSIS calls regsvr32 at the same time.... or rather after i tried it manually... regsvr32 does not search in this directory.
Any idea how i can tell regsvr32 where to search ?... maybe via environment variables ?


You tell it by setting the working directory with SetOutPath. Also make sure you are running the correct regsvr32 (there are 64-bit and 32-bit versions but don't ask me if they are interchangeable for registering 32/64-bit assemblies; someone else may know).

Stu