Qbasicnews.com

Full Version: Installing programs and the Windows Registry
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
In Windows, most programs, like WinZip, McAfee VirusScan, Mirosoft Project, etc., get installed using the facilities of the Control Panel Add/Remove Programs which will also display a list of all the programs that were installed using this facility. My understanding is that this method of installing programs uses something called the Windows Registry.

However, some programs do not use Add/Remove Programs and simply install programs in some other chosen folder, and of course do not appear on the Add/Remove Programs list later.

Why I'm concerned: My company is taking an inventory of software installed on its 350 PCs using the list produced by the Add/Remove Programs facility. I just discovered that not all installed software will appear on this list. We are 70% into the inventory. Now what?

QUESTIONS:
* Please explain how the Registry works.
* The installed programs list produced by Add/Remove Programs is a graphical file, a picture. Do I need to buy special software to get the names/descriptions of the programs installed in the Registry onto an ASCII file? Or, could I write a QB program to do this?
* Is there anyway of knowing in advance whether a purchased software is going to install in the Registry or whether it will install somewhere else?

Any other suggestions will be greatly appreciated.
*****
moneo i had asked you this question before too, do you need to interpret everything from a screenshot? IMO a program that actually reads windows registry to get the list of installed softwares is much much easier and more accurate. I havent searched for such a program yet but even if it doesnt exist it wont be so difficult to whip one up =).

You know what a better program would be? One that actually reads the contents of your start menu. Any windows program that you install on your system *has* to place an option on the start menu unless the user removes it somehow =P. This will be the easiest program to do =D. On Win9x systems the start menu is just a directory structure under:

C:/Windows/Start Menu/Programs/

Just read all the entries and you will have the names of all the softwares installed =D. I dont know what the folder is in NT based systems...
BBQ,
The Field Services Dept. is currently using screenshots of the Add/Remove Programs screen to take an inventory of the installed programs. This is not 100% accurate because I just learned that some programs are not installed that way.

Your suggestion is very interesting, but it requires a program with some smarts. Example: The PROGRAMS directory, which on some Windows versions is actually PROGRAM FILES, contains subdirectories with the names of the installed product names. However, these subdirectories themselves contain subdirectories for versions of the installed product. Example: if you have both Adobe 5.0 and Adobe 6.0 installed, the Adobe subdirectory has subdirectories for the 5.0 and 6.0. Therefore, the program traversing these subdirectories has to be pretty smart in determining how deep in the subdirectory structure it has to go to properly identify installed programs.

However, this is the best idea I have seen yet. I'm going to take a crack at writing such a QB program. Then I'll put the program up on a server, tell Field Services to run it when doing an inventory. The program will leave a list of installed programs per inventories PC on a uniquely identified file on the server, and that's it.

Thanks a lot BBQ!

P.S.: I did some more testing. The stuff in the PROGRAMS directory is not 100% reliable. Example: I mentioned about having Adobe 5.0 and Adobe 6.0. Well it turns out that someone deleted some of the files under the Adobe 5.0 subdirectory, including the .exe executable. Here again, the inventory program has to be smart.

Also, viewing the PROGRAMS\ADOBE directory, the Adobe 6.0 executable shows up as just Adobe Acrobat 6.0. However, on the Add/Remove Programs list it shows up as Adobe Acrobat 6.0 Professional. Hummm, is there a 6.0 product on the market as well as a 6.0 Professional? These are the things that will drive the inventory program crazy!
*****
There is no 100% bulletproof method to automatically find all the software installed in Windows. "Well-behaved" Windows programs will add an entry in the Add/Remove Programs section of the Control Panel, but there are some that don't do this. There are also programs that have default install directories that are not in C:\Program Files, and there are some programs that don't put shortcuts in the Start Menu or on the desktop. Even if the programs do put shortcuts in the Start Menu or on the desktop, the user can easily change or delete them, so it's not a very reliable method.

What I would do is first check the registry to find the programs with entries in the Add/Remove Programs section. (HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall). Most keys should have a string value called "DisplayName" that gives you the name of the application. You can easily read the registry with a simple VB program.

If you want to check the start menu, desktop, and program files, keep in mind that the locations of these vary depending on your Windows version, and whether or not multiple user profiles are enabled. (In Windows XP, when someone installs a program, it can place a shortcut in the start menu under the "All Users" profile, or it can place it only under a single user's profile. The same applies for shortcuts on the desktop.)
Thanks, Plasma, I knew it was too good to be true.

The pitfalls that you mention make this task not worth doing. If you think you can get 100% and fall a little short, that's not so bad. But if from the start you know that you are not going to achieve 100%, then I feel you're kidding yourself.

What about all these software packages that you see on the Internet regarding Software Asset Management and the like, do you think that they have solved all the pitfalls that you mention? Or are they just another Pareto (80/20) solution?

Over the past year and a half, my company bought 2 of these grandious server-based solutions. Neither of them worked, forget about 100%. Now the company is gun-shy and wants no software package solution. So we're doing it manually (using screenshots of the Add/Remove Programs screen), which is really worse.

As Administrator of Software Management I'm responsible for this, and I really hate doing a crappy job, no matter what excuses I can give. Sorry, I'm feeling sorry for myself.
*****
I have a few games that I distribute which, for obvious reasons (if you knew what they were), do not show up in the list...primarily to prevent such scrying eyes from figuring out that my games have been installed. Big Grin

The only "real" way of doing what you're looking to do is to have a program which contains a massive database of known programs, but even that's reliant on the developer's access to programs.
I have no experience with any sort of "Software Asset Management" packages, so I can't tell you how well they work...but it looks like you've already tried this and it didn't work too well.

Sounds like you're in a tight situation because you have to do this, but you want to do the best you can. If I were you, I would do the registry check first, then check the start menu and then the program files folder. The start menu and program files are going to be a pain in the ass to check, and you won't get everything...but that's the best you can do.

Also, if you know some of the programs that will be installed, you could add a special-case check for them. Other than a massive database like Nek suggested, there's nothing else you can do. Sad
Moneo doesnt your company have some kind of 'protocol' or regulations while installing programs? All the programs have an option which allows you to choose the install location. If everybody installed all the programs in C:/programfiles/ then it would become a heck lot easier.

Plasma: Since its a company that we are talking about, I dont think they will be using any program that doesnt put its shortcut in the start menu, desktop or anywhere else.
BBQ: Since it's humans working at a company we're talking about, you never know what the heck they will do.
yes i agree, but they must have administrators to install/remove software. In that case I hope they havent mucked up the installs.
Pages: 1 2 3