wait.bat

Topics: Updater Application Block
May 18, 2005 at 7:07 AM
originally posted by: spideros

When the uploader finish uploading the files from the server it starts a wait.bat, it seems this executes some cleanup, but it's kinda confusing for the user, specially because if we close that ms-dos screen(wait.bat), before we close the application itself the update is not completed.

Is there a way not to show that ms-dos (wait.bat) screen ?

Thanx
May 27, 2005 at 1:46 PM
originally posted by: WesleySmith

I found that I could cause the wait.bat file to not show any windows by making a few changes in the PrepareExecution function in the WaitForApplicationExitProcessor.cs file. Find the code where it creates the ProcessStartInfo object for wait.bat (near line 180), and replace it with this code:

-----------

// Spawn the wait process
ProcessStartInfo psi = new ProcessStartInfo( "wait.bat" );

// The process Id the processor must wait to end
psi.Arguments = String.Format( CultureInfo.InvariantCulture, "{0} {1}", processId, taskToProcess.Manifest.Application.ApplicationId );

psi.CreateNoWindow = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.RedirectStandardInput = true;
psi.UseShellExecute = false;
Process.Start( psi );

-------

I'm not 100% sure that all of those options to psi are necessary, but they seemed to work fine for me.
Jun 14, 2005 at 7:22 PM
originally posted by: jcoltr

When I added your code, the wait.bat file cleanups never happened. Everything worked as expected if I just used the following two psi.* lines:

psi.CreateNoWindow = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
Jun 15, 2005 at 6:10 AM
originally posted by: spideros

I appreciate your help but we gave up on updater block.

Thanks

Paulo Rosa
Sep 22, 2009 at 10:03 AM
Edited Sep 22, 2009 at 10:37 AM

Even I had to struggle a lot in the beginning but thank god everything is working perfectly now...

The code above by jcoltr worked for me.