Forum Discussion

zakyn's avatar
zakyn
Occasional Contributor
14 years ago

How wait till process does not exist and do something without error

Hello,



I have an installer in silent mode and I would like to wait until application is installed, then check the application exe file and run.



This is a snippet of the code:



stillInstalling = true;

while(stillInstalling)

  {

    if(!Sys.Process("AppInstaller_*").Exists)

    {

      stillInstalling = false;

    }

    else

      aqUtils.Delay(3000);

  }



The problem is when the installation is finished then the TC is waiting for the Sys.Process and then TC stops the script because process is not there. But I would like to go to the next command, like run installed application and so on.



Is there any better concept to do that?



Thanks



zakyn

2 Replies

  •     currentprocess = Sys.WaitProcess("AppInstaller_",3000);

        while(currentprocess && (currentprocess != null) && currentprocess.Exists)

        {

          Delay(3000);

          currentprocess = Sys.WaitProcess("AppInstaller_",3000);

        }