2
IE 용 플러그인 설치 프로그램을 만들려고합니다. 설치를 계속하기 전에 IE 프로세스가 종료되어야합니다. 하지만 IE 프로세스에서 kill()
메서드를 실행했을 때 "액세스 거부"오류가 발생했습니다.IE가 실행 중인지 확인한 후 닫습니다.
어떤 점이 최선의 방법일까요?
내 설치 코드 :
protected override void OnBeforeInstall(System.Collections.IDictionary savedState)
{
if (LaunchOnBeforeInstall())
{
foreach (var process in Process.GetProcesses())
{
if (!process.ProcessName.StartsWith("iexplore"))
{
process.Kill();
}
}
base.OnBeforeInstall(savedState);
}
else
{
throw new Exception("You cancelled the installation.");
}
}
public bool LaunchOnBeforeInstall()
{
var result = MessageBox.Show("All instance of IE will be close", "Warning", MessageBoxButtons.OKCancel,
MessageBoxIcon.Question);
return result != DialogResult.Cancel;
}
을 제외하고 모두를 죽이려고? IE의 새로운 버전이 쓰레드 탭을 사용하고 각 탭이 프로세스로 나타나기 때문에 모든 인스턴스를 죽여야한다는 점에 유의할 가치가 있습니다. – kyndigs