[wpkg-users] Check type execute

Rainer Meier r.meier at wpkg.org
Mon Apr 14 10:18:39 CEST 2008


Hi Daniel,



Daniel Dehennin wrote:
> Looking at the ChangeLog of WPKG, I saw that an execute check was
> added.

Only for the 1.1.0-M milestone test releases. This feature is not 
available for the current 1.0 stable release.


> Why is it used like this:
> 
> <check type="execute" path="\path\to\a\script.cmd"/>
> 
> and not
> 
> <check type="execute" cmd="somecommand.cmd" />

This is due to the fact that all checks follow the same XML node type 
format (and are derived from the same node type "check"). This format 
looks as follows:

<check type="" condition="" path="" value="" />

So it was chosen to put the path to the script to be executed into the 
"path" attribute which does not look that "strange" I think. Introducing 
a new node type with completely different format (not derived from 
"check") would create much more confusion. One could argue that the 
"uninstall" check is much more irrational since it requires to specify 
the name of the uninstall entry within the "path" attribute. However I 
don't think this is a blocker and the documentation within the XSD files 
for all checks clearly specifies which values have to be specify within 
which attribute.


> Does the path attribut mean that we must provide a batch script and a
> command is not allowed?

WPKG will simiply pass the value within the path attribute to the 
WScript.Shell.Exec() method. So it can also be any other program within 
the PATH or somewhere available on the system. Strictly speaking you 
cannot enter "commands". Commands are usually referred to be internal 
commands of the Windows CMD shell. Of course they are not available 
outside the CMD shell. To execute such commands you need to invoke cmd: 
"cmd /c <some command here>".
So the actual process to be executed is "cmd.exe" which will interpret 
your command.


> Can I give parameters to the script ?

This should work. As written above, it's just passed to the Exec() 
method available to JSCript.

br,
Rainer



More information about the wpkg-users mailing list