469,917 Members | 1,834 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

not able to run the Process

Hi guys,
it's me again. today i'm trying the "Process" class.
I'm trying to uninstall one product developed by my company thorugh
..net code but it seems not working but when i execute the commandline
MSI uninstall command it seems working fine. the code i'm using is:

System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName =
Path.GetFullPath(System.Environment.GetEnvironment Variable("WINDIR") +
"/system32/msiexec.exe");//Environment.GetEnvironmentVariable("WINDIR")+
"/system32/msiexec.exe";
p.StartInfo.Arguments = "/uninstall " + new
FileInfo(powerlearn.MSIPath).Name + " /qn";
p.Start();
p.WaitForExit();
whenever i execute the code, it does nothing. i mean i tried to debug
this code but when i came to "p.WaitForExit();" and i pressed the F10
it moved to another line without waiting process to be completed. seems
that process is somehow not able to run.

can anyone help me out from this problem? any other solution is also
welcome.

Tools:
c#.net 2.0 (VS.NET 2005)
Thanks,
Lucky

Aug 24 '06 #1
2 1167
I forgot to add some information.

when i start the process it exits in a second and returns ExitCode :
1619

i hope it would help more.

thanks again,
Lucky

Aug 24 '06 #2
Hi guys,

it's again me. i found the solution of my problem.
there are to ways to do it.

1) in the Arguments pass the fullname of the FileInfo object rather
then only file name
2) keep the code as it is and change the directory to file directory
where the file is, before this code.

it is all about telling msi the full path of the s/w msi file. it
doesnt matter wihch way u do it. you only needs to tell it where is
that file.

by the way. thanks for reading.

Lucky

Aug 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ajay | last post: by
1 post views Thread by Ajay | last post: by
3 posts views Thread by Lucky | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.