[wpkg-users] Forgot command, exit status 0?

Rainer Meier r.meier at wpkg.org
Tue Mar 10 17:00:27 CET 2009


Hi Marco,

Marco Gaiarin wrote:
> But this is the WSH 'exec()' implementation or a peculiarity of
> windows?
> I'm a UNIX guy, but this seems to me totaly broken... ;)))
> 
> 
> Generally speaking: would be feasable to run every
> install/upgrade/remove line against cmd /c, to have better error
> control?

OK, I am mainly working on Unix shells too. However it seems to be true
that exec() is returning 0 exit status here if the binary to be executed
is not found. I will verify this but I am quite sure it's true.

Running everything on cmd would not be a good idea either. First of all
cmd.exe does not pass through the last error of the command - at least
it looks like. When you open cmd.exe and enter "blabla.exe" end check
%ERRORLEVEL% then you get 9009. When running "cmd /c blabla.exe" and
then check %ERRORLEVEL% then you get 1.

In addition running every command on cmd.exe would invoke another
process (slower and takes more resource) as well as it could create some
confusion/problems with 64-bit or 32-bit version of cmd.exe to be run.

I think the approach to execute the commands exactly as entered within
the xml definition is the most clear and obvious way to process the
commands.

Personally I prefer to execute only one single cmd script for each
install/uninstall action. This script can be easily extended to handle
very complex installations as well as pre- and post-installation
scripts. This gives a lot of flexibility but of course requires some
scripting skills.

Also WPKG supports debugging quite well by printing corresponding
messages to the event log or log-files. So you would see immediately if
something you describe happens in your installations.

I would agree to you that exec() should not return with 0 return value
if the command is not found. As written I will verify if it is a bug of
wpkg.js or the just "by design".

br,
Rainer



More information about the wpkg-users mailing list