[wpkg-users] cmd exit code always 0

Marc Hennes Marc.Hennes at financial.com
Mon Jun 22 17:39:05 CEST 2009


Hi,

maybe I am missing something but it looks to me that a batch file executed in a package always returns exit code 0 although it should return something else. I am using WPKG 1.1.0.

I wrote the following package to add a task to restart the WPKG Client Service at night.


<?xml version="1.0" encoding="ISO-8859-1" ?>
<packages>
<package id='wpkgservicerestarttest' name='Add Task to restart WPKG service' revision='1' priority='3' reboot='false' >
        <variable name='taskname' value='WPKGServiceRestart' />
        <depends package-id='wpkg-update' />
        <check type='execute' path='%SOFTWARE%\scripts\CheckTask.bat' />
        <install cmd='%SOFTWARE%\%LANG%\WPKG\%taskname%.bat' />
        <remove cmd='schtasks /delete /tn "%taskname%" /f' />
        <upgrade cmd='%SOFTWARE%\%LANG%\WPKG\%taskname%.bat' />
</package>
</packages>

The script %SOFTWARE%\scripts\CheckTask.bat requires a task name and if no argument is given it exits with error code 2 (see attachment, its txt because the list refused zip files). But when I run WPKG the following happens:

2009-06-22 17:22:37, DEBUG   : Executing command: %COMSPEC% /c \\OB1NWS801\WPKG\Software\scripts\CheckTask.bat >NUL 2>&1
2009-06-22 17:22:38, DEBUG   : No execute condition specified, assuming exit code of 0 to be successful, everything else to be unsuccessful
2009-06-22 17:22:38, DEBUG   : Execute check for program '\\OB1NWS801\WPKG\Software\scripts\CheckTask.bat' returned '0'. Evaluating condition 'null' rev
ealed true when comparing to expected value of '0'


I saw that behavior not only in the check section but also in install section. The WPKGServiceRestart.bat exited with a non 0 value but WPKG assumed it exited with 0.

Am I missing something or is this a bug?

Marc

--
Tel. +49 (0) 89 / 31 85 28 - 45
Fax. +49 (0) 89 / 31 85 28 - 28

E-Mail: marc.hennes at financial.com
Web: www.financial.com


financial.com AG

Munich head office/Hauptsitz M?nchen: Maria-Probst-Str. 19 | 80939 M?nchen | Germany
Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany
Management board/Vorstand: Dr. Steffen Boehnert (CEO/Vorsitzender) | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach
Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender)
Register court/Handelsregister: Munich - HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CheckTask.txt
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20090622/a01af819/attachment-0001.txt>


More information about the wpkg-users mailing list