我試圖用「REBOOT = ReallySuppress」命令行參數在C#中卸載程序,但是Windows進程監視器(Rohitab提供的API監視器)顯示我的所需命令行參數實際上並未傳遞給msiexec.exe。我的代碼有缺陷嗎?.NET不會用命令行參數調用方法?
public static List<ManagementObject> programs;
public void Uninstall(int index)
{
object[] args = {"REBOOT=ReallySuppress", "REMOVE=ALL"};
programs[index].InvokeMethod("Uninstall", args);
}
...
程序列表在代碼中的其他位置初始化並且正常工作。 API監視器顯示msiexec.exe的進程開始下列參數:
"C:\Windows\SysWOW64\\msiexec.exe" /i "C:\Users\Joel Denning\AppData\LocalLow\Sun\Java\jre1.7.0_45.msi" /qn METHOD=joff
不具備REBOOT=ReallySuppress
或REMOVE=ALL
論點,我在通過
你能解釋,爲什麼您的代碼示例是定義和inititializing'args'?你說的問題是使用命令行參數,但它們沒有在你的代碼片段中使用... – evanmcdonnal