displaying pdf file after installation
I had windows application which check if adobe acrobat installed in pc or not if it installed pdf file will display from cd if it is not installed installer window appear to setup the acrobat and then the pdf file displayd I did my code will but I want when runing installer (process.start()) the pdf file didnot display and afte开发者_Go百科r finising setup the pdf file displdayed.
private void OK_Click_1(object sender, EventArgs e)
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
try
{
foreach (DriveInfo d in allDrives)
{
switch (d.DriveType)
{
case DriveType.CDRom:
Process myProcess = new Process();
myProcess.StartInfo.FileName = d.Name + "AdbeRdr90_en_US";
myProcess.Start();
AfterStube();
break;
}
}
}
catch (Exception ex)
{
MessageBox.Show("Pleas Eject All Virtual CD-ROMs");
}
}
private void AfterStube()
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
foreach (DriveInfo d in allDrives)
{
switch (d.DriveType)
{
case DriveType.CDRom:
Process myProcess = new Process();
myProcess.StartInfo.FileName = d.Name + "lamp.pdf";
myProcess.Start();
panel1.Hide();
panel2.Show();
break;
}
}
}
Hmm... it's hard to understand what you want, but maybe you want to wait until acrobat installation is finished? If so, try doing this:
myProcess.WaitForExit();
With this your application will wait for acrobat to be installed and then call AfterStube() to display pdf file.
精彩评论