Jump to content

Possible bug, commands are always reported as a success


Recommended Posts

Commands never report as failed when "returned code" is different from zero.

Is this supposed to be normal?

Log output:

-----

Jueves, 01 de Julio de 2010 01:25:24
Program: Test
Unique ID: TEST
Order: 900001
Category: Applications
Jueves, 01 de Julio de 2010 01:25:24 - cmd1 Success (returned code -4321): cmd /c exit -4321
Jueves, 01 de Julio de 2010 01:25:25 - cmd2 Success (returned code 0): cmd /c exit 0
Jueves, 01 de Julio de 2010 01:25:25 - cmd3 Success (returned code 4321): cmd /c exit 4321
Jueves, 01 de Julio de 2010 01:25:25 - Finished installation.

-----

Number of failed installations: 0

Link to comment
Share on other sites


As far as WPI knows/cares, the dos command, exit, ran properly so it was successful. What exit sends to the program launcher is another story. Obviously it isn't listening "properly". Nothing I can do about that.

Link to comment
Share on other sites

Sorry to keep bothering you =) but i think i didn't understand your answer completely. Let me dig.

As far as WPI knows/cares, the dos command, exit, ran properly so it was successful.

Define "ran properly". How does WPIW currently knows an executable ran properly?

As far as i know, a program with an exit/return code different from zero ended "abnormally".

'exit' it's just an internal 'cmd' command that makes the 'cmd.exe' executable end with an specific exit code.

I just used it as an example, and by definition 'cmd.exe' actually didn't run properly on the 1st and 3rd run.

What exit sends to the program launcher is another story. Obviously it isn't listening "properly".

Actually 'cmd.exe' is sending the exit code.

Which launcher? WPIW?

what do you mean with "isn't listening properly"?

Nothing I can do about that.

Actually you can, after launching commands/scripts you can make WPIW wait them to finish (which it seems WPIW currently does),

get its exit code and make the command to report Success/Failure based on its exit code.

I even thought that was the behavior since earlier versions (i've been using WPIW a long time),

but my scripts/commands never were prepared to exit with a meaningful exit code, so i didn't care.

If this isn't a bug, let it be a feature request ;).

Thanks for your time and hard work, WPIW it's saving me a lot of time on my daily work.

Link to comment
Share on other sites

  • 3 weeks later...

I updated the issue to handle the error codes properly. You are right, I had the results wrong. If no code is returned, WPI puts in 999. 0 is success. 1 usually means a file doesn't exist in a cmd call.

cmd /c copy /y a b Used to return success, now returns 1.

If file doesn't exist:

d:\wpi\install\myprog.exe 999 will be returned since nothing was done.

Link to comment
Share on other sites

Yes i did, since i haven't finished updating my scripts to return a meaningful exit code yet, i just made a simple test like the first one i posted.

It seems to work as (I) expected now.

But there may still be one minor bug: "Number of failed installations:" is always zero in logs.

But i don't know what is your definition of a "failed installation", or if it's based on exit codes or something else.

-----

Martes, 27 de Julio de 2010 19:35:49
Program: TEST01
Unique ID: TEST01
Order: 900001
Category: Applications
Martes, 27 de Julio de 2010 19:35:49 - cmd1 *** Fail *** (returned code -4321): cmd /c exit -4321
Martes, 27 de Julio de 2010 19:35:50 - cmd2 Success (returned code 0): cmd /c exit 0
Martes, 27 de Julio de 2010 19:35:50 - cmd3 *** Fail *** (returned code 4321): cmd /c exit 4321
Martes, 27 de Julio de 2010 19:35:50 - Finished installation.

-----

Martes, 27 de Julio de 2010 19:35:50
Program: TEST02
Unique ID: TEST02
Order: 900002
Category: Applications
Martes, 27 de Julio de 2010 19:35:50 - cmd1 *** Fail *** (returned code 321): cmd /c exit 321
Martes, 27 de Julio de 2010 19:35:51 - Finished installation.

-----

Martes, 27 de Julio de 2010 19:35:51
Program: TEST03
Unique ID: TEST03
Order: 900003
Category: Applications
Martes, 27 de Julio de 2010 19:35:51 - cmd1 Success (returned code 0): cmd /c exit 0
Martes, 27 de Julio de 2010 19:35:51 - Finished installation.

-----

Martes, 27 de Julio de 2010 19:35:51
Program: TEST04
Unique ID: TEST04
Order: 900004
Category: Applications
Martes, 27 de Julio de 2010 19:35:51 - cmd1 *** Fail *** (returned code -321): cmd /c exit -321
Martes, 27 de Julio de 2010 19:35:51 - Finished installation.

-----

Number of failed installations: 0

Install process finished at: Martes, 27 de Julio de 2010 19:35:52

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...