| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Jul 17, 2007 6:26 pm Post subject: Instant Chat Location |
|
|
Hi Guys
i need a way to detect if te following instant chat programs are installed and if so, i need to store their location exe, so i can call it later. I only need the following programs;
MSN Messenger
Skype
AOL AIM
Yahoo Instant Chat
I don't want to use a file search, as this may take to long, is there anything in the registry that will point their location ?, Only need it for windows XP
Nathan |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Tue Jul 17, 2007 7:33 pm Post subject: |
|
|
I believe you can find Yahoo and MSN Messengers here:
| Code: |
HKLM\Software\Yahoo\Pager
and
HKCU\Software\Microsoft\MSNMessenger
|
Oops, I overlooked the part wanting their installed location.. these will just show if they are installed. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Jul 17, 2007 10:19 pm Post subject: |
|
|
Try this to look for the EXE file. Codescript made it and it is very fast!
| Code: |
#DEFINE FUNCTION,FINDFIRSTFILE
TITLE Single File Search - CodeScript
DIALOG CREATE,Single File Search - CodeScript,-1,0,405,196
DIALOG ADD,BUTTON,Search,141,139,109,37,Search,,DEFAULT
DIALOG ADD,EDIT,EDIT1,34,22,331,19,Readme.txt
DIALOG ADD,TEXT,TEXT1,16,23,,,File Name to Search
DIALOG ADD,EDIT,EDIT2,77,25,330,19
DIALOG ADD,TEXT,TEXT2,60,25,95,13,Root Directory
DIALOG ADD,BUTTON,BROWSE,78,361,21,19,..
DIALOG ADD,EDIT,EDIT3,111,24,321,19
DIALOG ADD,BUTTON,SHOW,111,347,56,19,Show !
DIALOG SHOW
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:BROWSEBUTTON
%A = @dirdlg(Select a Root Directory,,)
if @not(@null(%A))
DIALOG SET,EDIT2,%A
END
GOTO EVLOOP
:SearchBUTTON
%A = @FINDFIRSTFILE(@DLGTEXT(EDIT2),@DLGTEXT(EDIT1))
REM SYNTAX %A = @FINDFIRSTFILE(<Root Path>,<File Name>)
DIALOG SET,EDIT3,%A
GOTO EVLOOP
:SHOWBUTTON
IF @EQUAL(@SUBSTR(@DLGTEXT(EDIT3),2,2),:)
SHELL open,Explorer,/n","/select","@DLGTEXT(EDIT3)"
END
GOTO EVLOOP
:CLOSE
EXIT
REM You can include the code below in a
REM Include file or DSU.
REM You can find a file ina given directory in VDS
REM but it is difficult to search a tree for a file
REM This API is real blazing fast. Enjoy !
REM If you want to find more than one file of same
REM name then you need a different API with elaborate
REM procedure inluding callbacks.
:FINDFIRSTFILE
IF @NULL(%1)
%O = No Root path was specified
EXIT %O
END
IF @NULL(%2)
%O = No File name was pecified
EXIT %O
END
LOADLIB imagehlp
%O = @FILL(260)
%A = @LIB(imagehlp,SearchTreeForFile,INT:,STR:%1,STR:%2,@ADDR("%O"))
FREELIB imagehlp
%O = @ADJUST(%O)
IF @ZERO(%A)
%O = File Not Found
END
EXIT %O
|
_________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Jul 18, 2007 8:50 am Post subject: |
|
|
And if you want to detect if these programs are running and where from, use something like this:
| Code: | list create,1
list modules,1,msnmsgr.exe
if @greater(@count(1),0)
info MSN Messenger is running from:@cr()@item(1,0)
else
info MSN Messenger isn't running
end
list close,1 |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Jul 18, 2007 9:36 am Post subject: |
|
|
Hi skit
thats great, but
what if it is not running ?
I want to be able to have a list of the four instant chat programs , and if they are not running then in want to be able to start them.
Nathan |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 18, 2007 2:57 pm Post subject: |
|
|
Nathan,
On my Windows XP PC the following Registry keys were found.
| Code: |
%%MSNMessenger =
HKLM\SOFTWARE\Microsoft\MSNMessenger\InstallationDirectory
%%Yahoo = HKLM\SOFTWARE\Yahoo\Essentials\MainDir
%%Skype = HKLM\SOFTWARE\Skype\Phone\SkypePath
%%AIM6 = HKLM\SOFTWARE\AOL\AIM\6\Island
|
With the exception of the Skype the others you will need to look in their install directories for the actual Exe's (AIM6.exe, msnmsgr.exe, and YahooMessenger.exe). If the user changed the name of the Exe then you will need to get a list of Exe's in the install directory and pull their Version info. Specifically the InternalName and/or Product Name values should tell you if the Exe is the main Exe for the program.
Honestly I don't know of any special API or trick to finding this information. You could use WMI and search the Add/Remove info but because the Add/Remove information is not always reliable it is best to just use the registry information. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Jul 18, 2007 4:05 pm Post subject: |
|
|
I don't have 'HKLM\SOFTWARE\Yahoo\Essentials\MainDir' here.
Looks like the Yahoo toolbar? _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Fri Jul 20, 2007 9:31 am Post subject: |
|
|
Ok, think i worked out a function to do it:
| Code: |
:get_aim_stat
list create,%1
list tasklist,%1,N
%%skype = @regread(HCR,callto\shell\open\command,)
%%skype_loc = @string(GetBefore,@string(Del,%%skype,@chr(34),),/,,)
%%skype_ver = @VERINFO(%%skype_loc,V)
list seek,%1,0
%%skype_run = @match(%1,skype.exe)
if @null(%%skype_loc)
%%skype_installed = 0
else
%%skype_installed = 1
end
%%aol = @regread(HLM,Software\Classes\aim\shell\open\command,)
%%aol_loc = @string(GetBefore,@string(Del,%%aol,@chr(34),),/,,)
%%aol_ver = @VERINFO(%%aol_loc,V)
list seek,%1,0
%%aol_run = @match(%1,aim6.exe)
if @null(%%aol_loc)
%%aol_installed = 0
else
%%aol_installed = 1
end
%%msn = @regread(HLM,Software\Microsoft\Windows\CurrentVersion\App Paths\MSNMSGR.EXE,)
%%msn_loc = @string(GetBefore,@string(Del,%%msn,@chr(34),),/,,)
%%msn_ver = @VERINFO(%%msn_loc,V)
list seek,%1,0
%%msn_run = @match(%1,msnmsgr.exe)
if @null(%%msn_loc)
%%msn_installed = 0
else
%%msn_installed = 1
end
%%yahoo = @regread(HCR,ymsgr\shell\open\command,)
%%yahoo_loc = @string(GetBefore,@string(Del,%%yahoo,@chr(34),),@chr(37),,)
%%yahoo_ver = @VERINFO(%%yahoo_loc,V)
list seek,%1,0
%%yahoo_run = @match(%1,yahoomessenger.exe)
if @null(%%yahoo_loc)
%%yahoo_installed = 0
else
%%yahoo_installed = 1
end
list clear,%1
list add,%1,%%skype_installed|%%skype_loc|%%skype_ver|%%skype_run
list add,%1,%%aol_installed|%%aol_loc|%%aol_ver|%%aol_run
list add,%1,%%msn_installed|%%msn_loc|%%msn_ver|%%msn_run
list add,%1,%%yahoo_installed|%%yahoo_loc|%%yahoo_ver|%%yahoo_run
%%out = @text(%1)
exit %%out |
Should return a list of the following:
installed|location|version|active
eg.
1|c:\skype\skype.exe|3.4.5.6|1
You need to suppy %1 = the number of a list that can be used.
I' was lazy and used Dr. Dreads String.dll to extract the program location from the returned registry
* Works on Most recent versions of AIM's, would need further development to check locations for older versions. And this is based in Windows XP Pro
I Know, but, my program is designed for Windows XP only.
regards
Nathan |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|