throw new ApplicationException(string.Format("Could not found {0}install script", Silent? "silent " : ""));\r
}\r
\r
- if (File.Exists(uninstallString)) {\r
+ if (UninstalledPackage.UninstallInfo.WindowsInstaller &&\r
+ Regex.Match(uninstallString.Substring("MsiExec.exe /I".Length),\r
+ @"^\{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}$").Success) {\r
+ string guid = uninstallString.Substring("MsiExec.exe /I".Length);\r
+ using (Process hProcess = NaGet.Utils.ProcessStartWithOutputCapture(\r
+ new ProcessStartInfo("msiexec", string.Format("/X{0}", guid)),\r
+ NaGet.Utils.ConvertToDataReceivedEventHandler(OutputDataReceived),\r
+ NaGet.Utils.ConvertToDataReceivedEventHandler(ErrorDataReceived)) ) {\r
+ \r
+ hProcess.WaitForExit();\r
+ \r
+ exitValue = hProcess.ExitCode;\r
+ }\r
+ } else if (File.Exists(uninstallString)) {\r
// 単独のファイルの場合\r
- using (Process hProcess = NaGet.Utils.ProcessStartWithOutputCapture(new ProcessStartInfo(uninstallString),\r
- NaGet.Utils.ConvertToDataReceivedEventHandler(OutputDataReceived),\r
- NaGet.Utils.ConvertToDataReceivedEventHandler(ErrorDataReceived)) ) {\r
+ using (Process hProcess = NaGet.Utils.ProcessStartWithOutputCapture(\r
+ new ProcessStartInfo(uninstallString),\r
+ NaGet.Utils.ConvertToDataReceivedEventHandler(OutputDataReceived),\r
+ NaGet.Utils.ConvertToDataReceivedEventHandler(ErrorDataReceived)) ) {\r
+ \r
hProcess.WaitForExit();\r
\r
exitValue = hProcess.ExitCode;\r