Is it possible to run setup file from C# code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have this method in my c# vs.net 2003 code:
================= Start Code =================
private void isOutlook()
{
Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\microsoft\\windows\\currentversion\\app paths\\OUTLOOK.EXE");

string path = (string)key.GetValue("Path");
if( path != null)
System.Diagnostics.Process.Start("OUTLOOK.EXE");
else
MessageBox.Show("There is no Outlook in this computer!","System
Error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
================= End Code =================

I have com add-in to outlook 2003, code in c#.
I want to check if this add-in was installed in this computer.
if no --> I want to install the setup.exe of my com add-in from this method.
Is it possible to run setup file from C# code?
Thanking you in anticipation,
Yael.
 
private void isOutlook(){
Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\microsoft\\windows\\currentversion\\app paths\\OUTLOOK.EXE");
string path = (string)key.GetValue("Path"); if( path != null)// if have
outlook do the installing com add-in
//if this com add-in not yet installed

System.Diagnostics.Process.Start("C:\\MatarotToolbar\\MatarotToolbarSetup\\Debug\\Setup.Exe");
}

1) How to check before calling the installer if this add-in was installed in
this computer?

2) How to check the path of MatarotToolbarSetup\\Debug\\Setup.Exe???
 
Yael said:
private void isOutlook(){
Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\microsoft\\windows\\currentversion\\app
paths\\OUTLOOK.EXE");
string path = (string)key.GetValue("Path"); if( path != null)// if have
outlook do the installing com add-in
//if this com add-in not yet installed

System.Diagnostics.Process.Start("C:\\MatarotToolbar\\MatarotToolbarSetup\\Debug\\Setup.Exe");
}

1) How to check before calling the installer if this add-in was installed
in
this computer?

If it is a COM add-in, then there will certainly be entries in
HKEY_CLASSES_ROOT\Clsid that are specific to that addin.
 
before running the setup?
Could you set me how to code it please...I'm no't fully understand
Thank's
 
Yael said:
before running the setup?
Could you set me how to code it please...I'm no't fully understand
Thank's

First use the OLE typelib viewer to find out what the UUID of the library
is. Then check whether that key is present under
HKEY_CLASSES_ROOT\TypeLib\{UUID-goes-here} to see if it is installed on the
target system.
 
Thank's,
Could you set me example please?

Ben Voigt said:
First use the OLE typelib viewer to find out what the UUID of the library
is. Then check whether that key is present under
HKEY_CLASSES_ROOT\TypeLib\{UUID-goes-here} to see if it is installed on the
target system.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top