Page 1 of 1

Detecting installed software

Posted: Sun Apr 18, 2004 1:02 am
by Karbon
I need a very fast way to see if the user has another program installed.. It will be an EXE file but could possibly be anywhere on the system.. The program I need to detect is acrobat.exe (the full version of Acrobat).

Any tips on a fast way to detect it?

Thanks!

detect

Posted: Sun Apr 18, 2004 7:39 am
by StarHawk
One easy PG (Pretty Good) method is:

ExamineDirectory (C:\Program Files\Adobe\Acrobat*)

Using the * as the wild card after Acrobat because some folders will say Acrobat 4.0 or Acrobat 5.0, etc...

From PB Help:
Start to examine the specified directory for future listing with commands NextDirectoryEntry()and DirectoryEntryName(). If #PB_Any is used as '#Directory' parameter, the new directory identifier will be returned as 'Result'. The Pattern$ specify which files must be listed. #Directory is the numerical ID and can be used by UseDirectory() to change directory. For example: "*.*" or "" will list all the file in the directory. "*.exe" will list only .exe files. If the result is 0, the directory can't be examined.

If the Adobe\Acrobat* folder exists, there is a PG (pretty good) chance that adobe acrobat is on their computer.

You can also do variations of this method to see if specific files in the Adobe* folder exist, certain universal files (dlls or .exes) that are used in all versions of Adobe Acrobat, or only in the full version of Adobe Acrobat. (AcroRd32.exe = Adobe Acrobat Reader (free Reader only) versus acrobat.exe = Adobe Acrobat Full commercial version)

Re: Detecting installed software

Posted: Sun Apr 18, 2004 9:29 am
by Ralf
Why not check the registry (photoshop will get registered and you can see the complete installed program path.

HKEY_CLASSES_ROOT\Applications\Photoshp.exe\shell\open\command

if you find the path you only have to check if the exe still exist or not. hope this way may help you.

Posted: Sun Apr 18, 2004 12:59 pm
by dell_jockey
Mitch,

- check the registry whether HKEY_CLASSES_ROOT has an entry for the *.PDF file name extension. If there's no such file name extension registered, quit searching any further.
- then, check the HKEY_CLASSES_ROOT\AcroExch.Document\Protocol\StdFileEditing\Server entry. This entry contains the full path to the executable.
- then use that executables' path to verify that that file actually exists.

Posted: Mon Apr 19, 2004 1:37 pm
by Karbon
Nice! Thanks guys!

Posted: Mon Apr 19, 2004 7:11 pm
by MLK
another way:

Code: Select all

file.s="test.pdf"
file_dir.s="c:\"
exe_path.s=Space(256)

CreateFile(0,file_dir+file)

FindExecutable_(file,file_dir,@exe_path)

CloseFile(0)
DeleteFile(file_dir+file)

Debug exe_path