Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 1st, 2004, 04:36 PM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Prothall
Default process.waitfor() problems

I am writing a small C# menu program to facilitate installing several applications the image team forgot to add.

For the most part all the installations work fine using the Process Class. Two however did not function properly. They didn't seem to wait. I resolved this by determining that the installs started out with a self extrating routine. When this was completed my program continued even though the install was not complete. I used InstallMonitor to locate the extraction folder and copied the install files to my CD. Now these process do not run unless I comment out the process.waitfor() command. If this command is left in the whole thing (my app & install) hang. If I terminate my application the install starts. If I don't use waitfor() both installations work fine. The application installs are for SameTime and the Citrix Client Version 7.10.

Any suggestions on what would make the setup for these hang when using waitfor()

Code Snippet:
if (chkICAClient.Checked)
{
  // Install ICA Client 7.10
  System.Diagnostics.Process ICAClient = new System.Diagnostics.Process();
  ICAClient.EnableRaisingEvents=false;
  ICAClient.StartInfo.FileName= cmbDrive.SelectedItem.ToString() +"ICA Client 7.10\\Disk1\\"+"setup.exe";

  sStatusLog = "ICA Client 7.10 Install Started";
  UpdateLog();
  try
  {
    ICAClient.Start();
    ICAClient.WaitForExit();
    if (sSuccess == "")
    {
      sSuccess = "ICA Client 7.10";
    }
    else
    {
      sSuccess = sSuccess + ", "+"ICA Client 7.10";
    }
    sStatusLog = "ICA Client 7.10 Install Completed";
    UpdateLog();

   }
   catch (Exception)
   {
        MessageBox.Show("ICA Client 7.10 installation error.", "Install Status",
    MessageBoxButtons.OK, MessageBoxIcon.Error);
    bOops = true;

    if (sFailure == "")
    {
       sFailure = "ICA Client 7.10";
    }
    else
    {
       sFailure = sFailure + ", "+"ICA Client 7.10";
    }
    sStatusLog = "ICA Client 7.10 Install Failed";
    UpdateLog();
    return;

    }

   }

Mike
 
Old July 1st, 2004, 03:49 PM
Authorized User
 
Join Date: Jul 2004
Posts: 69
Thanks: 0
Thanked 1 Time in 1 Post
Default

ICAClient.EnableRaisingEvents=false;

if there are no events what is the system waiting for? How will the object ever know when it has exited?

www.CoderForRent.com
Get A Computer Job!





Similar Threads
Thread Thread Starter Forum Replies Last Post
process.startinfo opens new instance of process Anypond General .NET 0 August 28th, 2008 05:35 AM
Where's WaitFor? benatkin Classic ASP Components 9 March 25th, 2008 02:48 PM
Process list jrainha XSLT 3 March 13th, 2008 02:24 PM
Where is Waitfor? navdeeps Classic ASP Components 2 March 10th, 2008 01:22 PM
Hanging process Gert SQL Server 2000 0 April 4th, 2005 04:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.