[wpkg-users] Testing is a specific process is running
LAPLAUD François
laplaud at sdis72.fr
Fri May 20 11:15:32 CEST 2011
Here is the beginning of my package.
<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package
id="firefox4"
name="Mozilla Firefox 4"
revision="%version%"
reboot="false"
priority="10"
notify="false">
<chain package-id="flashplayer_mozilla" />
<variable name="version" value="4.0.1" />
<variable name="architecture" value="x86" />
<variable name="locale" value="fr" />
<check type="uninstall" condition="exists" path="Mozilla Firefox %version% (%architecture% %locale%)" />
<install cmd='%COMSPEC% /c %SystemRoot%\system32\tasklist.exe /FI "IMAGENAME eq firefox.exe" 2>NUL | %SystemRoot%\system32\find.exe /I /N "firefox.exe" >NUL'/>
<install cmd='"%SOFTWARE%\packages\Firefox\Firefox Setup 4.0.1.exe" -ms' />
[...]
Here is the log when firefox is not running. :
2011-05-19 17:13:02, DEBUG : Executing command: %COMSPEC% /c %SystemRoot%\system32\tasklist.exe /FI "IMAGENAME eq firefox.exe" 2>NUL \| %SystemRoot%\system32\find.exe /I /N "firefox.exe" >NUL
2011-05-19 17:13:03, ERROR : Could not process (install) package 'Mozilla Firefox 4' (firefox4):|Exit code returned non-successful value (1) on command '%COMSPEC% /c %SystemRoot%\system32\tasklist.exe /FI "IMAGENAME eq firefox.exe" 2>NUL \| %SystemRoot%\system32\find.exe /I /N "firefox.exe" >NUL'.
Francois Laplaud
-----Message d'origine-----
De : Chris Mortimer [mailto:cm214 at cam.ac.uk]
Envoyé : vendredi 20 mai 2011 10:52
À : LAPLAUD François
Objet : Re: [wpkg-users] Testing is a specific process is running
Hello,
Strange, for me with a test package using your line below, it works.
What's you xml file look like, my test install is below (installing dia
install):
<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package id="test" name="testing 123" revision="1" reboot="false"
priority="63">
<variable name="proc" value="firefox.exe"/>
<variable name="version" value="0.97.1" />
<install cmd='%COMSPEC% /c %SystemRoot%\system32\tasklist.exe
/FI "IMAGENAME eq %proc%" | %SystemRoot%\system32\find.exe /I /N
"%proc%" >NUL' />
<install cmd='%SOFTWARE%\graphics\dia\dia-setup-%version%-2.exe
/S' />
</package>
</packages
Changing
<variable name="proc" value="firefox.exe"/>
to
<variable name="proc" value="firef.exe"/>
stops dia-setup-%version%-2.exe from being installed as expected.
Correcting the firefox.exe variable, dia gets installed.
Cheers
--
Chris Mortimer - Computer Officer
Dept of Applied Mathematics, CMS
University of Cambridge. CB3 0WA. UK.
Tel: 01223 760374 Fax: 01223 765900
On 20/05/2011 09:09, LAPLAUD François wrote:
> Hi again for another question...
>
> I would like to install a package only if a specific process is not running.
>
> I read
> http://wpkg.org/Script_for_checking_if_a_process_is_already_running but
> it is explained for win2000 OS.
>
> I want to try it on XP and Seven.
>
> I tried to add this line in my package.xml file.
>
> <install cmd='%COMSPEC% /c %SystemRoot%\system32\tasklist.exe /FI
> "IMAGENAME eq firefox.exe" 2>NUL | %SystemRoot%\system32\find.exe /I /N
> "firefox.exe" >NUL'/>
>
> But it always return 1
>
> This command line works in a shell but not in wpkg. Does anyone of you
> have an idea of what is wrong ? (maybe the pipe is not possible, nor the
> redirection (>) ?
>
> Thanks
>
> *Laplaud François*
>
> *S*ervice*I*nformatique**&*T*ransmission**
>
> *S*ervice *D*épartemental d'*I*ncendie et de *S*ecours de la Sarthe
>
> 13, Boulevard Saint Michel
>
> 72190 Coulaines BP 35
>
> *Tel : 02.43.54.66.06*
>
> *Fax:*02.43.74.37.61
>
> **P********Je pense ENVIRONNEMENT: ai-je vraiment besoin d'imprimer ce
> message ?**
>
>
>
> -------------------------------------------------------------------------
> wpkg-users mailing list archives>> http://lists.wpkg.org/pipermail/wpkg-users/
> _______________________________________________
> wpkg-users mailing list
> wpkg-users at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/wpkg-users
More information about the wpkg-users
mailing list