I am trying to pull data from DBF files into my program using C#. I am using the Visual FoxPro OLE DB Provider. It works fine on my local machine but I want to package up my program into dll that clients can use. The problem is when they run the program from their machine it says that the Visual FoxPro OLE DB Provider isn't registered on their machine. Is there any way to use this without having the client install the Visual FoxPro OLE DB Provider on their machine?
2 Answers
The short answer is no...the long answer is:
I don't believe you can do that without installing the Visual FoxPro OLE DB Provider on each target machine. Even if you tried to use COM interop you would still have to install and register the original dll - vfpoledb.dll
By far the easiest way to solve this issue is is to get the FoxPro OleDb Driver install package from Microsoft and distribute it to your users.
If you are want to roll your own .MSI package for your library installation you can manually install and register the missing dll.
To manually register a .DLL using regsvr32.exe in a .MSI package:
First open your WSI project and go to the MSI Script.
Add an 'Execute Program from Destination' custom action after InstallFinalize in the Execute Immediate tab.
When the 'Execute Program From Destination' dialog appears enter:
Custom Action Name: <registerdll>
Working Directory: SystemFolder
EXE and Command Line: Enter the full path to regsvr32.exe
and the full path to .DLL.
(usually ..\Program Files\Common Files\System\Ole DB\vfpoledb.dll)
If you add the /s switch to the command line like [SystemFolder]regsvr32.exe /s the registration of the dll should happen without user intervention.
I ran into a similar problem when I as developing on my 64-bit Vista machine. I found out that in order to use the Microsoft Jet OleDB or FoxPro OleDB provider I had to set the properties of my .Net project to specifically target 32-bit processors since there is no 64-bit version of these providers.
Anyway, not sure if this is part of the problem with the target machines using your libary but thought I would offer it up.
Brian