Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an AutoRun Exe that determines Installed Components 1

Status
Not open for further replies.

Centerfuge

Programmer
Mar 3, 2003
17
US
Hello All, I'm in the process of putting one of my company's applications (originally written in VB6 back in the day) fully onto CD.

Obviously (or not so obviously) I need (or atleast would like) to ensure that certain objects (dll's etc.) are on the running machine prior to launching the application. To this end another developer and I thought of doing an invisible auto-run application which, when launched, will check to see if these components are on the target system and that they are registered (if necessary), if it finds that they are registered, it will in turn launch the application on the CD, if it finds that they aren't, it will run an installer that installs the requisite dll's and ocx's then it will launch the CD App.

The logic seems simple enough, but my C++ is quite rusty and was wondering if any of you had suggestions on how to do this? We had discussed using C#, but there is the obvious drawback of requiring the .Net runtime which I really want to avoid.

I'm not asking you to write my code for me, but if you could point me to the objects I need to use that would be a tremendous help. I'm thinking I will need to be able to Shell out to the command line, and I might need to access the system registry (are there any objects or API's I can use to do so?) to determine if the file is registered and where to locate it.

Thanks
 
an autorun program you can register under this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

but all registered components are registered under this key:
HKEY_CLASSES_ROOT\CLSID
See inside each GUID is some information about each component. Under HKEY_CLASSES_ROOT you can find more human readable program ID's of components. Each component under this key has the subkey CLSID wich indicates to some GUID under HKEY_CLASSES_ROOT\CLSID.

Ion Filipski
1c.bmp
 
Wouldn't InstallShield take care of looking for old or missing DLLs for you? I haven't used it, but I'm guessing that's something it does.
 
I only want to run Installshield if the components to the application aren't already installed.

my decision structure is like this:

if (components installed)
run app;
else
run installer;
run app;

Running the installer every time would make the process too slow. I've been researching the registry reading all day and found a handy vb app that I can emulate in C++, but I didn't know the proper location to check for the registered components, thanks Ion Filipski!

I'm still going to have to use C++ I think to handle this so its time now to dust off Visual Studio 6.0 and figure out how to do this.

I've found information on the registry class that is incorporated in winreg.h, do you happen to have any better suggestions or recommendations? What kind of object or include should I look at to 'shell out' to run these applications?

Thanks again for the help.
 
cpjust: responce is no
Centerfuge: I'm not sure I understand you as you with, but #include<windows.h> and use RegOpenKey/RegOpenKeyEx/RegQueryValue/RegCloseKey functions.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top