[wpkg-users] WPKG and WOL (WAS: Re: Global max execution time hardcoded?)
heiko.helmle at horiba.com
heiko.helmle at horiba.com
Mon Apr 8 09:33:24 CEST 2013
wpkg-users-bounces at lists.wpkg.org wrote on 04.04.2013 23:21:11:
> how do you installed this script?
Via WPKG - it's activated by the task scheduler - once when a user logs in
and again about 10 minutes before everybody goes to lunch.
> do you have a package definition for it?
<package id='wpkggp-activator'
name='WPKGGP Conditional Activator'
revision='1'
priority='0'>
<check type='logical' condition='and'>
<check type='execute' path='schtasks /query /TN
WPKG-Activator' condition='exitcodeequalto' value='0'/>
<check type='file' path='%TOOLDIR%\wpkg-activator.cmd'
condition='exists'/>
</check>
<variable name='toolurl'
value='http://wpkg.head.de/wpkg-testing/dist/wpkg-activator.cmd'/>
<variable name='schedurl'
value='http://wpkg.head.de/wpkg-testing/dist/WPKG-Activator.xml'/>
<install cmd='%TOOLDIR%\curl.exe -f -s -o
"%TOOLDIR%\wpkg-activator.cmd" "%toolurl%"'/>
<install cmd='%TOOLDIR%\curl.exe -f -s -o
"%TOOLDIR%\WPKG-Activator.xml" "%schedurl%"'/>
<install cmd='schtasks /Delete /F /TN WPKG-Activator'>
<exit code='1'/>
</install>
<install cmd='schtasks /create /xml "%TOOLDIR%\WPKG-Activator.xml"
/TN WPKG-Activator'/>
</package>
> i think it would be very helpful to write a wiki page on this topic.
I thought about it, but the script is ugly :)
> the other thing we want to look at your implementation is the "Report
> Packaging Errors" package, if you can, i would appreciate that you send
> (to me or to the list) that scripts and package definitions, as you
> explained it seems to be a better way of doing some error detection.
It's not neccessarily a better way. But the script is fortunately
extremely simple (it needs curl.exe in the same directory and uploads the
log to a ftp server):
--- reporterrors.cmd
goto test
:wait
REM There's no sleep in CMD...
ping localhost
:test
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WPKG /v running | find "true"
if %ERRORLEVEL% EQU 0 goto wait
FIND "ERROR" "%TEMP%\wpkg-%COMPUTERNAME%.log"
if %ERRORLEVEL% NEQ 0 goto end
"%~dp0\curl.exe" -f -s ftp://server/wpkg-log/ -T
"%TEMP%\wpkg-%COMPUTERNAME%.log"
:end
---
and call it with this WPKG-package:
<package id='reporterror'
name='Report Packaging Errors'
revision='4'
priority='0'
execute='changed'>
<install cmd='"%COMSPEC%" /C start "reporterrors" "%COMSPEC%" /C
"%TOOLDIR%\reporterrors.cmd"'/>
<upgrade include='install'/>
</package>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20130408/d9c643c1/attachment-0003.html>
More information about the wpkg-users
mailing list