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.Diagnost ics.Process p = new System.Diagnost ics.Process();
p.StartInfo.Cre ateNoWindow = true;
p.StartInfo.Fil eName =
Path.GetFullPat h(System.Enviro nment.GetEnviro nmentVariable(" WINDIR") +
"/system32/msiexec.exe");//Environment.Get EnvironmentVari able("WINDIR")+
"/system32/msiexec.exe";
p.StartInfo.Arg uments = "/uninstall " + new
FileInfo(powerl earn.MSIPath).N ame + " /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
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.Diagnost ics.Process p = new System.Diagnost ics.Process();
p.StartInfo.Cre ateNoWindow = true;
p.StartInfo.Fil eName =
Path.GetFullPat h(System.Enviro nment.GetEnviro nmentVariable(" WINDIR") +
"/system32/msiexec.exe");//Environment.Get EnvironmentVari able("WINDIR")+
"/system32/msiexec.exe";
p.StartInfo.Arg uments = "/uninstall " + new
FileInfo(powerl earn.MSIPath).N ame + " /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
Comment