[wpkg-users] [Bug 272] Wrong exit code from *.cmd files

bugzilla-daemon at bugzilla.wpkg.org bugzilla-daemon at bugzilla.wpkg.org
Fri May 11 18:52:16 CEST 2012


http://bugzilla.wpkg.org/show_bug.cgi?id=272

Rainer Meier <r.meier at wpkg.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |r.meier at wpkg.org
         Resolution|                            |INVALID

--- Comment #3 from Rainer Meier <r.meier at wpkg.org>  ---
Hi Kalyniak,

Let me guess: You're running your script on Windows XP.
This seems to be a speciality of Windows XP cmd.exe. When you use the /b
parameter it only works when terminating a sub-script. But if you're
terminating the main cmd.exe process in your main script with the /b parameter,
then it always returns exit code 0.


The solution is simply not to use the /b parameter.

I've quickly tested with a simple package executing the following script:

--- exit-code-test.cmd ---
@echo off
exit 1616
--- exit-code-test.cmd ---


WPKG logs the following error:

2012-05-11 18:43:29, DEBUG   : Executing command:
'"%SOFTWARE%\software.free\test\exit-code-test.cmd"'
('"\\skynet\reminst\software\software.free\test\exit-code-test.cmd"').
2012-05-11 18:43:30, ERROR   : Could not process (install) package 'tst
package' (tst):|Exit code returned non-successful value (1616) on command
'"%SOFTWARE%\software.free\test\exit-code-test.cmd"'.



When using the /b parameter then WPKG always gets exit code 0 from the OS. So
this is a cmd.exe limitation on Windows XP.

By the way, the /b argument works fine when executed on Windows 7. So Windows 7
cmd.exe correctly returns the specified exit code even if "exit /b xx" is used
to terminate the main cmd script.

-- 
Configure bugmail: http://bugzilla.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the wpkg-users mailing list