重写OnAfterInstall,来达到程序安装完成后,能够自动运行一次。
protected override void OnAfterInstall(IDictionary savedState)
{
try
{
base.OnAfterInstall(savedState);
Assembly asm = Assembly.GetExecutingAssembly();
System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Fujifilm\DriverInstaller\HaierOs.exe");
} catch(Exception ex)
{
Console.WriteLine("Start Application Error");
}
}
HaierOs.exe程序被触发了两次
只被运行一次