Detecting installed software

Everything else that doesn't fall into one of the other PB categories.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Detecting installed software

Post 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!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
StarHawk
User
User
Posts: 55
Joined: Sun Nov 02, 2003 7:27 am

detect

Post 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)
Ralf
Enthusiast
Enthusiast
Posts: 203
Joined: Fri May 30, 2003 1:29 pm
Location: Germany

Re: Detecting installed software

Post 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.
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post 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.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Nice! Thanks guys!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
MLK
User
User
Posts: 57
Joined: Sat Jan 24, 2004 8:46 pm
Location: Germany

Post 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
Post Reply