<br><br><div class="gmail_quote">2012/7/6 Adam Thorn <span dir="ltr"><<a href="mailto:alt36@cam.ac.uk" target="_blank">alt36@cam.ac.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> >          <!-- Uninstall returns immediatly, so just wait a few seconds<br>
> >               for it to remove before checking the status again<br>
> >               Unfortunatly, WINDOWS has no sleep commands --><br>
> >          <remove cmd='%COMSPEC% /C ping -n 5 127.0.0.1 1>NUL 2>NUL' ><br>
> >              <exit code="any" /><br>
> >          </remove><br>
> ><br>
> > This way, the process will wait a few seconds, which should be enough<br>
> > for the uninstall to complete before the checks run<br>
><br>
> That's right, yet the solution not only introduces an often too long delay,<br>
> but is also fragile as a slower system might very well need more time than<br>
> that.  I described a cleaner solution for most NSIS based setups a while ago<br>
> here:<br>
><br>
> <a href="http://bugzilla.wpkg.org/show_bug.cgi?id=241#c3" target="_blank">http://bugzilla.wpkg.org/show_bug.cgi?id=241#c3</a><br>
<br>
</div>For some of my packages I make use of a brief script<br>
(waitforprocess.cmd) which does:<br>
<br>
@echo off<br>
<br>
:loop<br>
tasklist | find /I "%1" > NUL<br>
if ERRORLEVEL 1 goto jump<br>
goto loop<br>
:jump<br>
<br>
and my <remove> process goes something like<br>
<br>
<remove cmd='%software%\wpkg\tools\waitforprocess.cmd uninstall.exe' /><br>
<remove cmd='"%ProgramFiles%\Notepad++\uninstall.exe" /S' /><br>
<remove cmd='%software%\wpkg\tools\waitforprocess.cmd uninstall.exe' /><br>
<br>
i.e., wait until there are no other uninstall.exe processes running<br>
(e.g. the user is running something of their own), then run<br>
uninstall.exe, and wait until it finishes.<br>
<br>
Although it's horribly unpleasant, for some of my packages I've yet to<br>
find a better way of handling this.<br>
<span class="HOEnZb"><font color="#888888"><br>
Adam</font></span><br></blockquote><div><br><br>Thanks !<br><br>Solution of Daniel works for this application.<br><br>Cédric<br><br> </div></div>