Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to install 3rd party dll and register with reg.bat file?
 

How to install 3rd party dll and register with reg.bat file?

I'm new to VS2005 and developing and am working my way through buliding a simple serial port program. I have a third party serial component which is a dll file that I reference in my program. I've got that part working and it receives/sends data correctly (yeay me). Now I would like to compile that program and be able to install it on another machine.

The third party component came with the dll and a reg.bat file that "registers" the dll. What I can't figure out how to do is have that happen when the program is installed. I'm working my way through adding a Setup and Deployment -> Setup project to my existing solution/project. I don't have it all done yet (shortcuts, icons, etc) but am making progress. However, one of the things I haven't been able to find (tutorials or examples) is how to include the SPort.dll, install it (?) to a given directory, then run the reg.bat file. I'd like to have to "check" if it (the SPort.dll file) is already registered on the system and if so skip installing/registering it. The program I'm writing talks with radios and will there can be more than one installed on a system (using different Comm Ports, of course).

I'm really hoping I don't have to buy InstallShield or something like that to do this. What I'm looking for is when the user installs my program it looks to see if it (SPort.dll) is already registered and if not, put it in a certain place and then runs the reg.bat.

This is what is inside the reg.bat (when opened with NotePad ++):
regsp.exe sport.dll /i:"My_Name_Here#000GJP-DKFCQC-B85THE-B4RWND-1KTDHA-T8K0N4-FF7898-8DCC74-46173A-277CB5-508792-F46793"

Thank you in advance for any and all help that you can give. I'm sure you can tell from what I've written I'm very new to this. Any examples/ideas - please please please speak (write) slowly and simply so I don't get lost. Again thank you ... any and all help is greatly appreciated.
OutOfTowner  Tuesday, August 18, 2009 11:18 AM
There doesn't seem any advantage in directly running that bat file. I've never heard of regsp.exe, which means you'll have to install it before you can use it. So:
1. Install regsp.exe.
2. Add a custom action that runs regsp.exe. In the arguments (the command line) you'll need:

[TARGETDIR]sport.dll /i etc etc

where [TARGETDIR] will resolve to the main application folder, assuming that's where you installed it.
Phil Wilson
PhilWilson  Tuesday, August 18, 2009 5:59 PM
There doesn't seem any advantage in directly running that bat file. I've never heard of regsp.exe, which means you'll have to install it before you can use it. So:
1. Install regsp.exe.
2. Add a custom action that runs regsp.exe. In the arguments (the command line) you'll need:

[TARGETDIR]sport.dll /i etc etc

where [TARGETDIR] will resolve to the main application folder, assuming that's where you installed it.
Phil Wilson
PhilWilson  Tuesday, August 18, 2009 5:59 PM

You can use google to search for other answers

Custom Search

More Threads

• unable to find dependency
• Changing the picture in the installer?
• Changing the look of ClickOnce install progress screen
• .Net Framework x64 prerequisite ClickOnce
• Prerequisites problem using Click Once
• Clickonce publishing and failure to create several *.dll.deploy files
• VB 2005 Express Project Deployment
• Publish C++ Project
• how to make a .exe file execute after installation of project using setup and depoyment project in c# ?
• ReportViewer