[wpkg-users] Wrapper hints...

Rainer Meier r.meier at wpkg.org
Fri Apr 11 11:31:17 CEST 2008


Hi Marco,

Marco Gaiarin wrote:
> Now i've looked at the 64/32 bit wrapper script, and see no things like
> that (and really this feel strange to me, normally stdout go to stdout
> and stderr to stderr, why reapup and re-copy them?).
> 
> It is superfluous? Thanks.

Earlier versions did just execute wpkg.js. However somehow the STDOUT of 
the called script is not automatically re-directed to STDOUT of the 
calling script. I tried to find a way but there seems to be really no 
possibility at all to have a script called by JScript to output directly 
to the calling console (executing within the same window).
Unfortunately exactly this functionality is absolutely required if 
wrapper.js needs to forward STDOUT of the called wpkg.js to its own 
STDOUT. The reason is the new status print feature of WPKG 1.1.0-M3 and 
newer. It allows WPKG client to read the current synchronization status 
in order to display some messages to the user. This program cannot open 
STDOUT of the child process of wrapper.js. Therefore wrapper.js needs to 
read it and forward it.

Additionally it a timeout (maximum wpkg.js run time) was introduced.
In any case I fully agree that the solution is quite ugly. Mainly due to 
JScript limitations. Well I would say even "bugs", not just limitations. 
For example when reading from STDOUT with certain methods or when 
checking for the end of the stream it just waits there for the 
termination of the child process. As a result wrapper.js will not print 
anything and when wpkg.js terminates it will print all status messages 
at once which is definitely not what we want to achieve.

In general I do not recommend using wrapper.js in conjunction with the 
status print feature (which is anyway not available yet by WPKG client).

In any case wrapper.js is just a work-around to allow WPKG execution on 
64-bit operating systems. To be more precise it allows WPKG to run in 
64-bit mode and therefore to access all (32- and 64-bit) registry keys 
and especially the files (e.g. the "real" content of the 64-bit 
"c:\program files" folder, 32-bit applications will see a copy of 
"c:\program files(x86)" there).

Therefore wrapper.js will disappear as soon as WPKG client is available 
as a 64-bit version which can call 64-bit cscript.exe.

br,
Rainer



More information about the wpkg-users mailing list