Trying to launch Trillian through C# program

  • Thread starter Thread starter jmsxp
  • Start date Start date
J

jmsxp

Hi all,

I am in my infancy with programming, so please forgive stupid
questions...

I am attempting to write a C# program that will launch Trillian (well,
that is just a part of the overall program). I can get the program to
start using
System.Diagnostics.Process.Start(@"C:\Program
Files\Trillian\trillian.exe");

But, if users do not have trillian installed in the default location, I
am stuck.

How can I extract the location of trillian.exe from the registry in the
C# program?

Thanks!
 
Hi jmsxp,
There is probably a better way to do it, but it looks like the install
path for Trillian is located in this registry key (and subkeys):

HKEY_LOCAL_MACHINE\SOFTWARE\Clients\IM\Trillian\

You can use a tool like REGMON from SysInternals.com to see what keys a
program reads on startup.

Hope that helps,
John
 
Thanks, John. That gets me closer.

now, how do I launch an application based upon this information in my
C# program?

Is there a way for me to tell the program to launch the application
that is pointed to in
"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\IM\Trillian\LocalizedString" value
name?

I know System.Diagnostics.Process.Start() wouldn't work, but is there
another way that is this simple?
 
Hi jmsxp,
You should just be able to read the registry value for the EXE's path
into a string (look at classes in Microsoft.Win32.Registry), then pass
that string to Process.Start().

Why do you say Process.Start() wouldn't work?

John
 
Hi John,

Sorry for the long delay in replying.

I did read the registry value for the EXE and started it with
Process.Start()
Here is what I did:

string appTrillian;
appTrillian = (string)Registry.GetValue
("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Trillian",
"DisplayIcon", "");

Process.Start(appTrillian);


Thanks to everyone for the help/suggestions. My C# programming
experience is now at 3 weeks!

Jeff
 
Back
Top