Solved

A new version of a dll registered with Regsvr32 works but on restart it reverts to the previous version. Why?

Posted on 2008-06-18
15
824 Views
Last Modified: 2010-04-21
I have developed a dll (WBSTransaction.dll) that is called from within a vbs script. This has been in use for several years saving data into a Sage Retrieve 4GL database. It has been necessary to rewrite WBSTransaction.dll as the data is now stored in an Access database. This has been tested thoroughly before installing the revised dll on site.
On start up each PC runs a script that automatically loads the latest version of all dll's used by the application and then runs Regsvr32 for each dll. This has always worked for the majority of users but now there are 2 PC's that revert back to an earlier version.
If I check that the latest version is loaded, the answer is yes.
If I run Regsvr32 on that dll, the program makes use of the correct version.
BUT if the PC is shut down and restarted the program makes use of the previous version.
I have run a search for WBSTransaction.dll on all local drives and there is only the one correct version and this is correctly located in the program folder.
This only occurs on these 2 PCs.
Can anyone suggest what I try next?
0
Comment
Question by:ChrisJKay
  • 8
  • 4
  • 3
15 Comments
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 21815825
Was this installed using Windows Installer, i.e. an MSI file?  

If so, Windows is "fixing" it for you and you need to uninstall the version there & re-install a version that has your latest DLL's.
0
 

Author Comment

by:ChrisJKay
ID: 21816632
I installed the application using the VB6 Setup Tool Kit which I think is different from Windows Installer. However I thought the problem could be connected with this and had already prepared a new set up package which I shall take to site tomorrow and report back later.
Chris
0
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 21816714
Sounds good.

I would completely uninstall the old before installing the new.

>>VB6 Setup Tool Kit which I think is different from Windows Installer.
I'm really not sure on that.
0
 

Author Comment

by:ChrisJKay
ID: 21844161
I had a long on site session when I uninstalled then re installed. I also ran Regsvr32 using the /u parameter prior to re registering it. Unfortunately the problem was still there. As a work around I changed the script to run Regsvr32 on the dll prior to calling it and this has solved the problem. But what I don't understand is where the old version is stored. A search on all local drives shows only the single copy of the latest dll in its correct folder. Does W2K store frequently used dll's in a hidden area? If so can I get to it to remove the old version
0
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 21844395
The only hidden location I'm aware of for such things is the old install set.  It does store that MSI file in its own location.

If you can't get something out of the Add/Remove programs area, you can edit the registry area HKLM/Software/Microsoft/Windows/Uninstall and find the folder for the application.  See http://www.theeldergeek.com/manually_uninstall_programs.htm for more information on that.  Within the folder, you can find an InstallSource entry which tells where the MSI file is cached. That would enable you to remove the MSI file from your system.  Removing that app's folder from the registry will remove it from the Add/Remove Programs applet.

As always, standard precautions about editing the registry apply.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 21869007
If you still want to resolve this, please explain the following little mystery.

In the original question you said that you searched throughout the local drive of the affected PC, and found only one version, the latest.

Question: how then you know that "the program makes use of the previous version" if the previous version does not exist on the machine?
0
 

Author Comment

by:ChrisJKay
ID: 21872828
DanielWilson

Sorry for delay but I haven't had a chance to return to the site. I have down loaded the Elder Geek's article and will do some tests early next week.


vadimrapp1

I know that the only copy of WBSTransaction.dll that Search lists is the latest version, because I gave it a different version number when I compiled it. This copy is held in Program Files/CCIS
Just to make things visible in the latest version only I displayed the version number as a small label on the opening window of the program.
Reboot the PC and the version without the version number label  runs.
Use Regsvr32 to register the copy in Program Files/CCIS and the version WITH the label runs.
Reboot the PC and we are back to the version WITHOUT the label.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 21873848
Here are some detective suggestions.

1. After the reboot, when it's again old version working, look in the registry; under HKEY_CLASSES_ROOT, found a class that you know is exported by your dll, go to its CLSID, and see what is in Inprocserver32. Maybe it's a file on the network.

Alternatively, just search for WBSTransaction.dll across the registry and note the locations it finds. Regsvr32 new version and find which one(s) have changed.

2. once you have found the registry key that changes during the reboot, we need to find out the program that is doing that. Right-click the key, open Permissions, Advanced, and enable Audit - add Everyone, and enable all checkboxes. Close regedit, open local security policy from administrative tools, and enable audit. Reboot, then look in the event log and see who changed the registry value. Don't forget to disable audit after the hunt is finished.

3. Also, clear application event log; then reboot the machine so older version shows up; then look in the event log and see if there are any messages from Installer. Alternatively, disable Windows Installer service, reboot, and see if the effect disappears. The purpose of this is to find out if this is caused by Installer repairing the product.

0
 

Author Comment

by:ChrisJKay
ID: 21915451
At last I have had some time on site. I searched the whole of the Registry for WBSTransaction.dll and all references were to the correct version in Program Files/CCIS.
I then followed the advice to find a class exported by the dll, InvoiceType, and in CLSID found on boot up  the following entry for Data B5B23157-ABEF-46CE-85FF-1DCDA7804F1F. Then after running Regsvr32 the entry changed to 7700CCD7-4FFC-462B-9C8C-B31092EEA9FB.
Am i right in thinking these are memory addresses?
Next I tried to follow the instructions ......
2. once you have found the registry key that changes during the reboot, we need to find out the program that is doing that. Right-click the key, open Permissions, Advanced, and enable Audit - add Everyone, and enable all checkboxes. Close regedit, open local security policy from administrative tools, and enable audit. Reboot, then look in the event log and see who changed the registry value. Don't forget to disable audit after the hunt is finished.
Despite logging on as administrator I couldn't find any reference to Permissions. The operating system is Windows2000 Professional.
Finally I tried disabling Windows Installer and rebooting but it still reverted to the incorrect old version.
I would welcome any further suggestions.
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 21915658
B5B23157-ABEF-46CE-85FF-1DCDA7804F1F - where did that point to? find its clsid and see what is in Inprocserver32.

We need to find the process that changes 7700CCD7-4FFC-462B-9C8C-B31092EEA9FB to B5B23157-ABEF-46CE-85FF-1DCDA7804F1F.

You can do it by enabling audit as I posted before, also by looking into everything that runs during startup. Boot in safe mode, for instance; also look in msconfig under startup. Also check if group policy runs scripts at logon. Also, when machine is booted, but before the user logs on, access the machine registry remotely and see if the clsid has already changed or not - then we will at least know if it's changed during user logon or during machine initialization.
0
 

Author Comment

by:ChrisJKay
ID: 21915716
OK I will follow this up, but it will probably be next week.
Thanks
Chris
0
 

Author Comment

by:ChrisJKay
ID: 22087228
Still haven't been able to visit site. will reply asap
Chris
0
 

Author Comment

by:ChrisJKay
ID: 22449493
I finally got on site and traced the B5B23157-..... clsid and under Inprocserver32 found a reference to a test version of WBSTransaction.dll called TransTest.dll. This contained Class Modules with the same names in each of the dll's and was being re registered whenever the PC was started. Remove the test dll and it is no longer re registered!

Many thanks to vadimrapp1 whose solution I have accepted.
0
 

Author Closing Comment

by:ChrisJKay
ID: 31468488
Just shows you should be carefully to clean out all test data.
Chris
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22449869
You patched the consequence, but not the problem. I would find the place where it was re-registering on computer startup, and eliminate it. As I understand, it's still doing that, only now it fails.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now