Archive: Registry update


Registry update
Hey guys. I'm having some big problems with the registry.
The program for which i'm doing an installer, had already been installed into a few of our clients computers. That version however is highly outdated, and the previous installer was...well...hard-coded to work. The thing is, right now, the .ocx and the .dll that it used and still uses have change where they are placed. And here comes my problem. Before just registering my .dll and my .ocx, I want to find if the .dll and the .ocx are already registered. If they are, I want to delete those entries, and write my new ones. If they aren't, then just register them. For example, right now, MSWINSCK.OCX had not been properly registered, because it was already registered in the computer where I was testing, but since it changed folder, the program wouldn't run properly.

Any help would be greatly appreciated. Thanks in advance.


If the registry settings are wrong anyway, just delete them and let the new registration process properly recreate them.


Yeah, but the thing is, these are clients computers.
I can't go to them and one by one delete all these entries.
I want to be able to search through the registry, find the key, delete it, and register the new one.

I'm working on a script to do with NSIS, so, I may have it solved, but I'm having some trouble with EnumRegValue and EnumRegKey. But i think i'll get this done soon


Why would you need to search the registry if you a well defined set of registered controls? If you know what you've registered the last time, you can easily find out what to remove.


Thats just it.
The previous version of the program wasn't done by me.
Not only that, but since there wasn't much of a formal installer, the program isn't uniform between all our clients, meaning that in different client's computers, the dlls and ocx's may be somewhere different.


But you can still tell which registry keys it updates. Running RegMon in the background, while executing the old installer, might be a good start.


I know which keys I want to update. What I don't know is where they are registered in the registry, and not even exactly sure where they are located in the computer.

Hm... If I did a script with NSIS that searches in the folders for those .dlls and .ocx, can i use UnRegDLL knowing their path?


Yes, you can UnregDLL them once you find them. But I'd recommend you find out using RegMon which registry keys they update first. One of those keys may even tell you where the DLL is located.