2012/7/6 Adam Thorn <alt36 at cam.ac.uk> > > > <!-- Uninstall returns immediatly, so just wait a few seconds > > > for it to remove before checking the status again > > > Unfortunatly, WINDOWS has no sleep commands --> > > > <remove cmd='%COMSPEC% /C ping -n 5 127.0.0.1 1>NUL 2>NUL' > > > > <exit code="any" /> > > > </remove> > > > > > > This way, the process will wait a few seconds, which should be enough > > > for the uninstall to complete before the checks run > > > > That's right, yet the solution not only introduces an often too long > delay, > > but is also fragile as a slower system might very well need more time > than > > that. I described a cleaner solution for most NSIS based setups a while > ago > > here: > > > > http://bugzilla.wpkg.org/show_bug.cgi?id=241#c3 > > For some of my packages I make use of a brief script > (waitforprocess.cmd) which does: > > @echo off > > :loop > tasklist | find /I "%1" > NUL > if ERRORLEVEL 1 goto jump > goto loop > :jump > > and my <remove> process goes something like > > <remove cmd='%software%\wpkg\tools\waitforprocess.cmd uninstall.exe' /> > <remove cmd='"%ProgramFiles%\Notepad++\uninstall.exe" /S' /> > <remove cmd='%software%\wpkg\tools\waitforprocess.cmd uninstall.exe' /> > > i.e., wait until there are no other uninstall.exe processes running > (e.g. the user is running something of their own), then run > uninstall.exe, and wait until it finishes. > > Although it's horribly unpleasant, for some of my packages I've yet to > find a better way of handling this. > > Adam > Thanks ! Solution of Daniel works for this application. Cédric -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20120706/3f7baf6d/attachment.html> |