Sign in to follow this  
Followers 0
iHonda

Search For A Program

9 posts in this topic

is there a way to have a script search to see if a specified program is installed on the computer??


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try to search through the registry-keys...

Dim $i
While 1
    $i=$i+1
    $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)
    If @error <> 0 then ExitLoop
    MsgBox(4096, "SubKey #" & $i & " under Uninstall: ", $var)
WEnd

You could replace MsgBox with

If $var='AddMySoftwareHere' Then 
$Found=1
ExitLoop
EndIf

....

If $Found=1 Then DoSomething
Edited by dabus

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

If the program saved registry values, check for those values.

If the program installs certain libraries in the windows folder, check for those files.

Otherwise, try using StringInString on the output of "tree C:".

$ourProcess = Run(@ComSpec & " /k tree C:", @WorkingDir, @SW_HIDE, 2)
$found = 0
$progfoldername = "Dev-Cpp"
while not @error
  If StringInStr(StdoutRead($ourProcess), $progfoldername) Then
     $found = 1
     ExitLoop
  EndIf
wend

;;;;;;; now, if program folder is found, $found == 1.

#)

Edited by nfwu

Share this post


Link to post
Share on other sites

ok thanks guys even tho im still a little lost i will figure it out. j/w wut would i do if i didnt know if the program writes stuf the the registry?? im trying to make a script for my grandpa (hes computer illiterate) that will check to see if a browser is installed then launch it if it is.


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

ok thanks guys even tho im still a little lost i will figure it out. j/w wut would i do if i didnt know if the program writes stuf the the registry?? im trying to make a script for my grandpa (hes computer illiterate) that will check to see if a browser is installed then launch it if it is.

do you meant like internet explorer or some other type of "browser" ?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

yea internet explorer, mozilla fire fox, and he has this other browser that got installed when i put aim on his computer called AOL Explorer is there a way to see if these programs are installed??

Edited by Zmaster

A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

yea internet explorer, mozilla fire fox, and he has this other browser that got installed when i put aim on his computer called AOL Explorer is there a way to see if these programs are installed??

if its windows xp sp2 you can use the "Set Program Access and Defaults" to use what ever internet browser you have then just create a shortcut to some URL you want him to go to first.

ie for my machine at home i want my missus to use Firefox and not Internet explorer so i changed the Default internet browser to Firefox and removed the links to internet explorer from the desktop, so now if she just types in a URL in the address bar it will auto open in Firefox.

dunno if this helps you or not.

Share this post


Link to post
Share on other sites

lol i completely forgot about that thanx.


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

lol i completely forgot about that thanx.

no worries - ive had days like that - must be the old age...(29 going on 59)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0